wangjiegulu / RapidFloatingActionButton

Quick solutions for Floating Action Button,RapidFloatingActionButton(RFAB)
Apache License 2.0
1.29k stars 253 forks source link

Can I use 'setColorFilter' function? And please upload to Maven. #1

Closed MewX closed 9 years ago

MewX commented 9 years ago

I want to change rfab icon's color, is there any way to reach this?

wangjiegulu commented 9 years ago
  1. Can not change rfab icon's color now, I will support it feature(next version).
  2. I Uploaded to Maven:

    Gradle:

compile 'com.github.wangjiegulu:RapidFloatingActionButton:1.0.1'

Maven:

<dependency>
    <groupId>com.github.wangjiegulu</groupId>
    <artifactId>RapidFloatingActionButton</artifactId>
    <version>1.0.1</version>
</dependency>
wangjiegulu commented 9 years ago

You may try this way:

DRAWABLE_A: The drawable when pressed state
DRAWABLE_B: The drawable when normal state

StateListDrawable drawable = new StateListDrawable();
drawable.addState(new int[]{android.R.attr.state_pressed, android.R.attr.state_enabled}, DRAWABLE_A);
drawable.addState(new int[]{}, DRAWABLE_B);

// Set the drawable that you want to the rfab
rfaButton.setButtonDrawable(drawable);
rfaButton.build();
MewX commented 9 years ago

Oh, thx!