Skip to content

Commit

Permalink
Added ability to set action menu color programmatically.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brady Larson committed Mar 11, 2015
1 parent 07036d9 commit 95e01f8
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,36 @@ public void draw(Canvas canvas) {
}
}


/**
* Sets the normal color of the add button
*
* @param color
*/
public void setAddButtonColorNormal(int color) {
mAddButtonColorNormal = color;
mAddButton.updateBackground();
}

public void setAddButtonColorNormalResId(@ColorRes int plusColor) {
setAddButtonColorNormal(getColor(plusColor));
}

/**
* Sets the pressed color of the add button
*
* @param color
*/
public void setAddButtonColorPressed(int color) {
mAddButtonColorPressed = color;
mAddButton.updateBackground();
}

public void setAddButtonColorPressedResId(@ColorRes int plusColor) {
setAddButtonColorPressed(getColor(plusColor));
}


private void createAddButton(Context context) {
mAddButton = new AddFloatingActionButton(context) {
@Override
Expand Down

1 comment on commit 95e01f8

@DemonStars
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need fam-setters too, but It's not correctly decision. I guess that these attributes for adding buttons into menu ...

Please sign in to comment.