Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

floatingactionbutton image color


//get the drawable
Drawable myFabSrc = getResources().getDrawable(android.R.drawable.ic_input_add);
//copy it in a new one
Drawable willBeWhite = myFabSrc.getConstantState().newDrawable();
//set the color filter, you can use also Mode.SRC_ATOP
willBeWhite.mutate().setColorFilter(Color.WHITE, PorterDuff.Mode.MULTIPLY);
//set it to your fab button initialized before
myFabName.setImageDrawable(willBeWhite);

Source by devarama.com #
 
PREVIOUS NEXT
Tagged: #floatingactionbutton #image #color
ADD COMMENT
Topic
Name
1+6 =