Skip to content

Setting Animation

Kofi Gyan edited this page Sep 13, 2016 · 4 revisions

You can set state line to animate from previous state to current state. Additionally you can set the animation duration and animation start delay time.

Animate to Current State :

XML

  • spb_animateToCurrentProgressState

Example :

<com.kofigyan.stateprogressbar.StateProgressBar
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     app:spb_animateToCurrentProgressState="true"/> 

Related Method

  • enableAnimationToCurrentState(boolean)

Example :

........................... 
...........................

StateProgressBar stateProgressBar = (StateProgressBar) findViewById(R.id.your_state_progress_bar_id);
stateProgressBar.enableAnimationToCurrentState(true);

Animation Duration Time :

XML

  • spb_animationDuration

Example :

<com.kofigyan.stateprogressbar.StateProgressBar
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     app:spb_animationDuration="2000"/> 

Related Method

  • setAnimationDuration(int)

Example :

........................... 
...........................

StateProgressBar stateProgressBar = (StateProgressBar) findViewById(R.id.your_state_progress_bar_id);
stateProgressBar.setAnimationDuration(3000);

Animation Start Delay Time :

XML

  • spb_animationStartDelay

Example :

<com.kofigyan.stateprogressbar.StateProgressBar
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     app:spb_animationStartDelay="2000"/> 

Related Method

  • setAnimationStartDelay(int)

Example :

........................... 
...........................

StateProgressBar stateProgressBar = (StateProgressBar) findViewById(R.id.your_state_progress_bar_id);
stateProgressBar.setAnimationStartDelay(3000);