mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user