https://github.com/yingding/autocentering
this repo demonstrates the bug of wear compose autoCentering
https://github.com/yingding/autocentering
Last synced: 3 months ago
JSON representation
this repo demonstrates the bug of wear compose autoCentering
- Host: GitHub
- URL: https://github.com/yingding/autocentering
- Owner: yingding
- License: apache-2.0
- Created: 2022-08-05T16:10:25.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-05T17:06:07.000Z (almost 4 years ago)
- Last Synced: 2025-02-23T23:43:39.122Z (over 1 year ago)
- Language: Kotlin
- Size: 770 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# About this project
This repository demonstrates the different setting for `ScalingLazyListState` and `autoCentering` params of `ScalingLazyColumn` of the Wear
of the wear-compose lib `androidx.wear.compose:compose-material:1.0.0`
```kotlin
/* working and show full screen image directly */
val stateParams = Pair(0, 0)
val autoCenteringParams = Pair(0, 0)
/* working and show full screen image with 40 px offset directly */
val stateParams = Pair(0, 40)
val autoCenteringParams = Pair(0, 40)
/* not working and show black screen, at first, with scrolling the image appears */
val stateParams = Pair(1, 0)
val autoCenteringParams = Pair(1, 0)
/* not working, conflict of settings */
val stateParams = Pair(1, 0)
val autoCenteringParams = Pair(2, 0)
```
# Different Behaviours
With the params
```kotlin
val stateParams = Pair(0, 0)
val autoCenteringParams = Pair(0, 0)
```
The demo app works as expected, will show a full screen image and a text right at app start.
https://github.com/yingding/autoCentering/blob/main/video/showImageAtStart.mov
With the params
```kotlin
val stateParams = Pair(1, 0)
val autoCenteringParams = Pair(1, 0)
```
or
```kotlin
val stateParams = Pair(1, 0)
val autoCenteringParams = Pair(2, 0)
```
The demo app doesn't work as exprected, will show a black screen at app start.
After the manually interaction through scrolling, the full screen image is then shown.
https://github.com/yingding/autoCentering/blob/main/video/NotShowingImageAtStart.mov