https://github.com/chinalwb/compose-roller-animator
Roller animation effect with Compose
https://github.com/chinalwb/compose-roller-animator
animator compose-animation counter roller
Last synced: about 1 year ago
JSON representation
Roller animation effect with Compose
- Host: GitHub
- URL: https://github.com/chinalwb/compose-roller-animator
- Owner: chinalwb
- License: mit
- Created: 2022-06-12T09:48:44.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-12T11:39:22.000Z (about 4 years ago)
- Last Synced: 2024-04-18T00:03:36.425Z (about 2 years ago)
- Topics: animator, compose-animation, counter, roller
- Language: Kotlin
- Homepage:
- Size: 113 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ComposeRollerAnimator
Roller animation effect with Compose
### Looks like:

### Sample code:
```
RollerNumberAnimator(
startValue = 1990,
endValue = 2022
)
```
### Decrease and reverse:

### Sample code:
```
RollerNumberAnimator(
startValue = 2022,
endValue = 1990,
decrease = true
)
```
### Simple Demo

### API and parmas:
- Simple, check it out as blow:
- Params are pretty self explanatory.
```
fun RollerNumberAnimator(
modifier: Modifier = Modifier,
startValue: Int,
endValue: Int,
animateOneByOne: Boolean = false,
ltr: Boolean = false,
decrease: Boolean = false,
duration: Int? = null,
animateToSameNumber: Boolean = false,
useFading: Boolean = true,
vPadding: Dp = 4f.dp,
textSize: TextUnit = 36.sp,
textColor: Color = Color(0xFFFEFEFE),
backgroundColor: Color = Color(0xFF0CCD8C),
onLayoutFinished: (paddingBottomDp: Dp) -> Unit = {},
onRollingFinished: (endValue: Int) -> Unit = {}
)
```
### Just another demo
https://user-images.githubusercontent.com/1758864/173230803-26a60ec9-7de5-4a40-80a0-2f5f0aa74b0d.mp4