mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 10:48:19 +00:00
Track LauncherState, RecentsAnimation, resumed state for task bar in one place
TODO: - Consider delaying animating task bar to stashed towards all apps state until user releasing their finger (tho in this change heuristic is applied for stashing and unstashing respectively) - Further consolidate some animation logic Bug: 204220602 Test: manual Change-Id: I58b4d035fcf65a9f5c68e69c129eae95b89b1c4a
This commit is contained in:
@@ -24,6 +24,7 @@ import android.view.View;
|
||||
import com.android.launcher3.anim.AlphaUpdateListener;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* Utility class to handle separating a single value as a factor of multiple values
|
||||
@@ -85,6 +86,8 @@ public class MultiValueAlpha {
|
||||
// Factor of all other alpha channels, only valid if mMyMask is present in mValidMask.
|
||||
private float mOthers = 1;
|
||||
|
||||
private Consumer<Float> mConsumer;
|
||||
|
||||
AlphaProperty(int myMask) {
|
||||
mMyMask = myMask;
|
||||
}
|
||||
@@ -109,16 +112,24 @@ public class MultiValueAlpha {
|
||||
mValidMask = mMyMask;
|
||||
mValue = value;
|
||||
|
||||
mView.setAlpha(mOthers * mValue);
|
||||
final float alpha = mOthers * mValue;
|
||||
mView.setAlpha(alpha);
|
||||
if (mUpdateVisibility) {
|
||||
AlphaUpdateListener.updateVisibility(mView);
|
||||
}
|
||||
if (mConsumer != null) {
|
||||
mConsumer.accept(mValue);
|
||||
}
|
||||
}
|
||||
|
||||
public float getValue() {
|
||||
return mValue;
|
||||
}
|
||||
|
||||
public void setConsumer(Consumer<Float> consumer) {
|
||||
mConsumer = consumer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Float.toString(mValue);
|
||||
|
||||
Reference in New Issue
Block a user