Fixed
Status Update
Comments
il...@google.com <il...@google.com> #2
Nested scrolling works partially (as per http://b/122818889 ). Let's discuss if we need full support and if so make sure it works.
ca...@gmail.com <ca...@gmail.com> #3
Hi!
What is 'partially' exactly?
How do I see it?
Thanks!
What is 'partially' exactly?
How do I see it?
Thanks!
ca...@gmail.com <ca...@gmail.com> #4
As of now:
- Nesting scroll views with a scroll direction perpendicular to the ViewPager2's orientation inside ViewPager2 works
- Nesting scroll views with a scroll direction parallel to the ViewPager2's orientation inside ViewPager2 does not work
- Nesting scroll views with a scroll direction perpendicular to the ViewPager2's orientation inside ViewPager2 works
- Nesting scroll views with a scroll direction parallel to the ViewPager2's orientation inside ViewPager2 does not work
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #5
Horizontal ViewPager2 not correctly working into a vertical RecyclerView
Set a setNestedScrollingEnabled to the RecyclerView into the ViewPager2 (across reflection) resolves the problem
Set a setNestedScrollingEnabled to the RecyclerView into the ViewPager2 (across reflection) resolves the problem
il...@google.com <il...@google.com> #6
ageevvalentin@gmail.com, could you provide a sample app? I'd like to learn more about the circumstances that cause the problem; putting a clean ViewPager2 inside a clean RecyclerView seems to work fine, so there must be other factors involved.
Description
Version used: 1.0.0-alpha09
Devices/Android versions reproduced on: N/A
I have started to make use of the Navigation Component and am very please with it. Well done!
Once recommendation I would like to make, however, is to add some better support for configuring custom Destinations when used with the NavHostFragment. The problem that I am having is that in order to configure a custom Destination Navigator, I need to get reference to the NavigatorProvider from the NavController. If I am using a NavHostFragment, then I must first load the Fragment to have its onCreate method called. I then must call navController.navigatorProvider.addNavigator(...) BEFORE I subsequently call navController.setGraph(...). This means that I cannot specify the graph directly in my XML. In fact, if I make use of the app:navGraph attribute I get a crash because my custom Destination nodes have no configured Navigators.
I've looked into extending NavHostFragment with an implementation that automatically calls navigatorProvider.addNavigator(...). But since the NavController is instantiated in NavHostFragment.onCreate() and the XML-configured graph resource ID is handled in the same method, there is no integration point between these 2 operations that allows for additional Navigators to be configured before the graph xml is inflated. As a result the only way that I've found to do the configuration is do the following:
1. Do NOT specify the NavHostFragment via a fragment tag in the XML. Instead add a FrameLayout container.
2. Manually instantiate an instance of NavHostFragment, and load it via a FragmentTransaction.
3. Manually configure the custom Destination Navigator via navHostFragment.navController.navigatorProvider.addNavigator(...)
4. Manually call navHostFragment.navController.setGraph(...)
It's not a huge problem, but it did take a good bit of experimenting before I figured this out. (I.e. the docs for custom destinations could be better.)
Perhaps a later version of NavHostFragment could have an additional overridable method that could be overridden to specify a list of additional Navigators. ?