Answers for "floatingactionbutton background color"

1

floatingactionbutton image color

app:tint="@android:color/white"
Posted by: Guest on May-12-2021
0

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);
Posted by: Guest on March-14-2022

Code answers related to "floatingactionbutton background color"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language