Modificaciones sobre boton flotante
Partiendo del componente FabOptions
Añadiendo en la clase FabOptions.java el método:
public void changeColorbackground(int color){
Drawable d = mBackground.getBackground();
d = DrawableCompat.wrap(d);
DrawableCompat.setTint(d.mutate(), color);
}
public void changeColor(int color){
mFab.setBackgroundTintList(new ColorStateList(new int[][]{new int[]{0}}, new int[]{color}));
}
y llamandolo pasandole el color:
fabOptions.changeColorBackground((getResources().getColor(R.color.verde));
Podemos obtener resultados como:
Y para cambiar el color del boton principal:
fabOptions.changeColor((getResources().getColor(R.color.verde2));
Hey author here, thanks for the post 😉