Fixed
Status Update
Comments
se...@google.com <se...@google.com> #2
Hi. Thanks for reporting this. Fixed in alpha-04
se...@google.com <se...@google.com>
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
Description
- Jetpack Compose component used: TextLayoutResult.getLineForOffset
- Android Studio Build: #AI-212.5712.43.2112.8609683
- Kotlin version: 1.6.21
- Devices/Android versions reproduced on: Pixel 2 API 28
- Keyboard (i.e. Gboard, Samsung, etc): Gboard
Documentation for getLineForOffset says
* If you ask for a position before 0, you get 0; if you ask for a position
* beyond the end of the text, you get the last line.
Implementation calls
requireIndexInRangeInclusiveEnd(offset)
and throws an Exception if the offset is out of bounds.