Fixed
Status Update
Comments
je...@google.com <je...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
https://android-review.googlesource.com/1123258
https://goto.google.com/android-sha1/b90079595f33f58fece04026a97faa0d243acdb1
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
je...@google.com <je...@google.com> #3
je...@google.com <je...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically ( b/140759491 ).
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
https://android-review.googlesource.com/1288456
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically (
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.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".