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

Ability to customize add button for FloatingActionsMenu added #306

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
classpath 'com.android.tools.build:gradle:2.1.2'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-all.zip
8 changes: 4 additions & 4 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
compileSdkVersion 24
buildToolsVersion "24.0.0"

defaultConfig {
minSdkVersion 14
targetSdkVersion 22
targetSdkVersion 24
versionName project.VERSION_NAME
versionCode Integer.parseInt(project.VERSION_CODE)
consumerProguardFiles 'consumer-proguard-rules.pro'
Expand All @@ -20,7 +20,7 @@ android {
}

dependencies {
compile 'com.android.support:support-annotations:22.2.0'
compile 'com.android.support:support-annotations:24.0.0'
}

apply from: './gradle-mvn-push.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class FloatingActionsMenu extends ViewGroup {

private AnimatorSet mExpandAnimation = new AnimatorSet().setDuration(ANIMATION_DURATION);
private AnimatorSet mCollapseAnimation = new AnimatorSet().setDuration(ANIMATION_DURATION);
private AddFloatingActionButton mAddButton;
protected FloatingActionButton mAddButton;
private RotatingDrawable mRotatingDrawable;
private int mMaxButtonWidth;
private int mMaxButtonHeight;
Expand Down Expand Up @@ -144,7 +144,7 @@ public void draw(Canvas canvas) {
}
}

private void createAddButton(Context context) {
protected void createAddButton(Context context) {
mAddButton = new AddFloatingActionButton(context) {
@Override
void updateBackground() {
Expand Down Expand Up @@ -197,6 +197,15 @@ public void addButton(FloatingActionButton button) {
}
}

public void addButton(FloatingActionButton button, int index) {
addView(button, index);
mButtonsCount++;

if (mLabelsStyle != 0) {
createLabels();
}
}

public void removeButton(FloatingActionButton button) {
removeView(button.getLabelView());
removeView(button);
Expand Down