mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 09:26:51 +00:00
Introducing Clear-all button on Overview
It’s an initial implementation, i.e. no fancy effects. It shares a parent (LauncherRecentsViewContainer) with RecentsView. The button is centered in clear_all_button_container, which gets positioned programmatically to the right of the last task. (RTL polish will be a separate CL as well). Bug: 72222505 Change-Id: Ia912908a93a30c2f51450ccf0f97c7495e7916d5 Test: Manual
This commit is contained in:
@@ -20,7 +20,7 @@ import static com.android.launcher3.anim.Interpolators.AGGRESSIVE_EASE_IN_OUT;
|
||||
import static com.android.launcher3.anim.Interpolators.LINEAR;
|
||||
import static com.android.quickstep.views.LauncherRecentsView.TRANSLATION_Y_FACTOR;
|
||||
import static com.android.quickstep.views.RecentsView.ADJACENT_SCALE;
|
||||
import static com.android.quickstep.views.RecentsView.CONTENT_ALPHA;
|
||||
import static com.android.quickstep.views.RecentsViewContainer.CONTENT_ALPHA;
|
||||
|
||||
import android.animation.ValueAnimator;
|
||||
import android.annotation.TargetApi;
|
||||
@@ -33,21 +33,24 @@ import com.android.launcher3.LauncherStateManager.StateHandler;
|
||||
import com.android.launcher3.anim.AnimatorSetBuilder;
|
||||
import com.android.launcher3.anim.PropertySetter;
|
||||
import com.android.quickstep.views.LauncherRecentsView;
|
||||
import com.android.quickstep.views.RecentsViewContainer;
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.O)
|
||||
public class RecentsViewStateController implements StateHandler {
|
||||
|
||||
private final Launcher mLauncher;
|
||||
private final LauncherRecentsView mRecentsView;
|
||||
private final RecentsViewContainer mRecentsViewContainer;
|
||||
|
||||
public RecentsViewStateController(Launcher launcher) {
|
||||
mLauncher = launcher;
|
||||
mRecentsView = launcher.getOverviewPanel();
|
||||
mRecentsViewContainer = launcher.getOverviewPanelContainer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setState(LauncherState state) {
|
||||
mRecentsView.setContentAlpha(state.overviewUi ? 1 : 0);
|
||||
mRecentsViewContainer.setContentAlpha(state.overviewUi ? 1 : 0);
|
||||
float[] scaleTranslationYFactor = state.getOverviewScaleAndTranslationYFactor(mLauncher);
|
||||
mRecentsView.setAdjacentScale(scaleTranslationYFactor[0]);
|
||||
mRecentsView.setTranslationYFactor(scaleTranslationYFactor[1]);
|
||||
@@ -66,7 +69,7 @@ public class RecentsViewStateController implements StateHandler {
|
||||
builder.getInterpolator(ANIM_OVERVIEW_TRANSLATION, LINEAR));
|
||||
setter.setFloat(mRecentsView, TRANSLATION_Y_FACTOR, scaleTranslationYFactor[1],
|
||||
builder.getInterpolator(ANIM_OVERVIEW_TRANSLATION, LINEAR));
|
||||
setter.setFloat(mRecentsView, CONTENT_ALPHA, toState.overviewUi ? 1 : 0,
|
||||
setter.setFloat(mRecentsViewContainer, CONTENT_ALPHA, toState.overviewUi ? 1 : 0,
|
||||
AGGRESSIVE_EASE_IN_OUT);
|
||||
|
||||
if (!toState.overviewUi) {
|
||||
|
||||
Reference in New Issue
Block a user