Skip to content

Commit

Permalink
Merge branch 'release-1.3.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
markormesher committed Aug 22, 2017
2 parents 277c651 + e8d6bb8 commit 0947d91
Show file tree
Hide file tree
Showing 4 changed files with 10,846 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ buildscript {
}

def version = new Properties()
version['code'] = 13
version['name'] = '1.3.3'
version['code'] = 14
version['name'] = '1.3.4'

def secrets = getSecrets()

Expand Down
4 changes: 2 additions & 2 deletions fab/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ buildscript {
}

def version = new Properties()
version['code'] = 13
version['name'] = '1.3.3'
version['code'] = 14
version['name'] = '1.3.4'

apply plugin: 'me.tatarka.retrolambda'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,18 @@ public void setContentCoverColour(int colour) {
((GradientDrawable) coverView.getBackground()).setColor(colour);
}

/**
* Sets whether the layer that opens behind the speed dial menu is enabled.
*
* @param enabled {@code true} to enable the layer, {@code false} to disable it
*/
public void setContentCoverEnabled(boolean enabled) {
contentCoverEnabled = enabled;
if (!enabled) {
setSpeedDialCoverVisible(false);
}
}

/**
* Hide the FAB.
*/
Expand Down Expand Up @@ -508,10 +520,14 @@ public void onAnimationEnd(Animator animation) {

/**
* Toggles the "cover", based on whether or not the speed-dial menu is open.
* This method respects values set in {@code setContentCoverEnabled}.
*
* @param visible {@code true} to indicate that the menu is open
*/
private void setSpeedDialCoverVisible(boolean visible) {
// disabled?
if (!contentCoverEnabled) return;

// busy?
if (busyAnimatingSpeedDialCover) return;
busyAnimatingSpeedDialCover = true;
Expand Down Expand Up @@ -570,6 +586,7 @@ public void onAnimationEnd(Animator animation) {
private int savedIconResId = -1;
private int savedBgColour = 0xff3f51b5;
private int savedCoverColour = 0x99ffffff;
private boolean contentCoverEnabled = true;

@Override
protected Parcelable onSaveInstanceState() {
Expand All @@ -578,6 +595,7 @@ protected Parcelable onSaveInstanceState() {
bundle.putInt("savedIconResId", savedIconResId);
bundle.putInt("savedBgColour", savedBgColour);
bundle.putInt("savedCoverColour", savedCoverColour);
bundle.putBoolean("contentCoverEnabled", contentCoverEnabled);
bundle.putParcelable("SUPER", super.onSaveInstanceState());
return bundle;
}
Expand Down Expand Up @@ -611,6 +629,12 @@ protected void onRestoreInstanceState(Parcelable state) {
setContentCoverColour(savedCoverColour);
}

// cover enabled
if (bundle.containsKey("contentCoverEnabled")) {
contentCoverEnabled = bundle.getBoolean("contentCoverEnabled");
setContentCoverEnabled(contentCoverEnabled);
}

// super-state
state = bundle.getParcelable("SUPER");
}
Expand Down
Loading

0 comments on commit 0947d91

Please sign in to comment.