Skip to content

Latest commit

 

History

History
74 lines (47 loc) · 1.46 KB

README.md

File metadata and controls

74 lines (47 loc) · 1.46 KB

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

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

Screen_Recording_20220612-191227_My.Application.mp4