Skip to content

Commit

Permalink
Feature #237 set FloatingMenu background color programmatically
Browse files Browse the repository at this point in the history
  • Loading branch information
artmoni committed Nov 10, 2015
1 parent aadc751 commit eac78d7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ public void draw(Canvas canvas) {
}
}

public void setColorNormalResId(int resId) {
mAddButtonColorNormal=getColor(resId);
mAddButton.setColorNormal(mAddButtonColorNormal);
}

public void setColorPressedResId(int resId) {
mAddButtonColorPressed=getColor(resId);
mAddButton.setColorPressed(mAddButtonColorPressed);
}

private void createAddButton(Context context) {
mAddButton = new AddFloatingActionButton(context) {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ public void onClick(View v) {
actionB.setVisibility(actionB.getVisibility() == View.GONE ? View.VISIBLE : View.GONE);
}
});

final FloatingActionsMenu menuMultipleActions = (FloatingActionsMenu) findViewById(R.id.multiple_actions);
menuMultipleActions.addButton(actionC);
menuMultipleActions.setColorNormalResId(android.R.color.holo_orange_dark);
menuMultipleActions.setColorPressedResId(android.R.color.holo_orange_light);

final FloatingActionButton removeAction = (FloatingActionButton) findViewById(R.id.button_remove);
removeAction.setOnClickListener(new OnClickListener() {
Expand Down

0 comments on commit eac78d7

Please sign in to comment.