android-architecture-navigation

Navigation Architecture Component - BottomNavigationView with Login Screen

孤人 提交于 2020-05-05 19:49:52
问题 I have my MainActivity setup which looks like this : <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".ui.host.HostActivity"> <fragment android:id="@+id/mainNavigationFragment" android:name="androidx.navigation.fragment.NavHostFragment" android

Navigation Architecture Component - BottomNavigationView with Login Screen

萝らか妹 提交于 2020-05-05 19:49:50
问题 I have my MainActivity setup which looks like this : <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".ui.host.HostActivity"> <fragment android:id="@+id/mainNavigationFragment" android:name="androidx.navigation.fragment.NavHostFragment" android

Navigation Architecture Component - BottomNavigationView with Login Screen

别等时光非礼了梦想. 提交于 2020-05-05 19:48:49
问题 I have my MainActivity setup which looks like this : <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".ui.host.HostActivity"> <fragment android:id="@+id/mainNavigationFragment" android:name="androidx.navigation.fragment.NavHostFragment" android

Navigation Architecture Component - BottomNavigationView with Login Screen

大兔子大兔子 提交于 2020-05-05 19:48:12
问题 I have my MainActivity setup which looks like this : <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".ui.host.HostActivity"> <fragment android:id="@+id/mainNavigationFragment" android:name="androidx.navigation.fragment.NavHostFragment" android

can I send nullable data type as argument using safeargs ? if not what should I do?

南楼画角 提交于 2020-04-30 06:26:25
问题 say I have 2 fragments. Login and Home. I set Home fragment as a global destination that has userData as arguments if the user is not logged in yet, then it will start from login fragment. after login and get userData from server then it will navigate to Home and pass userData using this code val home = AuthenticationFragmentDirections.actionGlobalHomeFragment(userData) Navigation.findNavController(view).navigate(home, navOptions) but the problem is when the user already login and open the

can I send nullable data type as argument using safeargs ? if not what should I do?

 ̄綄美尐妖づ 提交于 2020-04-30 06:25:27
问题 say I have 2 fragments. Login and Home. I set Home fragment as a global destination that has userData as arguments if the user is not logged in yet, then it will start from login fragment. after login and get userData from server then it will navigate to Home and pass userData using this code val home = AuthenticationFragmentDirections.actionGlobalHomeFragment(userData) Navigation.findNavController(view).navigate(home, navOptions) but the problem is when the user already login and open the

setupWithNavController method for toolbar no longer available?

二次信任 提交于 2020-04-18 05:44:29
问题 so previously I had crash with error: You must call setGraph() before calling getGraph() then after reading the solution frem here. it is said that I have to use these lines on my gradle implementation "androidx.navigation:navigation-fragment:2.3.0-alpha02" implementation "androidx.navigation:navigation-ui:2.3.0-alpha02" and the error is dissapear. but now I no longer can find setupWithNavController method. usually I use this line toolbar.setupWithNavController(navController

setupWithNavController method for toolbar no longer available?

北城以北 提交于 2020-04-18 05:44:13
问题 so previously I had crash with error: You must call setGraph() before calling getGraph() then after reading the solution frem here. it is said that I have to use these lines on my gradle implementation "androidx.navigation:navigation-fragment:2.3.0-alpha02" implementation "androidx.navigation:navigation-ui:2.3.0-alpha02" and the error is dissapear. but now I no longer can find setupWithNavController method. usually I use this line toolbar.setupWithNavController(navController

how to remove back button in the toolbar of top level fragment if I set toolbar in each fragment using navigation component?

旧城冷巷雨未停 提交于 2020-04-17 21:59:36
问题 I have tried to read this but my problem is little bit different. I need some different toolbars, so according the documentation from here , I need to set the toolbar in each of my fragment not in my MainActivity. so I set the toolbar in each xml of my fragment. and then in each fragment I use this code to set the toolbar override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) val toolbar = view.findViewById<androidx.appcompat.widget

how to remove back button in the toolbar of top level fragment if I set toolbar in each fragment using navigation component?

混江龙づ霸主 提交于 2020-04-17 21:58:48
问题 I have tried to read this but my problem is little bit different. I need some different toolbars, so according the documentation from here , I need to set the toolbar in each of my fragment not in my MainActivity. so I set the toolbar in each xml of my fragment. and then in each fragment I use this code to set the toolbar override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) val toolbar = view.findViewById<androidx.appcompat.widget