Merge changes from topic "am-dbbb1f28-c3b5-48d1-928e-896c408bee5e" into ub-launcher3-master

* changes:
  [automerger] Allow clear all button in overview be clickable if visible am: 330a634648
  Allow clear all button in overview be clickable if visible
This commit is contained in:
TreeHugger Robot 2018-06-21 17:38:24 +00:00 committed by Android (Google) Code Review
commit 0d746f600b
1 changed files with 8 additions and 2 deletions

View File

@ -54,7 +54,7 @@ public class ClearAllButton extends Button implements PageCallbacks {
public void setContentAlpha(float alpha) {
if (mContentAlpha != alpha) {
mContentAlpha = alpha;
setAlpha(mScrollAlpha * mContentAlpha);
updateAlpha();
}
}
@ -68,6 +68,12 @@ public class ClearAllButton extends Button implements PageCallbacks {
float shift = Math.min(scrollState.scrollFromEdge, width);
setTranslationX(mIsRtl ? (mScrollOffset - shift) : (mScrollOffset + shift));
mScrollAlpha = 1 - shift / width;
setAlpha(mScrollAlpha * mContentAlpha);
updateAlpha();
}
private void updateAlpha() {
final float alpha = mScrollAlpha * mContentAlpha;
setAlpha(alpha);
setClickable(alpha == 1);
}
}