Skip to content

Commit

Permalink
Fix FAB remaining clickable when hidden.
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbutcher committed Nov 10, 2015
1 parent 4261b3e commit 3100919
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions app/src/main/java/io/plaidapp/ui/DesignerNewsStory.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package io.plaidapp.ui;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.annotation.TargetApi;
Expand Down Expand Up @@ -326,9 +327,10 @@ private void updateFabVisibility(final int firstVisibleItemPosition) {
.scaleY(0f)
.alpha(0.6f)
.setDuration(200L)
.withLayer()
.setInterpolator(AnimationUtils.loadInterpolator(this,
android.R.interpolator.fast_out_linear_in))
.withLayer()
.setListener(postHideFab)
.start();
} else if (fabShouldBeVisible && !fabIsVisible) {
fabIsVisible = true;
Expand All @@ -337,14 +339,29 @@ private void updateFabVisibility(final int firstVisibleItemPosition) {
.scaleY(1f)
.alpha(1f)
.setDuration(200L)
.withLayer()
.setInterpolator(AnimationUtils.loadInterpolator(this,
android.R.interpolator.linear_out_slow_in))
.withLayer()
.setListener(preShowFab)
.start();
ImeUtils.hideIme(enterComment);
}
}

private AnimatorListenerAdapter preShowFab = new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
fab.setVisibility(View.VISIBLE);
}
};

private AnimatorListenerAdapter postHideFab = new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
fab.setVisibility(View.GONE);
}
};

// title can expand up to a max number of lines. If it does then adjust the list padding
// & reset scroll trackers
private View.OnLayoutChangeListener titlebarLayout = new View.OnLayoutChangeListener() {
Expand Down

0 comments on commit 3100919

Please sign in to comment.