Skip to content

Setting Colors

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

Set colors for state background , state foreground , state number background , state number foreground , state decription color , current state description color.

State Background Color :

XML

  • spb_stateBackgroundColor

Example :

 <com.kofigyan.stateprogressbar.StateProgressBar                                                                    
     android:layout_width="wrap_content"                                                                                 
     android:layout_height="wrap_content"                                                                                
     app:spb_stateBackgroundColor="#BDBDBD"/>

Related Method

  • setBackgroundColor(int)

Example :

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

StateProgressBar stateProgressBar = (StateProgressBar) findViewById(R.id.your_state_progress_bar_id);
stateProgressBar.setBackgroundColor(ContextCompat.getColor(this, android.R.color.darker_gray));

State Foreground Color :

XML

  • spb_stateForegroundColor

    Example :

  <com.kofigyan.stateprogressbar.StateProgressBar
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:spb_stateForegroundColor="#009688"/>  

Related Method

  • setForegroundColor(int)

Example :

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

  StateProgressBar stateProgressBar = (StateProgressBar) findViewById(R.id.your_state_progress_bar_id);
  stateProgressBar.setForegroundColor(ContextCompat.getColor(this, R.color.demo_state_foreground_color));

State Number Background Color :

XML

  • spb_stateNumberBackgroundColor

    Example :

    <com.kofigyan.stateprogressbar.StateProgressBar
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      app:spb_stateNumberBackgroundColor="#808080"/>  
    

Related Method

  • setStateNumberBackgroundColor(int)

Example :

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

 StateProgressBar stateProgressBar = (StateProgressBar) findViewById(R.id.your_state_progress_bar_id);
 stateProgressBar.setStateNumberBackgroundColor(ContextCompat.getColor(this, android.R.color.background_dark));

State Number Foreground Color :

XML

  • spb_stateNumberForegroundColor

    Example :

   <com.kofigyan.stateprogressbar.StateProgressBar
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     app:spb_stateNumberForegroundColor="#eeeeee"/>  

Related Method

  • setStateNumberForegroundColor(int)

Example :

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

 StateProgressBar stateProgressBar = (StateProgressBar) findViewById(R.id.your_state_progress_bar_id);
 stateProgressBar.setStateNumberForegroundColor(ContextCompat.getColor(this, android.R.color.white)); 

State Description Color :

XML

  • spb_stateDescriptionColor

    Example :

   <com.kofigyan.stateprogressbar.StateProgressBar
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     app:spb_stateDescriptionColor="#808080"/>  

Related Method

  • setStateDescriptionColor(int)

Example :

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

 StateProgressBar stateProgressBar = (StateProgressBar) findViewById(R.id.your_state_progress_bar_id);
 stateProgressBar.setStateDescriptionColor(ContextCompat.getColor(this, R.color.description_background_color));

Current State Description Color :

XML

  • spb_currentStateDescriptionColor

    Example :

  <com.kofigyan.stateprogressbar.StateProgressBar
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:spb_currentStateDescriptionColor="#009688"/>  

Related Method

  • setCurrentStateDescriptionColor(int)

Example :

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

 StateProgressBar stateProgressBar = (StateProgressBar) findViewById(R.id.your_state_progress_bar_id);
 stateProgressBar.setCurrentStateDescriptionColor(ContextCompat.getColor(this, R.color.description_foreground_color));