Android Single Activity Framework compatible with Fragment.
Android Single Activity Framework compatible with Fragment.
Scene is a lightweight library of navigation and UI composition based on view.
Download the latest Sample APK
Scene is designed to replace the use of Activities and Fragments for navigation and page segmentation in Android applications. It addresses the following issues:
Scene provides a simple, reliable, and extensible API for lightweight, high-performance navigation and page management. We also offer a set of migration solutions to help developers gradually transition from Activities and Fragments to Scene.
Add it to your root build.gradle at the end of repositories:
//build.gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}//or settings.gradle.kts
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
...
maven { url = uri("https://jitpack.io") }
}
}Add it to your build.gradle, latest_version :
……For simple usage, just let your Activity inherit from SceneActivity:
class MainActivity : SceneActivity() {
override fun getHomeSceneClass(): Class<out Scene> {
return MainScene::class.java
}
override fun supportRestore(): Boolean {
return false
}
}A simple Scene example:
……https://github.com/bytedance/scene/wiki/Compose
Scene sample is built using Gradle. On Linux, simply run:
./gradlew installDebughttps://github.com/bytedance/scene/wiki
A normal Dialog's Window is independent and in front of the Activity's Window, so if try to push a Scene in a opening Dialog, it will cause the Scene to appear behind it. You can close the dialog box when click, or use transparent Scene to implement the dialog instead of a system Dialog.
| TikTok | Douyin | Xigua Video | Toutiao | KeSong |
Copyright (c) 2019 ByteDance Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.No open issues yet, or sync has not completed.