像navigation-fragment一样,Compose 针对 Navigator 以及 NavDestination 都是自己的具体实现,有点特殊的是 NavHost,它只是一个 Composable 函数,所以与公共库没有继承关系: 不同于 Fragment 这样对象组件,Compose 使用函数定义页面,那么navigation-compose是如何将 Navigation 落地到 Compose 这样的声明式框架中的呢?接下...
<!-- https://mvnrepository.com/artifact/androidx.navigation/navigation-fragment-compose --> <dependency> <groupId>androidx.navigation</groupId> <artifactId>navigation-fragment-compose</artifactId> <version>2.9.0-alpha04</version> </dependency> Include comment with link to declaration Note...
我们有一个遗留的应用程序,我们开始将其迁移到 Jetpack Compose 平台。该应用程序只有一个 Activity,并使用 Navigation 组件及导航 XML 图形在 Fragment 之间进行导航。 我们采用以下方法: - 每次迁移一个 Fragment - 为每个 Fragment 制作一个 @Composable 屏幕,提供与该 Fragment 相同的 UI。 - 从 Fragment 的 ...
Butterfly supports navigation for Activity、Fragment and DialogFragment and Compose UI component @Agile("test/activity")classAgileTestActivity:AppCompatActivity() @Agile("test/fragment")classTestFragment:Fragment() @Agile("test/dialog")classTestDialogFragment:DialogFragment() @Agile("test/compose") @Comp...
Butterfly is a navigation framework based on Coroutine + Annotation + Ksp. Support navigation for Activity, Fragment, DialogFragment and Compose. - ssseasonnn/Butterfly