Fixed
Status Update
Comments
jp...@google.com <jp...@google.com>
jo...@google.com <jo...@google.com> #2
Hi, thanks for reporting, we'll have a look. If you could provide us with a minimum sample app to reproduce the issue, that'd be very helpful.
jo...@google.com <jo...@google.com> #3
I confirm I managed to reproduce with API 23 emulator and the following patch on the sample app. Will investigate further.
Patch below.
***
Index: app/src/main/java/androidx/viewpager2/integration/testapp/cards/CardView.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- app/src/main/java/androidx/viewpager2/integration/testapp/cards/CardView.kt (revision 38ea42c142729c777dcf8f3e4bd5100aeca981ec)
+++ app/src/main/java/androidx/viewpager2/integration/testapp/cards/CardView.kt (date 1565281963000)
@@ -16,9 +16,11 @@
package androidx.viewpager2.integration.testapp.cards
+import android.text.SpannableStringBuilder
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
+import android.widget.EditText
import android.widget.TextView
import androidx.annotation.ColorRes
@@ -28,7 +30,7 @@
/** Inflates and populates a [View] representing a [Card] */
class CardView(layoutInflater: LayoutInflater, container: ViewGroup?) {
val view: View = layoutInflater.inflate(R.layout.item_card_layout, container, false)
- private val textSuite: TextView
+ private val textSuite: EditText
private val textCorner1: TextView
private val textCorner2: TextView
@@ -42,7 +44,7 @@
* Updates the view to represent the passed in card
*/
fun bind(card: Card) {
- textSuite.text = card.suit
+ textSuite.text = SpannableStringBuilder(card.suit)
view.setBackgroundResource(getColorRes(card))
val cornerLabel = card.cornerLabel
Index: app/src/main/res/layout/item_card_layout.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- app/src/main/res/layout/item_card_layout.xml (revision 38ea42c142729c777dcf8f3e4bd5100aeca981ec)
+++ app/src/main/res/layout/item_card_layout.xml (date 1565281963000)
@@ -31,13 +31,15 @@
android:textAppearance="@android:style/TextAppearance.Large"
tools:text="A"/>
- <TextView
+ <EditText
android:id="@+id/label_center"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
+ android:inputType="text"
+ android:maxLines="1"
android:textAppearance="@android:style/TextAppearance.Large"
- tools:text="♠"/>
+ tools:text="♠" />
<TextView
android:id="@+id/label_bottom"
Patch below.
***
Index: app/src/main/java/androidx/viewpager2/integration/testapp/cards/CardView.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- app/src/main/java/androidx/viewpager2/integration/testapp/cards/CardView.kt (revision 38ea42c142729c777dcf8f3e4bd5100aeca981ec)
+++ app/src/main/java/androidx/viewpager2/integration/testapp/cards/CardView.kt (date 1565281963000)
@@ -16,9 +16,11 @@
package androidx.viewpager2.integration.testapp.cards
+import android.text.SpannableStringBuilder
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
+import android.widget.EditText
import android.widget.TextView
import androidx.annotation.ColorRes
@@ -28,7 +30,7 @@
/** Inflates and populates a [View] representing a [Card] */
class CardView(layoutInflater: LayoutInflater, container: ViewGroup?) {
val view: View = layoutInflater.inflate(R.layout.item_card_layout, container, false)
- private val textSuite: TextView
+ private val textSuite: EditText
private val textCorner1: TextView
private val textCorner2: TextView
@@ -42,7 +44,7 @@
* Updates the view to represent the passed in card
*/
fun bind(card: Card) {
- textSuite.text = card.suit
+ textSuite.text = SpannableStringBuilder(card.suit)
view.setBackgroundResource(getColorRes(card))
val cornerLabel = card.cornerLabel
Index: app/src/main/res/layout/item_card_layout.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- app/src/main/res/layout/item_card_layout.xml (revision 38ea42c142729c777dcf8f3e4bd5100aeca981ec)
+++ app/src/main/res/layout/item_card_layout.xml (date 1565281963000)
@@ -31,13 +31,15 @@
android:textAppearance="@android:style/TextAppearance.Large"
tools:text="A"/>
- <TextView
+ <EditText
android:id="@+id/label_center"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
+ android:inputType="text"
+ android:maxLines="1"
android:textAppearance="@android:style/TextAppearance.Large"
- tools:text="♠"/>
+ tools:text="♠" />
<TextView
android:id="@+id/label_bottom"
jo...@google.com <jo...@google.com> #4
Corrected video
ap...@google.com <ap...@google.com> #5
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
jo...@google.com <jo...@google.com>
an...@google.com <an...@google.com> #6
an...@google.com <an...@google.com> #7
beta04 with a fix for this was released today
de...@google.com <de...@google.com> #8
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Emulator 33.1.4
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
se...@gmail.com <se...@gmail.com> #9
Android 14
Description
We do not (yet) have a way to reproduce the problem, but we can see on go/crash an high level of report with `EXC_BAD_ACCESS` issue with
`std::__1::basic_ostream<char, std::__1::char_traits<char>>::sentry::~sentry()`
The stack doesn't see much, except that this is on M1 ( qemu-arch-aarch64, using Qt6)
```
Stack Quality26%Show frame trust levels
0x00000001aba1d40c (libc++.1.dylib + 0x0001f40c) std::__1::basic_ostream<char, std::__1::char_traits<char>>::sentry::~sentry()
0x000000010103d768 (qemu-system-aarch64 + 0x001b1768)
0x000000010103d768 (qemu-system-aarch64 + 0x001b1768)
0x0000000101447224 (qemu-system-aarch64 + 0x005bb224)
0x000000010143c138 (qemu-system-aarch64 + 0x005b0138)
0x00000001069ccc48 (libQt6CoreAndroidEmu.6.2.1.dylib + 0x00010c48)
0x00000001069ccb10 (libQt6CoreAndroidEmu.6.2.1.dylib + 0x00010b10)
0x00000001069d319c (libQt6CoreAndroidEmu.6.2.1.dylib + 0x0001719c)
0x0000000107c2ea90 (libQt6GuiAndroidEmu.6.2.1.dylib + 0x0008aa90)
0x0000000107c75c8c (libQt6GuiAndroidEmu.6.2.1.dylib + 0x000d1c8c)
0x00000001066c8a4c (libqcocoaAndroidEmu.dylib + 0x00014a4c)
0x00000001abb9da04 (CoreFoundation + 0x00081a04) __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
0x00000001abb9d998 (CoreFoundation + 0x00081998) __CFRunLoopDoSource0
0x00000001abb9d708 (CoreFoundation + 0x00081708) __CFRunLoopDoSources0
0x00000001abb9c30c (CoreFoundation + 0x0008030c) __CFRunLoopRun
0x00000001abb9b874 (CoreFoundation + 0x0007f874) CFRunLoopRunSpecific
0x00000001b527bf9c (HIToolbox + 0x00031f9c) RunCurrentEventLoopInMode
0x00000001b527bc2c (HIToolbox + 0x00031c2c) ReceiveNextEventCommon
0x00000001b527bb28 (HIToolbox + 0x00031b28) _BlockUntilNextEventMatchingListInModeWithFilter
0x00000001aee21848 (AppKit + 0x00039848) _DPSNextEvent
0x00000001aee209d8 (AppKit + 0x000389d8) -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
0x00000001aee14e08 (AppKit + 0x0002ce08) -[NSApplication run]
0x00000001066c792c (libqcocoaAndroidEmu.dylib + 0x0001392c)
0x0000000106a547f0 (libQt6CoreAndroidEmu.6.2.1.dylib + 0x000987f0)
0x0000000106a4bb44 (libQt6CoreAndroidEmu.6.2.1.dylib + 0x0008fb44)
0x000000010143a3f8 (qemu-system-aarch64 + 0x005ae3f8)
0x000000010103caf0 (qemu-system-aarch64 + 0x001b0af0)
0x00000001ab793e4c (dyld + 0x00005e4c) start
```
This is seen with stable 32.1.12 , after 1 week we have 2035 sample reports from 745 unique users