Fixed
Status Update
Comments
je...@google.com <je...@google.com> #2
> The Transition Kotlin extensions target the Framework Transition class which is a bit confusing
All extensions in 'core-ktx' target either 'core' or the framework types. This is working as expected. It sounds like this is a feature request for a transition-ktx with equivalent extensions for the androidx.transition types.
> as most framework classes are being deprecated in favor of their AndroidX counterparts, Fragments for example.
"Most"? This *dramatically* overstates what is actually happening. Fragments (and loaders) were added to the framework in a time where the Android team did not have external libraries for shipping features. Transition was added 5 years later.
All extensions in 'core-ktx' target either 'core' or the framework types. This is working as expected. It sounds like this is a feature request for a transition-ktx with equivalent extensions for the androidx.transition types.
> as most framework classes are being deprecated in favor of their AndroidX counterparts, Fragments for example.
"Most"? This *dramatically* overstates what is actually happening. Fragments (and loaders) were added to the framework in a time where the Android team did not have external libraries for shipping features. Transition was added 5 years later.
je...@google.com <je...@google.com> #3
Pardon my misunderstanding, I was under the belief that where possible, new features that could be developed outside the framework, would be under Androidx. Also it's a common refrain to use the Androidx libraries over the framework libraries where possible, as those ship update independently of platform releases. I wasn't attempting to be dramatic.
If the Transition api is unlikely to change, there is no need for a transition-ktx for androidx.transition types. If developers should use Androidx transitions over framework transitions where possible however, then it would be much appreciated.
I am well aware of the limitations that existed when Fragments and Loaders were created, and when the Transition api was introduced.
If the Transition api is unlikely to change, there is no need for a transition-ktx for androidx.transition types. If developers should use Androidx transitions over framework transitions where possible however, then it would be much appreciated.
I am well aware of the limitations that existed when Fragments and Loaders were created, and when the Transition api was introduced.
je...@google.com <je...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit ae42e311ecfbac18cedc90e489d1fdde956a4557
Author: Jake Wharton <jakew@google.com>
Date: Fri Nov 22 11:13:30 2019
Introduce transition-ktx for standalone transition library
These extensions are the same as androidx.core.transition for the platform types, just adapted to the standalone library.
Bug: 138870873
Test: gw :transition:transition-ktx:build :transition:transition-ktx:connectedCheck
Change-Id: Ie80022cc60ed1f482b7593db5ef1ac1c5ea33d8d
M buildSrc/src/main/kotlin/androidx/build/PublishDocsRules.kt
M jetifier/jetifier/migration.config
M settings.gradle
A transition/transition-ktx/OWNERS
A transition/transition-ktx/api/1.4.0-alpha01.txt
A transition/transition-ktx/api/current.txt
A transition/transition-ktx/api/public_plus_experimental_1.4.0-alpha01.txt
A transition/transition-ktx/api/public_plus_experimental_current.txt
A transition/transition-ktx/api/res-1.4.0-alpha01.txt
A transition/transition-ktx/api/restricted_1.4.0-alpha01.txt
A transition/transition-ktx/api/restricted_current.txt
A transition/transition-ktx/build.gradle
A transition/transition-ktx/src/androidTest/AndroidManifest.xml
A transition/transition-ktx/src/androidTest/java/androidx/transition/TestActivity.kt
A transition/transition-ktx/src/androidTest/java/androidx/transition/TransitionTest.kt
A transition/transition-ktx/src/androidTest/res/layout/test_activity.xml
A transition/transition-ktx/src/main/AndroidManifest.xml
A transition/transition-ktx/src/main/java/androidx/transition/Transition.kt
https://android-review.googlesource.com/1172715
Branch: androidx-master-dev
commit ae42e311ecfbac18cedc90e489d1fdde956a4557
Author: Jake Wharton <jakew@google.com>
Date: Fri Nov 22 11:13:30 2019
Introduce transition-ktx for standalone transition library
These extensions are the same as androidx.core.transition for the platform types, just adapted to the standalone library.
Bug: 138870873
Test: gw :transition:transition-ktx:build :transition:transition-ktx:connectedCheck
Change-Id: Ie80022cc60ed1f482b7593db5ef1ac1c5ea33d8d
M buildSrc/src/main/kotlin/androidx/build/PublishDocsRules.kt
M jetifier/jetifier/migration.config
M settings.gradle
A transition/transition-ktx/OWNERS
A transition/transition-ktx/api/1.4.0-alpha01.txt
A transition/transition-ktx/api/current.txt
A transition/transition-ktx/api/public_plus_experimental_1.4.0-alpha01.txt
A transition/transition-ktx/api/public_plus_experimental_current.txt
A transition/transition-ktx/api/res-1.4.0-alpha01.txt
A transition/transition-ktx/api/restricted_1.4.0-alpha01.txt
A transition/transition-ktx/api/restricted_current.txt
A transition/transition-ktx/build.gradle
A transition/transition-ktx/src/androidTest/AndroidManifest.xml
A transition/transition-ktx/src/androidTest/java/androidx/transition/TestActivity.kt
A transition/transition-ktx/src/androidTest/java/androidx/transition/TransitionTest.kt
A transition/transition-ktx/src/androidTest/res/layout/test_activity.xml
A transition/transition-ktx/src/main/AndroidManifest.xml
A transition/transition-ktx/src/main/java/androidx/transition/Transition.kt
je...@google.com <je...@google.com> #5
Root cause:
After the keyboard is hidden, the focused TextView will ensure that it's cursor is visible on the screen, which leads to a call to requestChildRectangleOnScreen [1]. Since the EditText on the old page still has focus, ViewPager2 will initiate a scroll back to the old page.
Comparison with ViewPager:
Contrary to RecyclerView, ViewPager doesn't implement requestChildRectangleOnScreen() and the default implementation in ViewGroup does nothing.
Also, note that ViewPager transfers the focus to the new page during setCurrentItem [2].
Possible solutions:
1. Clear focus from old page and request focus on new page when updating mCurrentItem
2. Ignore calls to requestChildRectangleOnScreen like in ViewPager
3. Other..
I'm leaning towards solution 1.
[1]https://android.googlesource.com/platform/frameworks/support/+/bfc1455f551ff1caf2766b3755361905a791e538/viewpager2/src/main/java/androidx/viewpager2/widget/ViewPager2.java#1013
[2]https://android.googlesource.com/platform/frameworks/support/+/bfc1455f551ff1caf2766b3755361905a791e538/viewpager/src/main/java/androidx/viewpager/widget/ViewPager.java#1255
After the keyboard is hidden, the focused TextView will ensure that it's cursor is visible on the screen, which leads to a call to requestChildRectangleOnScreen [1]. Since the EditText on the old page still has focus, ViewPager2 will initiate a scroll back to the old page.
Comparison with ViewPager:
Contrary to RecyclerView, ViewPager doesn't implement requestChildRectangleOnScreen() and the default implementation in ViewGroup does nothing.
Also, note that ViewPager transfers the focus to the new page during setCurrentItem [2].
Possible solutions:
1. Clear focus from old page and request focus on new page when updating mCurrentItem
2. Ignore calls to requestChildRectangleOnScreen like in ViewPager
3. Other..
I'm leaning towards solution 1.
[1]
[2]
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-master-dev
commit d4fa4242b0d945b8d3ff188602331b5124b3ace0
Author: Jakub Gielzak <jgielzak@google.com>
Date: Thu Sep 19 15:50:24 2019
Disabled requestChildRectangleOnScreen
It was a source of issues. Disabling it is on par with what ViewPager1
does. Users should use setCurrentItem instead.
Bug: 140656866
Test: EditTextFocusTest
Change-Id: I63c5f05fbc72174d7af044b6c7c689833f56ae11
M viewpager2/src/androidTest/java/androidx/viewpager2/widget/EditTextFocusTest.kt
M viewpager2/src/main/java/androidx/viewpager2/widget/ViewPager2.java
https://android-review.googlesource.com/1125359
https://goto.google.com/android-sha1/d4fa4242b0d945b8d3ff188602331b5124b3ace0
Branch: androidx-master-dev
commit d4fa4242b0d945b8d3ff188602331b5124b3ace0
Author: Jakub Gielzak <jgielzak@google.com>
Date: Thu Sep 19 15:50:24 2019
Disabled requestChildRectangleOnScreen
It was a source of issues. Disabling it is on par with what ViewPager1
does. Users should use setCurrentItem instead.
Bug: 140656866
Test: EditTextFocusTest
Change-Id: I63c5f05fbc72174d7af044b6c7c689833f56ae11
M viewpager2/src/androidTest/java/androidx/viewpager2/widget/EditTextFocusTest.kt
M viewpager2/src/main/java/androidx/viewpager2/widget/ViewPager2.java
jg...@google.com <jg...@google.com>
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-master-dev
commit f4ef0c4ea7c143931a166169ffdf499323f60842
Author: Jelle Fresen <jellefresen@google.com>
Date: Fri Sep 20 16:44:31 2019
Fix broken AccessibilityTest
performAccessibilityAction should be called on the UI thread. For some
reason it never surfaced before, presumably because the scrolling that
it triggers was performed in onAnimation and not as a direct result of
the action. Now we clear focus, however, this action triggers a change
in the view and the test crashes.
Bug: 140656866
Test: ./gradlew recyclerview:recyclerview:cC \
-Pandroid.testInstrumentationRunnerArguments.class=\
androidx.viewpager2.widget.AccessibilityTest
Change-Id: Ia7113fac1f9152ddaea4499a56220fea09822407
M viewpager2/src/androidTest/java/androidx/viewpager2/widget/AccessibilityTest.kt
https://android-review.googlesource.com/1126614
https://goto.google.com/android-sha1/f4ef0c4ea7c143931a166169ffdf499323f60842
Branch: androidx-master-dev
commit f4ef0c4ea7c143931a166169ffdf499323f60842
Author: Jelle Fresen <jellefresen@google.com>
Date: Fri Sep 20 16:44:31 2019
Fix broken AccessibilityTest
performAccessibilityAction should be called on the UI thread. For some
reason it never surfaced before, presumably because the scrolling that
it triggers was performed in onAnimation and not as a direct result of
the action. Now we clear focus, however, this action triggers a change
in the view and the test crashes.
Bug: 140656866
Test: ./gradlew recyclerview:recyclerview:cC \
-Pandroid.testInstrumentationRunnerArguments.class=\
androidx.viewpager2.widget.AccessibilityTest
Change-Id: Ia7113fac1f9152ddaea4499a56220fea09822407
M viewpager2/src/androidTest/java/androidx/viewpager2/widget/AccessibilityTest.kt
ap...@google.com <ap...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-master-dev
commit d9000ec31ab4743ed07c8aa713d506ea57c37de2
Author: Jelle Fresen <jellefresen@google.com>
Date: Fri Sep 20 15:49:02 2019
Clear focus on page change in ViewPager2
Makes sure that a page can't keep focus when it is moving out of the
screen.
Bug: 140656866
Test: follow-up
Change-Id: I4e0fece0d4c438da76bfcb10939ba1bc880e27e7
M viewpager2/src/main/java/androidx/viewpager2/widget/ViewPager2.java
https://android-review.googlesource.com/1126610
https://goto.google.com/android-sha1/d9000ec31ab4743ed07c8aa713d506ea57c37de2
Branch: androidx-master-dev
commit d9000ec31ab4743ed07c8aa713d506ea57c37de2
Author: Jelle Fresen <jellefresen@google.com>
Date: Fri Sep 20 15:49:02 2019
Clear focus on page change in ViewPager2
Makes sure that a page can't keep focus when it is moving out of the
screen.
Bug: 140656866
Test: follow-up
Change-Id: I4e0fece0d4c438da76bfcb10939ba1bc880e27e7
M viewpager2/src/main/java/androidx/viewpager2/widget/ViewPager2.java
jg...@google.com <jg...@google.com> #9
Fixes are in place now. Will come out in the next release.
ti...@gmail.com <ti...@gmail.com> #10
Any plan when the next release is?
jg...@google.com <jg...@google.com> #11
We are aiming to release beta05 with the fix on October 9, but we are unable to make promises as it depends on other AndroidX libraries.
ti...@gmail.com <ti...@gmail.com> #12
Thanks, that's somewhat useful.
an...@wpost.com <an...@wpost.com> #13
It looks like this change has broken the ability to use DPAD_LEFT or DPAD_RIGHT navigation by setting items as focusable.
https://android-review.googlesource.com/c/platform/frameworks/support/+/1125359/
Is there a workaround? I can make a sample if needed, and perhaps a new issue. Thanks!
Is there a workaround? I can make a sample if needed, and perhaps a new issue. Thanks!
jg...@google.com <jg...@google.com> #14
Fix for the original issue is now out (released on Oct 9 with beta05). Marking as Fixed.
Regarding comment#13 (DPAD_*) -- moving to http://issuetracker.google.com/142548536
Regarding
pa...@google.com <pa...@google.com> #15
This is still happening for me (see
In our code, we have
viewpager.setFocusability(false)
but a child view is focusable. This combination causes the offending code to be called and the next item to show up briefly:
if (hasFocus()) { // if clear focus did not succeed
mRecyclerView.requestFocus(View.FOCUS_FORWARD);
}
Reading the commit history it looks like the above code was added for API < 28. Is it possible to check for both hasFocus() && API < 28
here?
ap...@google.com <ap...@google.com> #16
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 4e83b07b60706d954045f24b600338fae14abb2c
Author: Jakub Gielzak <jgielzak@google.com>
Date: Mon Sep 23 19:53:57 2019
Clear focus on page change on API < 28
Follow-up to: I4e0fece0d4c438da76bfcb10939ba1bc880e27e7
Bug: 140656866
Test: follow-up
Change-Id: I91bcd072e1812eeb20fbce6fb989557d60079bb7
M viewpager2/src/main/java/androidx/viewpager2/widget/ViewPager2.java
https://android-review.googlesource.com/1126151
Branch: androidx-master-dev
commit 4e83b07b60706d954045f24b600338fae14abb2c
Author: Jakub Gielzak <jgielzak@google.com>
Date: Mon Sep 23 19:53:57 2019
Clear focus on page change on API < 28
Follow-up to: I4e0fece0d4c438da76bfcb10939ba1bc880e27e7
Bug: 140656866
Test: follow-up
Change-Id: I91bcd072e1812eeb20fbce6fb989557d60079bb7
M viewpager2/src/main/java/androidx/viewpager2/widget/ViewPager2.java
Description
I've added the keyboard hiding to my previously used (another bug report) example
To replicate the issue, switch to second page(FORM), focus the editText, leave the keyboard open and use the tab to switch to the third page(LAST). The ViewPager jumps to LAST page for a split second and then immediately back to FORM. If the keyboard is not showing, then the page changes happens without any problem.
Using View/Handler.post for hideKeyboard invocation doesn't change the outcome, only postDelayed with long enough delay "works".