Fixed
Status Update
Comments
ku...@google.com <ku...@google.com>
ku...@google.com <ku...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 47ac9fee0e3d43b4da33f53b8a2ff590f0d46079
Author: Jakub Gielzak <jgielzak@google.com>
Date: Tue Aug 20 13:57:06 2019
Addressed issues with EditText causing scroll
EditText methods: bringPointIntoView, and handleFocusGainInternal
trigger requestChildRectangleOnScreen in ViewPager2's internal
RecyclerView.
This can cause:
- unwanted scrolling -- e.g. when typing on some API versions
- a jump to page 0 -- EditText sometimes reports over -1M px mScrollX
This fix bypasses requestChildRectangleOnScreen calculations taking
advantage of the fact that PagerSnapHelper constraints valid scroll
values to a snapped position ones, and as a result, the problem is
reduced to choosing the correct currentItem.
Bug: 138044582
Bug: 139432498
Test: ./gradlew viewpager2:connectedCheck
Change-Id: Ia4d3e4e6734183e64f261c7cc76d669deae78da5
A viewpager2/src/androidTest/java/androidx/viewpager2/widget/EditTextFocusTest.kt
M viewpager2/src/main/java/androidx/viewpager2/widget/ViewPager2.java
https://android-review.googlesource.com/1107013
https://goto.google.com/android-sha1/47ac9fee0e3d43b4da33f53b8a2ff590f0d46079
Branch: androidx-master-dev
commit 47ac9fee0e3d43b4da33f53b8a2ff590f0d46079
Author: Jakub Gielzak <jgielzak@google.com>
Date: Tue Aug 20 13:57:06 2019
Addressed issues with EditText causing scroll
EditText methods: bringPointIntoView, and handleFocusGainInternal
trigger requestChildRectangleOnScreen in ViewPager2's internal
RecyclerView.
This can cause:
- unwanted scrolling -- e.g. when typing on some API versions
- a jump to page 0 -- EditText sometimes reports over -1M px mScrollX
This fix bypasses requestChildRectangleOnScreen calculations taking
advantage of the fact that PagerSnapHelper constraints valid scroll
values to a snapped position ones, and as a result, the problem is
reduced to choosing the correct currentItem.
Bug: 138044582
Bug: 139432498
Test: ./gradlew viewpager2:connectedCheck
Change-Id: Ia4d3e4e6734183e64f261c7cc76d669deae78da5
A viewpager2/src/androidTest/java/androidx/viewpager2/widget/EditTextFocusTest.kt
M viewpager2/src/main/java/androidx/viewpager2/widget/ViewPager2.java
mm...@gmail.com <mm...@gmail.com> #3
ku...@google.com <ku...@google.com> #4
beta04 with a fix for this was released today
an...@google.com <an...@google.com> #5
Fixed in 1.1.0-alpha02 version of Transition lib.
Description
'com.android.support:appcompat-v7:28.0.0'
'com.android.support:design:28.0.0'
Version used: 28.0.0
Theme used: Theme.AppCompat.Light.DarkActionBar
Devices/Android versions reproduced on: Nexus 6 running API 27
If we set a Propagation (Tested only for SidePropagation) on a support transition which has a start delay, then the propagation isn't respected when animating the views out (but is when animating the views in).This is in contrast to the native implementation of this feature, where it works correctly when animating in, or out with a start delay.
- Relevant code to trigger the issue.
//support transitions
android.support.transition.SidePropagation propagation = new android.support.transition.SidePropagation();
propagation.setSide(Gravity.END);
android.support.transition.Transition propagatedTransition = new android.support.transition.AutoTransition();
//Using a start delay causes the support version to not propagate the transition when animating out
propagatedTransition.setStartDelay(150);
propagatedTransition.setPropagation(propagation);
android.support.transition.TransitionManager.beginDelayedTransition(rootViewGroup, propagatedTransition);
toggleChildren(supportLayout);
- A screenrecord or screenshots showing the issue (if UI related).
Attached is a screen record of it. I've also attached a sample project. Simply tap the green (native - working) box to trigger the transition using the native Transition API, and the red (support - broken) box to trigger the transition using the support Transition API. You may want to make the transition longer and change the propagation speed to make it more obvious (e.g. 0.1f propagation speed)