Multi property refactor

- Introduced MultiPropertyDelegate to delegate Kotlin var to MultipPropertyFactory, allowing easy creation of var for MultiPropertyFactory
- Introduced KFloatProperty to map any Kotlin var to a FloatProperty, which simplify the code to creaet FloatProperty a lot
- Combined the above to refactor usage of MultipPropertyFactory, use var to simplfiy things, and expose them as FloatProperty directly when needed

Fix: 399635468
Test: Smoke test main flow of enter Overview, task launching etc.
Test: presubmit
Flag: EXEMPT REFACTOR
Change-Id: Ie7dd8b69da7e3bda9026a0ef7b0377c26a78a332
This commit is contained in:
Alex Chau
2025-02-26 22:57:26 +00:00
parent 7699ddc59d
commit 3c3d636dc9
9 changed files with 185 additions and 214 deletions
@@ -66,6 +66,7 @@ import static com.android.launcher3.util.SystemUiController.UI_STATE_FULLSCREEN_
import static com.android.quickstep.BaseContainerInterface.getTaskDimension;
import static com.android.quickstep.TaskUtils.checkCurrentOrManagedUserId;
import static com.android.quickstep.util.LogUtils.splitFailureMessage;
import static com.android.quickstep.views.ClearAllButton.DISMISS_ALPHA;
import static com.android.quickstep.views.OverviewActionsView.HIDDEN_ACTIONS_IN_MENU;
import static com.android.quickstep.views.OverviewActionsView.HIDDEN_DESKTOP;
import static com.android.quickstep.views.OverviewActionsView.HIDDEN_NON_ZERO_ROTATION;
@@ -73,6 +74,7 @@ import static com.android.quickstep.views.OverviewActionsView.HIDDEN_NO_RECENTS;
import static com.android.quickstep.views.OverviewActionsView.HIDDEN_NO_TASKS;
import static com.android.quickstep.views.OverviewActionsView.HIDDEN_SPLIT_SELECT_ACTIVE;
import static com.android.quickstep.views.RecentsViewUtils.DESK_EXPLODE_PROGRESS;
import static com.android.quickstep.views.TaskView.SPLIT_ALPHA;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -3974,8 +3976,7 @@ public abstract class RecentsView<
// Change alpha of clear all if translating grid to hide it
if (isClearAllHidden) {
anim.setFloat(mClearAllButton.dismissAlphaProperty, MULTI_PROPERTY_VALUE, 0,
LINEAR);
anim.setFloat(mClearAllButton, DISMISS_ALPHA, 0, LINEAR);
anim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
@@ -5354,8 +5355,7 @@ public abstract class RecentsView<
clampToProgress(timings.getDesktopTaskScaleInterpolator(), 0f,
timings.getDesktopFadeSplitAnimationEndOffset()));
}
builder.addFloat(taskView.getSplitAlphaProperty(),
MULTI_PROPERTY_VALUE, 1f, 0f,
builder.addFloat(taskView, SPLIT_ALPHA, 1f, 0f,
clampToProgress(deskTopFadeInterPolator, 0f,
timings.getDesktopFadeSplitAnimationEndOffset()));
}