Fixed
Status Update
Comments
sh...@google.com <sh...@google.com> #3
Amended the behavior slightly to find the best match from the requested style.
je...@google.com <je...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 6e7a1ffacde6ead3acbff09514503e896d3c8bf3
Author: Sean McQuillan <seanmcq@google.com>
Date: Tue Mar 29 11:04:25 2022
TypefaceCompatApi29 finds best from requested style
This causes fonts closer to the desired style to be chosen on
resolution.
Test: ./gradlew :core:core:cAT
Bug: b/194553426
Relnote: "TypefaceCompat will now respect both requested and loaded
style information on API 29+. This is a behavior change when the loaded
fonts are not FontWeight.Normal or FontWeight.Bold, as the actual loaded
weight and style will be used. For more information see b/194553426 "
Change-Id: I1f90279afa68afa450bb98eb7c5237464c5f57d8
M core/core/src/androidTest/java/androidx/core/graphics/TypefaceCompatTest.java
M core/core/src/androidTest/java/androidx/core/content/res/ResourcesCompatTest.java
A core/core/src/androidTest/res/font/samplexmlfont_medium.xml
M core/core/src/main/java/androidx/core/graphics/TypefaceCompatApi29Impl.java
https://android-review.googlesource.com/2047984
Branch: androidx-main
commit 6e7a1ffacde6ead3acbff09514503e896d3c8bf3
Author: Sean McQuillan <seanmcq@google.com>
Date: Tue Mar 29 11:04:25 2022
TypefaceCompatApi29 finds best from requested style
This causes fonts closer to the desired style to be chosen on
resolution.
Test: ./gradlew :core:core:cAT
Bug:
Relnote: "TypefaceCompat will now respect both requested and loaded
style information on API 29+. This is a behavior change when the loaded
fonts are not FontWeight.Normal or FontWeight.Bold, as the actual loaded
weight and style will be used. For more information see
Change-Id: I1f90279afa68afa450bb98eb7c5237464c5f57d8
M core/core/src/androidTest/java/androidx/core/graphics/TypefaceCompatTest.java
M core/core/src/androidTest/java/androidx/core/content/res/ResourcesCompatTest.java
A core/core/src/androidTest/res/font/samplexmlfont_medium.xml
M core/core/src/main/java/androidx/core/graphics/TypefaceCompatApi29Impl.java
je...@google.com <je...@google.com>
je...@google.com <je...@google.com> #6
Since it's not listed here, repeating:
This was solved by github contribution
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.