Fixed
Status Update
Comments
ca...@google.com <ca...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 301a88b0a7c305dc62770ee84a13a51a6572e385
Author: Cătălin Tudor <catalintudor@google.com>
Date: Thu Feb 28 13:24:42 2019
Fix spinner widget scroll
The bug caused a weird scrolling problem in the spinner widget when
used in dropdown mode. The problem is older, possibly introduced in
ag/680812, but as we still used the platform spinner for new API
versions, this was hidden. It came to light after aosp/789994, this
backported the dialog mode and uses the androidx version always.
The steps :
- try to scroll
- OnTouch from ListPopupWindow is called
- onTouch uses a ResizePopupRunnable which calls show() from
DropdownPopup (because it's overridden)
- show(int, int) from DropdownPopup is called which recreates
the popup
This works correctly for the spinner in dialog mode because the
show() method from ListPopupWindow is not overriden by the spinner
The fix is to delete the show() override in DropdownPopup which
makes the appcompat implementation of spinner work like in
platform.
Bug: 124274573
Test: ./gradlew appcompat:connectedCheck --info --daemon -Pandroid.testInstrumentationRunnerArguments.class=androidx.appcompat.widget.AppCompatSpinnerTest
Change-Id: I42aff5a5c8cb1417376dada2e3555d50d5e87164
M appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatSpinnerTest.java
M appcompat/src/androidTest/res/layout/appcompat_spinner_activity.xml
M appcompat/src/androidTest/res/values/strings.xml
M appcompat/src/main/java/androidx/appcompat/widget/AppCompatSpinner.java
https://android-review.googlesource.com/915394
https://goto.google.com/android-sha1/301a88b0a7c305dc62770ee84a13a51a6572e385
Branch: androidx-master-dev
commit 301a88b0a7c305dc62770ee84a13a51a6572e385
Author: Cătălin Tudor <catalintudor@google.com>
Date: Thu Feb 28 13:24:42 2019
Fix spinner widget scroll
The bug caused a weird scrolling problem in the spinner widget when
used in dropdown mode. The problem is older, possibly introduced in
ag/680812, but as we still used the platform spinner for new API
versions, this was hidden. It came to light after aosp/789994, this
backported the dialog mode and uses the androidx version always.
The steps :
- try to scroll
- OnTouch from ListPopupWindow is called
- onTouch uses a ResizePopupRunnable which calls show() from
DropdownPopup (because it's overridden)
- show(int, int) from DropdownPopup is called which recreates
the popup
This works correctly for the spinner in dialog mode because the
show() method from ListPopupWindow is not overriden by the spinner
The fix is to delete the show() override in DropdownPopup which
makes the appcompat implementation of spinner work like in
platform.
Bug: 124274573
Test: ./gradlew appcompat:connectedCheck --info --daemon -Pandroid.testInstrumentationRunnerArguments.class=androidx.appcompat.widget.AppCompatSpinnerTest
Change-Id: I42aff5a5c8cb1417376dada2e3555d50d5e87164
M appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatSpinnerTest.java
M appcompat/src/androidTest/res/layout/appcompat_spinner_activity.xml
M appcompat/src/androidTest/res/values/strings.xml
M appcompat/src/main/java/androidx/appcompat/widget/AppCompatSpinner.java
ca...@google.com <ca...@google.com>
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-g3-release
commit d2fc5a1b29f9e65ac2ec74187c0cb1a47887abba
Author: Cătălin Tudor <catalintudor@google.com>
Date: Thu Feb 28 13:24:42 2019
Fix spinner widget scroll
The bug caused a weird scrolling problem in the spinner widget when
used in dropdown mode. The problem is older, possibly introduced in
ag/680812, but as we still used the platform spinner for new API
versions, this was hidden. It came to light after aosp/789994, this
backported the dialog mode and uses the androidx version always.
The steps :
- try to scroll
- OnTouch from ListPopupWindow is called
- onTouch uses a ResizePopupRunnable which calls show() from
DropdownPopup (because it's overridden)
- show(int, int) from DropdownPopup is called which recreates
the popup
This works correctly for the spinner in dialog mode because the
show() method from ListPopupWindow is not overriden by the spinner
The fix is to delete the show() override in DropdownPopup which
makes the appcompat implementation of spinner work like in
platform.
Bug: 124274573
Test: ./gradlew appcompat:connectedCheck --info --daemon -Pandroid.testInstrumentationRunnerArguments.class=androidx.appcompat.widget.AppCompatSpinnerTest
Change-Id: I42aff5a5c8cb1417376dada2e3555d50d5e87164
M appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatSpinnerTest.java
M appcompat/src/androidTest/res/layout/appcompat_spinner_activity.xml
M appcompat/src/androidTest/res/values/strings.xml
M appcompat/src/main/java/androidx/appcompat/widget/AppCompatSpinner.java
https://android-review.googlesource.com/940067
https://goto.google.com/android-sha1/d2fc5a1b29f9e65ac2ec74187c0cb1a47887abba
Branch: androidx-g3-release
commit d2fc5a1b29f9e65ac2ec74187c0cb1a47887abba
Author: Cătălin Tudor <catalintudor@google.com>
Date: Thu Feb 28 13:24:42 2019
Fix spinner widget scroll
The bug caused a weird scrolling problem in the spinner widget when
used in dropdown mode. The problem is older, possibly introduced in
ag/680812, but as we still used the platform spinner for new API
versions, this was hidden. It came to light after aosp/789994, this
backported the dialog mode and uses the androidx version always.
The steps :
- try to scroll
- OnTouch from ListPopupWindow is called
- onTouch uses a ResizePopupRunnable which calls show() from
DropdownPopup (because it's overridden)
- show(int, int) from DropdownPopup is called which recreates
the popup
This works correctly for the spinner in dialog mode because the
show() method from ListPopupWindow is not overriden by the spinner
The fix is to delete the show() override in DropdownPopup which
makes the appcompat implementation of spinner work like in
platform.
Bug: 124274573
Test: ./gradlew appcompat:connectedCheck --info --daemon -Pandroid.testInstrumentationRunnerArguments.class=androidx.appcompat.widget.AppCompatSpinnerTest
Change-Id: I42aff5a5c8cb1417376dada2e3555d50d5e87164
M appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatSpinnerTest.java
M appcompat/src/androidTest/res/layout/appcompat_spinner_activity.xml
M appcompat/src/androidTest/res/values/strings.xml
M appcompat/src/main/java/androidx/appcompat/widget/AppCompatSpinner.java
Description
Version used: 1.1.0-alpha02
Theme used: Theme.AppCompat.Light.DarkActionBar
Devices/Android versions reproduced on: Samsung Galaxy Note8 (Android 8.0.0)
When scrolling through the items of a spinner (slowly), it keeps automatically jumping back to the previously selected item. This makes scrolling (almost) impossible. See attached screen recording and sample project.
This is a new issue since appcompat 1.1.0-alpha02. The previous alpha01 has no issues. It looks like this is the commit which broke the spinner:
Before this commit, because mPopupContext would be null, the framework implementation of SpinnerPopup was used which does not have this issue. This commit changed some stuff, so now the AppCompat implementation of SpinnerPopup is always used. However, it looks like this has some scrolling bugs on Android Oreo. So it could be that this issue was already there in the AppCompat implementation of SpinnerPopup previously.
- Relevant code to trigger the issue: See attached sample project.
- A screenrecord or screenshots showing the issue (if UI related): See attached screenrecord.