-
Notifications
You must be signed in to change notification settings - Fork 205
Add Scene via XML
qiibeta edited this page Oct 29, 2019
·
9 revisions
Add Scene via XML can reduce view hierarchy, ScenePlaceHolderView will be replace by Scene created view.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<...>
<...>
<com.bytedance.scene.group.ScenePlaceHolderView
app:name="com.bytedance.scenedemo.group.EmptyScene"
app:tag="TAG"
android:id="@+id/scene"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
Before GroupScene enter onActivityCreated(), all ScenePlaceHolderViews will be replace to target Scene's view instance
Add these codes to GroupScene onViewCreated() method
val bundle = Bundle()
val placeHolderView = requireViewById<ScenePlaceHolderView>(R.id.scene)
placeHolderView.arguments = bundle
- Home
- Background
- Installation
- Basic
- NavigationScene
- GroupScene
- Navigation Animation
- Dialog
- Router
- Style
- State Save
- Architecture-Patterns
- Activity Compatibility
- Migrate Guide
- Benchmark (compare to Activity/Fragment)