safe-args
在操作中使用导航(带有Directions类)时,传递它非常容易。但是safe-args
在使用导航直接分段的情况下如何通过?
navController?.navigate(R.id.detailFragment)
Run Code Online (Sandbox Code Playgroud)
导航图:
<fragment
android:id="@+id/detailFragment"
android:name="com.example.ui.main.detail.DetailFragment"
android:label=" "
tools:layout="@layout/detail_fragment" >
<argument
android:name="templateCode"
app:argType="string" />
<action
android:id="@+id/action_start_guide"
app:destination="@id/fillInfoFragment" />
</fragment>
Run Code Online (Sandbox Code Playgroud) navigation android android-jetpack android-architecture-navigation
目前,我正在使用data binding
两种情况:
views
以片段方式访问view model
。当我与 进行比较时view binding
,我发现两种方法都很好(view binding
更好地访问views
、data binding
绑定数据),那么MVVM 应该首选哪种模式?
我应该只移动view binding
并处理ViewModel-layout
片段中的连接吗?
architecture android mvvm android-databinding android-viewbinding
将 AGP 迁移到 7.0.0 后,某些声明已被弃用,应由属性替换。当属性只是一个值时flavorDimensions
如何替换声明?resConfigs