Allow clear all button in overview be clickable if visible

Test: enter overview, make sure clear all button is invisible, try to
tap its location
Fixes: 110432640

Change-Id: I7531e4c6cfdcc9a29d98da24a73c32b8080e013c
This commit is contained in:
Matthew Ng
2018-06-19 15:32:56 -07:00
parent 3471127e8b
commit 330a634648

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);
}
}