Fixed
Status Update
Comments
mn...@google.com <mn...@google.com> #2
Hi. Thanks for reporting this. Fixed in alpha-04
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit e782987543a9f8ccd485e970ddc74564b24378db
Author: Vighnesh Raut <vighnesh.raut13@gmail.com>
Date: Mon Jan 02 15:27:40 2023
fix: tab row crashes when only 1 tab is added
Bug: b/264018028
Test: Added unit test
Change-Id: I6381dbac304fc1d69d3708c6655f8b595668e93f
M tv/tv-material/src/androidTest/java/androidx/tv/material/TabRowTest.kt
M tv/tv-material/src/main/java/androidx/tv/material/TabRow.kt
https://android-review.googlesource.com/2373449
Branch: androidx-main
commit e782987543a9f8ccd485e970ddc74564b24378db
Author: Vighnesh Raut <vighnesh.raut13@gmail.com>
Date: Mon Jan 02 15:27:40 2023
fix: tab row crashes when only 1 tab is added
Bug:
Test: Added unit test
Change-Id: I6381dbac304fc1d69d3708c6655f8b595668e93f
M tv/tv-material/src/androidTest/java/androidx/tv/material/TabRowTest.kt
M tv/tv-material/src/main/java/androidx/tv/material/TabRow.kt
pr...@google.com <pr...@google.com> #4
deleted
Description
Jetpack Compose component used: HorizontalPager
Android Studio Build:
Android Studio Chipmunk | 2021.2.1 Patch 1
Build #AI-212.5712.43.2112.8609683, built on May 18, 2022
Runtime version: 11.0.12+0-b1504.28-7817840 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.4
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 12
Registry: external.system.auto.import.disabled=true, ide.instant.shutdown=false
Non-Bundled Plugins: some.awesome (1.14), idea.plugin.protoeditor (212.5080.8), org.jetbrains.kotlin (212-1.7.10-release-333-AS5457.46), zielu.gittoolbox (212.9.7)
Kotlin version: 1.6.10
When swiping to the right (talkback swipe), the positions in the middle are not well aligned. This doesn't happens when talkback is disabled. The video 1 shows the swipe with talkback disabled. The video 2 shows the swipe with talkback enabled.
Steps to Reproduce or Code Sample to Reproduce:
1. Enable talkback
2. Focus on HorizontalPager (position 0)
3. Swipe to the right (talkback swipe) in order to go to the position 1
4. The position 1 is not well aligned
Code:
val items = listOf("1111", "2222", "3333", "4444", "5555")
HorizontalPager(
count = items.size,
state = rememberPagerState(),
contentPadding = PaddingValues(horizontal = 24.dp),
itemSpacing = 8.dp,
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight(),
verticalAlignment = Alignment.Top
) { page ->
Box(
modifier = Modifier
.background(color = Color.Black)
.wrapContentSize()
.padding(20.dp),
contentAlignment = Alignment.Center
) {
Text(text = items[page], modifier = Modifier.background(color = Color.White))
}
}