android-floating-action-button icon indicating copy to clipboard operation
android-floating-action-button copied to clipboard

Can't change the color of float action menu

Open Abdelsattar opened this issue 9 years ago • 10 comments

i'm trying to change the color of the float button via more than method but it still blue and i don't know where the blue come from here my color accent #FF5722 near to orange tried to change it via button.setColorNormal(R.color.pink); and the setBackgroundTintList(); and also in xml here app:backgroundTint="@color/white"

and the three attribute fab:fab_addButtonColorNormal="@color/white" fab:fab_addButtonColorPressed="@color/white_pressed" fab:fab_addButtonPlusIconColor="@color/half_black" doesn't work also

Abdelsattar avatar May 07 '16 15:05 Abdelsattar

+1. I have used this library long back and I remember I could change the color very easily. But recently, idk if its a bug, but I am not able to change the color of the FAB.

srujanb avatar May 16 '16 05:05 srujanb

Just Change the "colorAccent" or "accent" in the styles.xml file👍

ibnouf88 avatar May 17 '16 23:05 ibnouf88

Well when I did it programetically, it worked. It isnt working if I use the xml tags. Any idea? I copy pasted the FAB xml code from the sample itself, so that wasn't a problem.

srujanb avatar May 19 '16 14:05 srujanb

@srujan7 the sample has wrong attributes

using these tags on a FloatActionMenu does not do anything fab:fab_colorNormal="@color/colorAccent" fab:fab_colorPressed="@color/colorAccentDark"

use these attributes instead (thx to OP) fab:fab_addButtonColorNormal="@color/colorAccent" fab:fab_addButtonColorPressed="@color/colorAccentDark"

i must admit that it's misleading to use attributes that are named and clearly intended to be used with the AddButton

JanosSarkezi avatar Oct 02 '16 08:10 JanosSarkezi

Cool! I'll check on convenience.

srujanb avatar Oct 26 '16 10:10 srujanb

use app:fab_addButtonColorNormal="your_color"

danielMensah avatar Nov 12 '16 14:11 danielMensah

is there any way to change this property programatically?

shokri-navid avatar Dec 15 '16 19:12 shokri-navid

@danielMensah thanks it work Finally but the blue_light color still there when the FAB rotate .

mima5 avatar Jan 07 '17 13:01 mima5

You can use this , i think it will work for you

fab.setColorNormal(ContextCompat.getColor(getContext(),R.color.accent)); fab.setColorPressed(ContextCompat.getColor(getContext(),R.color.accent));

akshaymahajan28 avatar Apr 08 '17 14:04 akshaymahajan28

@mima5 blue color was still there on rotation for me too

you have to change app:fab_addButtonColorPressed

csabatini avatar Jun 25 '18 00:06 csabatini