mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 08:16:49 +00:00
Merge "Allow user to tap on stashed app to launch task in fullscreen" into tm-qpr-dev am: c480c268e8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20432050 Change-Id: I9a65608333cf457ca36e7bcf6407c8296913d9e1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -25,7 +25,7 @@ import android.view.animation.Interpolator;
|
||||
*/
|
||||
public interface SplitAnimationTimings {
|
||||
int TABLET_ENTER_DURATION = 866;
|
||||
int TABLET_CONFIRM_DURATION = 383;
|
||||
int TABLET_CONFIRM_DURATION = 500;
|
||||
|
||||
int PHONE_ENTER_DURATION = 517;
|
||||
int PHONE_CONFIRM_DURATION = 333;
|
||||
|
||||
@@ -41,6 +41,7 @@ import static com.android.launcher3.anim.Interpolators.FINAL_FRAME;
|
||||
import static com.android.launcher3.anim.Interpolators.LINEAR;
|
||||
import static com.android.launcher3.anim.Interpolators.OVERSHOOT_0_75;
|
||||
import static com.android.launcher3.anim.Interpolators.clampToProgress;
|
||||
import static com.android.launcher3.config.FeatureFlags.ENABLE_LAUNCH_FROM_STAGED_APP;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_OVERVIEW_ACTIONS_SPLIT;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_CLEAR_ALL;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_DISMISS_SWIPE_UP;
|
||||
@@ -125,7 +126,6 @@ import androidx.annotation.Nullable;
|
||||
import androidx.annotation.UiThread;
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
|
||||
import com.android.launcher3.AbstractFloatingView;
|
||||
import com.android.launcher3.BaseActivity;
|
||||
import com.android.launcher3.BaseActivity.MultiWindowModeChangedListener;
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
@@ -2903,6 +2903,11 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
false /* fadeWithThumbnail */, true /* isStagedTask */);
|
||||
}
|
||||
|
||||
// TODO (b/257513449): Launch animation not fully complete. OK to remove flag once it is.
|
||||
if (ENABLE_LAUNCH_FROM_STAGED_APP.get()) {
|
||||
mFirstFloatingTaskView.setOnClickListener(this::animateToFullscreen);
|
||||
}
|
||||
|
||||
// SplitInstructionsView: animate in
|
||||
safeRemoveDragLayerView(mSplitInstructionsView);
|
||||
mSplitInstructionsView = SplitInstructionsView.getSplitInstructionsView(mActivity);
|
||||
@@ -2946,6 +2951,34 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
});
|
||||
}
|
||||
|
||||
private void animateToFullscreen(View view) {
|
||||
FloatingTaskView stagedTaskView = (FloatingTaskView) view;
|
||||
|
||||
boolean isTablet = mActivity.getDeviceProfile().isTablet;
|
||||
int duration = isTablet
|
||||
? SplitAnimationTimings.TABLET_CONFIRM_DURATION
|
||||
: SplitAnimationTimings.PHONE_CONFIRM_DURATION;
|
||||
|
||||
PendingAnimation pendingAnimation = new PendingAnimation(duration);
|
||||
|
||||
Rect firstTaskStartingBounds = new Rect();
|
||||
Rect firstTaskEndingBounds = new Rect();
|
||||
|
||||
stagedTaskView.getBoundsOnScreen(firstTaskStartingBounds);
|
||||
mActivity.getDragLayer().getBoundsOnScreen(firstTaskEndingBounds);
|
||||
|
||||
stagedTaskView.addConfirmAnimation(
|
||||
pendingAnimation,
|
||||
new RectF(firstTaskStartingBounds),
|
||||
firstTaskEndingBounds,
|
||||
false /* fadeWithThumbnail */,
|
||||
true /* isStagedTask */);
|
||||
|
||||
pendingAnimation.addEndListener(success -> launchStagedTask());
|
||||
|
||||
pendingAnimation.buildAnim().start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link PendingAnimation} for dismissing the specified {@link TaskView}.
|
||||
* @param dismissedTaskView the {@link TaskView} to be dismissed
|
||||
@@ -4294,11 +4327,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
Rect firstTaskEndingBounds = mTempRect;
|
||||
|
||||
boolean isTablet = mActivity.getDeviceProfile().isTablet;
|
||||
int duration = isTablet
|
||||
? SplitAnimationTimings.TABLET_CONFIRM_DURATION
|
||||
: SplitAnimationTimings.PHONE_CONFIRM_DURATION;
|
||||
PendingAnimation pendingAnimation = new PendingAnimation(duration);
|
||||
SplitAnimationTimings timings = AnimUtils.getDeviceSplitToConfirmTimings(isTablet);
|
||||
PendingAnimation pendingAnimation = new PendingAnimation(timings.getDuration());
|
||||
|
||||
int halfDividerSize = getResources()
|
||||
.getDimensionPixelSize(R.dimen.multi_window_task_divider_size) / 2;
|
||||
@@ -4650,6 +4680,16 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
return mPendingAnimation;
|
||||
}
|
||||
|
||||
protected void launchStagedTask() {
|
||||
if (mSplitHiddenTaskView != null) {
|
||||
// Split staging was started from an existing running task (in Overview)
|
||||
mSplitHiddenTaskView.launchTask(success -> resetFromSplitSelectionState());
|
||||
} else {
|
||||
// Split staging was started from a new intent (from app menu in Home/AllApps)
|
||||
mActivity.startActivity(mSplitSelectSource.intent);
|
||||
}
|
||||
}
|
||||
|
||||
protected void onTaskLaunchAnimationEnd(boolean success) {
|
||||
if (success) {
|
||||
resetTaskVisuals();
|
||||
|
||||
@@ -342,6 +342,11 @@ public final class FeatureFlags {
|
||||
public static final BooleanFlag ENABLE_DEVICE_PROFILE_LOGGING = new DeviceFlag(
|
||||
"ENABLE_DEVICE_PROFILE_LOGGING", false, "Allows DeviceProfile logging");
|
||||
|
||||
public static final BooleanFlag ENABLE_LAUNCH_FROM_STAGED_APP = getDebugFlag(
|
||||
"ENABLE_LAUNCH_FROM_STAGED_APP", false,
|
||||
"Enable the ability to tap a staged app during split select to launch it in full screen"
|
||||
);
|
||||
|
||||
public static void initialize(Context context) {
|
||||
synchronized (sDebugFlags) {
|
||||
for (DebugFlag flag : sDebugFlags) {
|
||||
|
||||
Reference in New Issue
Block a user