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:
commit
0d746f600b
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue