Fixed
Status Update
Comments
ae...@google.com <ae...@google.com>
ke...@google.com <ke...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 2099e20d0af61318ec59b5c6391498304979e024
Author: Clara Fok <clarafok@google.com>
Date: Wed May 03 14:38:14 2023
Migrate paging-testing to PagingSourceFactory
Migrate existing usages of lambda type () -> PagingSource<Key, Value> to concrete PagingSourceFactory<Key, Value> type
Test: ./gradlew paging:paging-testing:cC
Bug: 280655188
Relnote: "Migrated paging-testing's use of lambda type () -> PagingSource<Key, Value> to type PagingSourceFactory<Key, Value>."
Change-Id: I4a95067989fabf8258a3392007dbf8abd35d8efa
M paging/paging-testing/api/current.txt
M paging/paging-testing/api/public_plus_experimental_current.txt
M paging/paging-testing/api/restricted_current.txt
M paging/paging-testing/src/main/java/androidx/paging/testing/StaticListPagingSourceFactory.kt
M paging/paging-testing/src/test/kotlin/androidx/paging/testing/PagerFlowSnapshotTest.kt
M paging/paging-testing/src/test/kotlin/androidx/paging/testing/StaticListPagingSourceFactoryTest.kt
https://android-review.googlesource.com/2579311
Branch: androidx-main
commit 2099e20d0af61318ec59b5c6391498304979e024
Author: Clara Fok <clarafok@google.com>
Date: Wed May 03 14:38:14 2023
Migrate paging-testing to PagingSourceFactory
Migrate existing usages of lambda type () -> PagingSource<Key, Value> to concrete PagingSourceFactory<Key, Value> type
Test: ./gradlew paging:paging-testing:cC
Bug: 280655188
Relnote: "Migrated paging-testing's use of lambda type () -> PagingSource<Key, Value> to type PagingSourceFactory<Key, Value>."
Change-Id: I4a95067989fabf8258a3392007dbf8abd35d8efa
M paging/paging-testing/api/current.txt
M paging/paging-testing/api/public_plus_experimental_current.txt
M paging/paging-testing/api/restricted_current.txt
M paging/paging-testing/src/main/java/androidx/paging/testing/StaticListPagingSourceFactory.kt
M paging/paging-testing/src/test/kotlin/androidx/paging/testing/PagerFlowSnapshotTest.kt
M paging/paging-testing/src/test/kotlin/androidx/paging/testing/StaticListPagingSourceFactoryTest.kt
na...@google.com <na...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit f06753ed29d67623b4061cb222717948d0a37ef7
Author: Clara Fok <clarafok@google.com>
Date: Wed May 03 13:16:53 2023
Add PagingSourceFactory interface
This functional interface allows creating a PagingSourceFactory by passing in a lambda that returns a PagingSource, or by creating a class that extends this interface. The factory can be passed into Pager as the pagingSourceFactory.
Test: ./gradlew paging:paging-common:test
Bug: 280655188
Relnote: "Added a new PagingSourceFactory functional interface. Override the invoke() method with an implementation that returns a new instance of PagingSource. This factory can be used to instantiate a Pager."
Change-Id: I3316590a0d667566edeb40d4e99e005cd6cee3ac
M paging/paging-common/api/current.txt
M paging/paging-common/api/public_plus_experimental_current.txt
M paging/paging-common/api/restricted_current.txt
M paging/paging-common/src/main/kotlin/androidx/paging/InvalidatingPagingSourceFactory.kt
A paging/paging-common/src/main/kotlin/androidx/paging/PagingSourceFactory.kt
https://android-review.googlesource.com/2579310
Branch: androidx-main
commit f06753ed29d67623b4061cb222717948d0a37ef7
Author: Clara Fok <clarafok@google.com>
Date: Wed May 03 13:16:53 2023
Add PagingSourceFactory interface
This functional interface allows creating a PagingSourceFactory by passing in a lambda that returns a PagingSource, or by creating a class that extends this interface. The factory can be passed into Pager as the pagingSourceFactory.
Test: ./gradlew paging:paging-common:test
Bug: 280655188
Relnote: "Added a new PagingSourceFactory functional interface. Override the invoke() method with an implementation that returns a new instance of PagingSource. This factory can be used to instantiate a Pager."
Change-Id: I3316590a0d667566edeb40d4e99e005cd6cee3ac
M paging/paging-common/api/current.txt
M paging/paging-common/api/public_plus_experimental_current.txt
M paging/paging-common/api/restricted_current.txt
M paging/paging-common/src/main/kotlin/androidx/paging/InvalidatingPagingSourceFactory.kt
A paging/paging-common/src/main/kotlin/androidx/paging/PagingSourceFactory.kt
lo...@gmail.com <lo...@gmail.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 967c97f18d7f2a717222b09be6227f0f7dabb323
Author: Clara Fok <clarafok@google.com>
Date: Thu May 04 13:06:24 2023
Update documentation for asPagingSourceFactory API
Kdocs updated to reflec the API's migration from returning a lambda to returning a Class.
Test: n/a
Bug: 280655188
Change-Id: Ib3f9b5c9215ba9e5ee38d6b192e9858bbe080346
M paging/paging-testing/src/main/java/androidx/paging/testing/StaticListPagingSourceFactory.kt
https://android-review.googlesource.com/2580094
Branch: androidx-main
commit 967c97f18d7f2a717222b09be6227f0f7dabb323
Author: Clara Fok <clarafok@google.com>
Date: Thu May 04 13:06:24 2023
Update documentation for asPagingSourceFactory API
Kdocs updated to reflec the API's migration from returning a lambda to returning a Class.
Test: n/a
Bug: 280655188
Change-Id: Ib3f9b5c9215ba9e5ee38d6b192e9858bbe080346
M paging/paging-testing/src/main/java/androidx/paging/testing/StaticListPagingSourceFactory.kt
ty...@gmail.com <ty...@gmail.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit 59e0f757ba85b81b800e6fb0d60dd25dd88bee54
Author: Clara Fok <clarafok@google.com>
Date: Thu May 04 12:52:34 2023
Expand asPagingSourceFactory API to singe list
In addition to Flow<List<Value>>.asPagingSourceFactory API, we added a List<Value>.asPagingSourceFactory. All PagingSoruces produced by this new API will load from the exact same static list of data. It supports multi-generational operations such as refresh, but it does not support any updates to the source data. Because it operates on a static list, collection is not required which removes the requirement for a coroutineScope.
Test: ./gradlew paging:paging-testing:test
Bug: 280655188
Relnote: "Added new API List<Value>.asPagingSourceFactory to get a factory that creates PagingSource instances that loads from the immutable list of data."
Change-Id: Id34d1361119413d0c19a054a2e23dd26241faa6f
M paging/paging-testing/api/current.txt
M paging/paging-testing/api/public_plus_experimental_current.txt
M paging/paging-testing/api/restricted_current.txt
M paging/paging-testing/src/main/java/androidx/paging/testing/StaticListPagingSourceFactory.kt
M paging/paging-testing/src/test/kotlin/androidx/paging/testing/PagerFlowSnapshotTest.kt
M paging/paging-testing/src/test/kotlin/androidx/paging/testing/StaticListPagingSourceFactoryTest.kt
https://android-review.googlesource.com/2580093
Branch: androidx-main
commit 59e0f757ba85b81b800e6fb0d60dd25dd88bee54
Author: Clara Fok <clarafok@google.com>
Date: Thu May 04 12:52:34 2023
Expand asPagingSourceFactory API to singe list
In addition to Flow<List<Value>>.asPagingSourceFactory API, we added a List<Value>.asPagingSourceFactory. All PagingSoruces produced by this new API will load from the exact same static list of data. It supports multi-generational operations such as refresh, but it does not support any updates to the source data. Because it operates on a static list, collection is not required which removes the requirement for a coroutineScope.
Test: ./gradlew paging:paging-testing:test
Bug: 280655188
Relnote: "Added new API List<Value>.asPagingSourceFactory to get a factory that creates PagingSource instances that loads from the immutable list of data."
Change-Id: Id34d1361119413d0c19a054a2e23dd26241faa6f
M paging/paging-testing/api/current.txt
M paging/paging-testing/api/public_plus_experimental_current.txt
M paging/paging-testing/api/restricted_current.txt
M paging/paging-testing/src/main/java/androidx/paging/testing/StaticListPagingSourceFactory.kt
M paging/paging-testing/src/test/kotlin/androidx/paging/testing/PagerFlowSnapshotTest.kt
M paging/paging-testing/src/test/kotlin/androidx/paging/testing/StaticListPagingSourceFactoryTest.kt
lo...@gmail.com <lo...@gmail.com> #6
Fixed internally and will be available in paging 3.2.0-alpha06
.
Description
Jetpack Compose version: 2024.01.00
Jetpack Compose component(s) used:
RangeSlider
Android Studio Build: Build #AI-231.9392.1.2311.11330709, built on January 19, 2024
Kotlin version: 1.9.22
Material 3 version : 1.2.0-beta02
Steps to Reproduce or Code Sample to Reproduce:
RangeSlider
SliderRange
is failing therequire(isUnspecified || start <= endInclusive )
check on line 2120 due to rounding error as can be seen in the first line of the stack trace, wherestart
is only 0.00005 of a pixel greater than theendInclusive
Suggestion of a solution to fix this error
It is a known issue that floating point calculation is inherently imprecise in a sense that the resulting value is correct up to a specific decimal position. I suspect that the same is happening here when the start point and end point coordinates are being calculated. The
start
point may have gotten593.6667500000000000000000...
rounded to593.66675
andendInclusive
may have gotten593.66674999999999999999....
rounded to593.6667
.When doing floating point calculations for UI it is imperative to have a consistent cut off strategy for how many decimal places should be considered system-wise for rendering. In my experience 2 decimal places are ample for pixel-related arithmetics; anything beyond makes no visual difference.
So trim pixel values to only carry 2 decimal positions and discard everything from 3rd decimal position onwards. (Do NOT round the values!)
Following the strategy above system-wide for UI pixel-related arithmetics, will make sure that elusive errors like this do not happen.
Stack trace: