Fixed
Status Update
Comments
je...@google.com <je...@google.com> #2
Hi. Thanks for reporting this. Fixed in alpha-04
sh...@google.com <sh...@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
je...@google.com <je...@google.com>
ap...@google.com <ap...@google.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.tv:tv-material:1.0.0-alpha04
je...@google.com <je...@google.com> #6
Reopened because the issue also exists in LinearSnapHelper
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 1192e296b529ca8e7ed3e282ad52c7677a9bb827
Author: Jelle Fresen <jellefresen@google.com>
Date: Thu Aug 22 11:53:02 2019
Always snap to center between padding
Even when clipToPadding is false, the center of RecyclerView is still
the middle of the rectangle described on the inside of the padding, not
the middle of the rectangle described on the outside of the padding.
Bug: 139452422
Test: ./gradlew recyclerview:recyclerview:cC \
-Pandroid.testInstrumentationRunnerArguments.class=\
androidx.recyclerview.widget.StaggeredGridLayoutManagerSnappingTest
and GridLayoutManagerSnappingTest
and LinearLayoutManagerSnappingTest
Change-Id: Ib4da578d4058b4d0c1ed5425b563de6ee292bd2c
M recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/LinearSnapHelper.java
https://android-review.googlesource.com/1106715
https://goto.google.com/android-sha1/1192e296b529ca8e7ed3e282ad52c7677a9bb827
Branch: androidx-master-dev
commit 1192e296b529ca8e7ed3e282ad52c7677a9bb827
Author: Jelle Fresen <jellefresen@google.com>
Date: Thu Aug 22 11:53:02 2019
Always snap to center between padding
Even when clipToPadding is false, the center of RecyclerView is still
the middle of the rectangle described on the inside of the padding, not
the middle of the rectangle described on the outside of the padding.
Bug: 139452422
Test: ./gradlew recyclerview:recyclerview:cC \
-Pandroid.testInstrumentationRunnerArguments.class=\
androidx.recyclerview.widget.StaggeredGridLayoutManagerSnappingTest
and GridLayoutManagerSnappingTest
and LinearLayoutManagerSnappingTest
Change-Id: Ib4da578d4058b4d0c1ed5425b563de6ee292bd2c
M recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/LinearSnapHelper.java
Description
The reasoning is that the padding defines the content rectangle, and whether or not children's pixels are clipped to that rectangle or not doesn't change the semantics of that rectangle.
Consider for example a horizontal ViewPager2 that has unequal padding on the left and the right. When it is in idle state, a page exactly fills the rectangle described by the inner edge of the padding, so the page looks to be off-center by design. When snapping kicks in (e.g., because of a swipe), the page to which it is snapping should end up in that same "off-center" position, exactly matching the rectangle described by the inner edge of the padding, regardless of the value of clipToPadding.