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.
[Deleted User] <[Deleted User]> #3
Hi!
What is 'partially' exactly?
How do I see it?
Thanks!
What is 'partially' exactly?
How do I see it?
Thanks!
[Deleted User] <[Deleted User]> #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> #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
ap...@google.com <ap...@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.
jb...@google.com <jb...@google.com> #7
Added a patch for androidx-master-dev that demos a horizontal ViewPager2 inside a vertical RecyclerView.
Verified that it works correctly on a:
- Nexus 4 emulator with API 17
- Nexus 5X emulator with API 28
- Pixel 2 device with API 29
To reproduce:
- Check out the Android Jetpack source (at commit 256899f482ff85cddfb050f37550be7b5ec927ef) (see steps in [1])
- Apply the patch (`git apply 0001-Add-sample-where-a-horizontal-ViewPager2-is-nested-i.patch`)
- Build and install viewpager2's integration-tests app: `./gradlew viewpager2:integration-tests:testapp:installDebug`
- Run it
Closing the issue for now, but please reopen if you have a minimal reproduction app
[1]https://android.googlesource.com/platform/frameworks/support/+/256899f482ff85cddfb050f37550be7b5ec927ef
Verified that it works correctly on a:
- Nexus 4 emulator with API 17
- Nexus 5X emulator with API 28
- Pixel 2 device with API 29
To reproduce:
- Check out the Android Jetpack source (at commit 256899f482ff85cddfb050f37550be7b5ec927ef) (see steps in [1])
- Apply the patch (`git apply 0001-Add-sample-where-a-horizontal-ViewPager2-is-nested-i.patch`)
- Build and install viewpager2's integration-tests app: `./gradlew viewpager2:integration-tests:testapp:installDebug`
- Run it
Closing the issue for now, but please reopen if you have a minimal reproduction app
[1]
ra...@gmail.com <ra...@gmail.com> #8
Re-opening as requested by a few users. Narrowed down the focus to nested scrolling elements with the same scroll direction.
jb...@google.com <jb...@google.com> #9
Any progress on this? (only talking about the "same scroll direction" issue)
I searched a lot for workarounds on Google and SO, but it seems no one really found a suitable solution yet.
The thing is that all other VerticalViewPagers out there have other problems that are similarly annoying. Most of them revolve around touch issues like "What's a click and what's a swipe" or "what's the fling threshold to snap to the next page".
So if someone knows of a working sample of VerticalViewPagers, I'd be happy to see a link :)
I searched a lot for workarounds on Google and SO, but it seems no one really found a suitable solution yet.
The thing is that all other VerticalViewPagers out there have other problems that are similarly annoying. Most of them revolve around touch issues like "What's a click and what's a swipe" or "what's the fling threshold to snap to the next page".
So if someone knows of a working sample of VerticalViewPagers, I'd be happy to see a link :)
Description
Version used: 2.0.0
Devices/Android versions reproduced on: during development; any IDE
SDK: Java
Summary:
I can't unit test any production code that tries navigating to an auto-generated Action class that has a default value. It seems (in version 2.0.0) that the default values are set by the NavController instead of baked into the auto-generated class. The result is that I get some NullPointerExceptions when trying to unit test navigation.
To reproduce:
1. In nav graph xml, add an argument having a default value to an action
<fragment
android:id="@id/screen1_fragment"
android:name="com.yourapp.yourpackage.Screen1Fragment"
<action
android:id="@+id/action_screen1_to_screen2"
app:destination="@id/screen2_fragment"
<argument
android:name="myBoolean"
app:argType="boolean"
android:defaultValue="false" />
</action>
</fragment>
2. In prod code, navigate using this action without overriding the default
NavController.navigate(Screen1FragmentDirections.actionScreen1ToScreen2());
3. In a unit test, try to verify that the screen1-to-screen2 navigation was invoked
verify(NavController).navigate(Screen1FragmentDirections.actionScreen1ToScreen2());
Expected: Unit test passes with flying colors
Actual: NullPointerException is thrown when the verify() does an equals() comparison. The auto-generated class does not contain default values, and so ActionScreen1ToScreen2.getMyBoolean() method attempts to cast a null value into a boolean, like so:
public boolean getMyBoolean() {
return (boolean) arguments.get("myBoolean");
}
Seems like a testability issue. If there's something I'm missing please let me know.
Related Issues (but not the same):
* SafeArg Builder classes doesn't contain the default values (