@ Override public void applyDesign ( Design design , int themeColor ) { if ( mProgressStyle == HORIZONTAL ) { LayerDrawable drawable = ( LayerDrawable ) mLayout . getResources ( ) . getDrawable ( R . drawable . progress_material_horizontal ) ; Drawable bg = drawable . getDrawable ( 0 ) ; int color = design . isLight ( ) ? R . color . grey_700 : R . color . grey_500 ; bg . setColorFilter ( mLayout . getResources ( ) . getColor ( color ) , PorterDuff . Mode . SRC_ATOP ) ; Drawable secProg = drawable . getDrawable ( 1 ) ; secProg . setColorFilter ( lighten ( themeColor ) , PorterDuff . Mode . SRC_ATOP ) ; Drawable prg = drawable . getDrawable ( 2 ) ; prg . setColorFilter ( themeColor , PorterDuff . Mode . SRC_ATOP ) ; mProgress . setProgressDrawable ( drawable ) ; // Style the indeterminate drawable color Drawable animDrawable = mProgress . getIndeterminateDrawable ( ) ; animDrawable . setColorFilter ( themeColor , PorterDuff . Mode . SRC_ATOP ) ; } if ( design . isLight ( ) ) { mProgressText . setTextColor ( mLayout . getResources ( ) . getColor ( R . color . tertiary_text_material_light ) ) ; mProgressMax . setTextColor ( mLayout . getResources ( ) . getColor ( R . color . tertiary_text_material_light ) ) ; } else { mProgressText . setTextColor ( mLayout . getResources ( ) . getColor ( R . color . tertiary_text_material_dark ) ) ; mProgressMax . setTextColor ( mLayout . getResources ( ) . getColor ( R . color . tertiary_text_material_dark ) ) ; } if ( design . isMaterial ( ) ) { FontLoader . applyTypeface ( mProgressText , Types . ROBOTO_MEDIUM ) ; FontLoader . applyTypeface ( mProgressMax , Types . ROBOTO_MEDIUM ) ; } // Style the progress message if available TextView progressMessage = ( TextView ) mLayout . findViewById ( R . id . progress_mesage ) ; if ( progressMessage != null ) { if ( design . isMaterial ( ) ) { LinearLayout progressContainer = ( LinearLayout ) mLayout . findViewById ( R . id . progress_container ) ; progressContainer . removeView ( progressMessage ) ; LinearLayout . LayoutParams params = ( LinearLayout . LayoutParams ) progressMessage . getLayoutParams ( ) ; CharSequence text = progressMessage . getText ( ) ; if ( design . isLight ( ) ) { progressMessage = new TextView ( mCtx , null , R . style . Widget_PostOffice_Material_Light_Dialog_Message ) ; } else { progressMessage = new TextView ( mCtx , null , R . style . Widget_PostOffice_Material_Dark_Dialog_Message ) ; } // Re Update progressMessage . setText ( text ) ; // Set the roboto font FontLoader . applyTypeface ( progressMessage , Types . ROBOTO_REGULAR ) ; // Add it back to the layout progressContainer . addView ( progressMessage , params ) ; } } }
Apply the design of a delivery to this style