Skip to content

Setting State Number

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

You can set the current state number and the maximum state number for every stateprogressbar. The minimum state number you can set is one and the maximum state number you can set is four. Current state number cannot be greater than maximum state number. ie.
1 ≤ current state number ≤ 4 ,
1 ≤ maximum state number ≤ 4 and
current state number ≤ maximum state number

NB// Throws IllegalStateException if current state number > maximum state number

Maximum State Number :

XML

  • spb_maxStateNumber

Example :

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

Related Method

  • setMaxStateNumber(StateNumber)

Example :

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

StateProgressBar stateProgressBar = (StateProgressBar) findViewById(R.id.your_state_progress_bar_id);
stateProgressBar.setMaxStateNumber(StateNumber.FOUR);

Current State Number :

XML

  • spb_currentStateNumber

Example :

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

Related Method

  • setCurrentStateNumber(StateNumber)

Example :

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

StateProgressBar stateProgressBar = (StateProgressBar) findViewById(R.id.your_state_progress_bar_id);
stateProgressBar.setCurrentStateNumber(StateNumber.ONE);