mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 09:26:51 +00:00
Initial commit of new split screen work.
TODO: * Extract out common elements in TaskShortcutFactory.MultiWindowFactory for commonalities between new and old way of invoking split screen * Integrate with WM APIs (b/182002789) * Write tests for SplitSelectStateController Bug: 181704764 Change-Id: Ice35adb4ea82897f5e2433dc9b93a549f3d511b5
This commit is contained in:
@@ -17,11 +17,14 @@ package com.android.launcher3.uioverrides;
|
||||
|
||||
import static com.android.launcher3.LauncherState.CLEAR_ALL_BUTTON;
|
||||
import static com.android.launcher3.LauncherState.OVERVIEW_ACTIONS;
|
||||
import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT;
|
||||
import static com.android.launcher3.LauncherState.SPLIT_PLACHOLDER_VIEW;
|
||||
import static com.android.launcher3.anim.Interpolators.LINEAR;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_ACTIONS_FADE;
|
||||
import static com.android.quickstep.views.RecentsView.CONTENT_ALPHA;
|
||||
import static com.android.quickstep.views.RecentsView.FULLSCREEN_PROGRESS;
|
||||
import static com.android.quickstep.views.RecentsView.TASK_MODALNESS;
|
||||
import static com.android.quickstep.views.SplitPlaceholderView.ALPHA_FLOAT;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.os.Build;
|
||||
@@ -77,11 +80,26 @@ public final class RecentsViewStateController extends
|
||||
AnimationSuccessListener.forRunnable(mRecentsView::resetTaskVisuals));
|
||||
}
|
||||
|
||||
// Create or dismiss split screen select animations
|
||||
LauncherState currentState = mLauncher.getStateManager().getState();
|
||||
if (isSplitSelectionState(toState) && !isSplitSelectionState(currentState)) {
|
||||
builder.add(mRecentsView.createSplitSelectInitAnimation().buildAnim());
|
||||
} else if (!isSplitSelectionState(toState) && isSplitSelectionState(currentState)) {
|
||||
builder.add(mRecentsView.cancelSplitSelect(true).buildAnim());
|
||||
}
|
||||
|
||||
setAlphas(builder, config, toState);
|
||||
builder.setFloat(mRecentsView, FULLSCREEN_PROGRESS,
|
||||
toState.getOverviewFullscreenProgress(), LINEAR);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if {@param toState} is {@link LauncherState#OVERVIEW_SPLIT_SELECT}
|
||||
*/
|
||||
private boolean isSplitSelectionState(@NonNull LauncherState toState) {
|
||||
return toState == OVERVIEW_SPLIT_SELECT;
|
||||
}
|
||||
|
||||
private void setAlphas(PropertySetter propertySetter, StateAnimationConfig config,
|
||||
LauncherState state) {
|
||||
float clearAllButtonAlpha = (state.getVisibleElements(mLauncher) & CLEAR_ALL_BUTTON) != 0
|
||||
@@ -93,6 +111,11 @@ public final class RecentsViewStateController extends
|
||||
propertySetter.setFloat(mLauncher.getActionsView().getVisibilityAlpha(),
|
||||
MultiValueAlpha.VALUE, overviewButtonAlpha, config.getInterpolator(
|
||||
ANIM_OVERVIEW_ACTIONS_FADE, LINEAR));
|
||||
|
||||
float splitPlaceholderAlpha = state.areElementsVisible(mLauncher, SPLIT_PLACHOLDER_VIEW) ?
|
||||
1 : 0;
|
||||
propertySetter.setFloat(mRecentsView.getSplitPlaceholder(), ALPHA_FLOAT,
|
||||
splitPlaceholderAlpha, LINEAR);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user