Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some methods! #126

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,74 @@ public void draw(Canvas canvas) {
}
}

/**
* Set normal color to the plus button and to all children of this menu.
*
* @param normalColor The normal color
*/
public void setColorNormalToAll(int normalColor) {
mAddButtonColorNormal = normalColor;
mAddButton.setColorNormal(normalColor);

for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
if (child instanceof FloatingActionButton) {
((FloatingActionButton) child).setColorNormal(normalColor);
}
}
}

/**
* Set pressed color to the plus button and to all children of this menu.
*
* @param pressedColor The pressed color
*/
public void setColorPressedToAll(int pressedColor) {
mAddButtonColorPressed = pressedColor;
mAddButton.setColorPressed(pressedColor);

for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
if (child instanceof FloatingActionButton) {
((FloatingActionButton) child).setColorPressed(pressedColor);
}
}
}

/**
* Set normal color id to the plus button and to all children of this menu.
*
* @param normalColor The normal color res id
*/
public void setColorNormalResIdToAll(@ColorRes int normalColor) {
mAddButtonColorNormal = getColor(normalColor);
mAddButton.setColorNormalResId(normalColor);

for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
if (child instanceof FloatingActionButton) {
((FloatingActionButton) child).setColorNormalResId(normalColor);
}
}
}

/**
* Set pressed color id to the plus button and to all children of this menu.
*
* @param pressedColor The pressed color res id
*/
public void setColorPressedResIdToAll(@ColorRes int pressedColor) {
mAddButtonColorPressed = getColor(pressedColor);
mAddButton.setColorPressedResId(pressedColor);

for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
if (child instanceof FloatingActionButton) {
((FloatingActionButton) child).setColorPressedResId(pressedColor);
}
}
}

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