android-architecture-navigation

Android Navigation Component pop to transition issue

我是研究僧i 提交于 2019-11-30 09:15:56
I have 2 actions Action1 <action android:id="@+id/actionBaseFragmentToAskForLocation" app:destination="@+id/introAskForLocationFragment" app:enterAnim="@anim/slide_in_right" app:exitAnim="@anim/slide_out_left" app:popEnterAnim="@anim/slide_in_left" app:popExitAnim="@anim/slide_out_right" /> Action2 <action android:id="@+id/actionIntroAskLocationToLogin" app:destination="@id/loginFragment" app:enterAnim="@anim/slide_in_right" app:exitAnim="@anim/slide_out_left" app:popEnterAnim="@anim/slide_in_right" app:popExitAnim="@anim/fade_out" app:popUpTo="@+id/app_main_navigation" /> What i want is when

Navigation Architecture Component - New Resource dialog doesn't have Navigation resource type for navigation graph

跟風遠走 提交于 2019-11-30 08:07:08
New Resource dialog doesn't have Navigation resource type for navigation graph even after adding Navigation Architecture Component dependencies def nav_version = '1.0.0-alpha01' implementation "android.arch.navigation:navigation-fragment:$nav_version" implementation "android.arch.navigation:navigation-ui:$nav_version" Bartosz Musiał Make sure that you checked the box Settings -> Experimental -> Enable Navigation Editor . The Navigation Editor is an experimental feature, so you must first enable it by opening the IDE Settings/Preferences dialog, selecting Experimental in the left pane, and

Navigation Architecture Component - Dialog Fragments

Deadly 提交于 2019-11-30 07:54:50
Is it possible to use the new Navigation Architecture Component with DialogFragment? Do I have to create a custom Navigator? I would love to use them with the new features in my navigation graph. No, as of the 1.0.0-alpha01 build, there is no support for dialogs as part of your Navigation Graph. You should just continue to use show() to show a DialogFragment . MatPag May 2019 Update : DialogFragment are now fully supported starting from Navigation 2.1.0-alpha03 , you can read more here and here Old Answer for Navigation <= 2.1.0-alpha02: I proceeded in this way: 1) Update Navigation library at

Navigation Architecture Component- Passing argument data to the startDestination

孤街醉人 提交于 2019-11-30 07:49:17
问题 I have an activity A that start activity B passing to it some intent data. Activity B host a navigation graph from the new Navigation Architecture Component.I want to pass that intent data to the startDestination fragment as argument how to do that? 回答1: TLDR: You have to manually inflate the graph, add the keys/values to the defaultArgs, and set the graph on the navController . Step 1 The documentation tells you to set the graph in the <fragment> tag in your Activity 's layout. Something

Navigation Architecture Component - Splash screen

廉价感情. 提交于 2019-11-30 06:49:43
I would like to know how to implement splash screen using Navigation Architecture Component. Till now I have something like this A user has to setup his profile in ProfileFragment for the first time and can edit their profile from ChatFragment . My problem is I don't know how to remove SplashFragment from stack after navigation. I've seen conditional navigation but didn't quite understand. There is a common misuse of the splash screen when it is shown to the user for some amount of seconds, and users are wasting their time looking at the Splash screen while they could already interact with the

How to implement shared transition element form RcyclerView's item to Fragment with Android Navigation Component?

旧街凉风 提交于 2019-11-30 04:19:29
问题 I have a pretty straightforward case. I want to implement shared element transition between item in RececlerView and fragment . I'm using android navigation component in my app. There is an article about shared transition on developer.android and topic on stackoverflow but this solution works only for view that located in fragment layout that starts transition and doesn't work for items from RecyclerView . Also there is a lib on github but i don't want to rely on 3rd party libs and do it by

Android JetPack navigation with multiple stack

烂漫一生 提交于 2019-11-30 04:04:34
I'm using Jetpack Navigation version 1.0.0-alpha04 with bottom navigation. It works but the navigation doesn't happen correctly. For example, if I have tab A and tab B and from tab A I go to Page C and from there I go to tab B and come back to tab A again, I will see root fragment in the tab A and not page C which does not what I expect. I'm looking for a solution to have a different stack for each tab, so the state of each tab is reserved when I come back to it, Also I don't like to keep all this fragment in the memory since it has a bad effect on performance, Before jetpack navigation, I

Android Jetpack Navigation with ViewPager and TabLayout

荒凉一梦 提交于 2019-11-30 02:20:14
For a new app i use Jetpack Navigation Library to implement proper back navigation. The first level of navigation is a navigation drawer which works fine with jetpack navigation as described in the documentation. But there is another level of navigation implemented with ViewPager and TabLayout. The fragments switched by the TabLayout contain additional linear navigation hierarchy. However, there seems to be no support for ViewPager/TabLayout in Jetpack Navigation. A FragmentPagerAdapter has to be implemented and the managed back stack ends when switching tabs. There is a disconnect between the

Dynamic ActionBar title from a Fragment using AndroidX Navigation

对着背影说爱祢 提交于 2019-11-30 01:41:33
I am using the new Navigation component from Android Jetpack. The root Activity setup is quite simple: override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) setSupportActionBar(toolbar) val navController = findNavController(R.id.navigationFragment) setupActionBarWithNavController(navController) bottomNavigationView.setupWithNavController(navController) } It works well when the Fragment's title is defined in the navigation graph. But for one Fragment, I want to set the title dynamically. I tried with findNavController()

Android Jetpack Navigation, BottomNavigationView with Youtube or Instagram like proper back navigation (fragment back stack)?

偶尔善良 提交于 2019-11-29 19:40:46
Android Jetpack Navigation, BottomNavigationView with auto fragment back stack on back button click? What I wanted, after choosing multiple tabs one after another by user and user click on back button app must redirect to the last page he/she opened. I achieved the same using Android ViewPager, by saving the currently selected item in an ArrayList. Is there any auto back stack after Android Jetpack Navigation Release? I want to achieve it using navigation graph activity_main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas