Skip to content

Commit

Permalink
Added option to add button to the menu at position. Closes Clans#44.
Browse files Browse the repository at this point in the history
  • Loading branch information
Clans committed Aug 23, 2015
1 parent da3cb97 commit 2dddcef
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions library/src/main/java/com/github/clans/fab/FloatingActionMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,19 @@ public void removeMenuButton(FloatingActionButton fab) {
mButtonsCount--;
}

public void addMenuButton(FloatingActionButton fab, int index) {
int size = mButtonsCount - 2;
if (index < 0) {
index = 0;
} else if (index > size) {
index = size;
}

addView(fab, index);
mButtonsCount++;
addLabel(fab);
}

public void removeAllMenuButtons() {
close(true);

Expand Down

0 comments on commit 2dddcef

Please sign in to comment.