mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
Merge "Fix UI issues of fake task view in gesture nav tutorial." into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
24aec5e6b0
@@ -106,6 +106,7 @@ final class HomeGestureTutorialController extends SwipeUpGestureTutorialControll
|
||||
case BACK_CANCELLED_FROM_LEFT:
|
||||
case BACK_CANCELLED_FROM_RIGHT:
|
||||
case BACK_NOT_STARTED_TOO_FAR_FROM_EDGE:
|
||||
resetTaskView();
|
||||
showFeedback(R.string.home_gesture_feedback_swipe_too_far_from_edge);
|
||||
break;
|
||||
}
|
||||
@@ -135,6 +136,7 @@ final class HomeGestureTutorialController extends SwipeUpGestureTutorialControll
|
||||
}
|
||||
case HOME_NOT_STARTED_TOO_FAR_FROM_EDGE:
|
||||
case OVERVIEW_NOT_STARTED_TOO_FAR_FROM_EDGE:
|
||||
resetTaskView();
|
||||
showFeedback(R.string.home_gesture_feedback_swipe_too_far_from_edge);
|
||||
break;
|
||||
case OVERVIEW_GESTURE_COMPLETED:
|
||||
|
||||
@@ -112,6 +112,7 @@ final class OverviewGestureTutorialController extends SwipeUpGestureTutorialCont
|
||||
case BACK_CANCELLED_FROM_LEFT:
|
||||
case BACK_CANCELLED_FROM_RIGHT:
|
||||
case BACK_NOT_STARTED_TOO_FAR_FROM_EDGE:
|
||||
resetTaskView();
|
||||
showFeedback(R.string.overview_gesture_feedback_swipe_too_far_from_edge);
|
||||
break;
|
||||
}
|
||||
@@ -142,6 +143,7 @@ final class OverviewGestureTutorialController extends SwipeUpGestureTutorialCont
|
||||
}
|
||||
case HOME_NOT_STARTED_TOO_FAR_FROM_EDGE:
|
||||
case OVERVIEW_NOT_STARTED_TOO_FAR_FROM_EDGE:
|
||||
resetTaskView();
|
||||
showFeedback(R.string.overview_gesture_feedback_swipe_too_far_from_edge);
|
||||
break;
|
||||
case OVERVIEW_GESTURE_COMPLETED:
|
||||
|
||||
@@ -61,7 +61,7 @@ import com.android.quickstep.util.TransformParams;
|
||||
@TargetApi(Build.VERSION_CODES.R)
|
||||
abstract class SwipeUpGestureTutorialController extends TutorialController {
|
||||
|
||||
private static final int FAKE_PREVIOUS_TASK_MARGIN = Utilities.dpToPx(12);
|
||||
private static final int FAKE_PREVIOUS_TASK_MARGIN = Utilities.dpToPx(24);
|
||||
|
||||
protected static final long TASK_VIEW_END_ANIMATION_DURATION_MILLIS = 300;
|
||||
private static final long HOME_SWIPE_ANIMATION_DURATION_MILLIS = 625;
|
||||
@@ -77,23 +77,7 @@ abstract class SwipeUpGestureTutorialController extends TutorialController {
|
||||
private final AnimatorListenerAdapter mResetTaskView = new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
mFakeHotseatView.setVisibility(View.INVISIBLE);
|
||||
mFakeIconView.setVisibility(View.INVISIBLE);
|
||||
if (mTutorialFragment.getActivity() != null) {
|
||||
int height = mTutorialFragment.getRootView().getFullscreenHeight();
|
||||
int width = mTutorialFragment.getRootView().getWidth();
|
||||
mFakeTaskViewRect.set(0, 0, width, height);
|
||||
}
|
||||
mFakeTaskViewRadius = 0;
|
||||
mFakeTaskView.invalidateOutline();
|
||||
mFakeTaskView.setVisibility(View.VISIBLE);
|
||||
mFakeTaskView.setAlpha(1);
|
||||
mFakePreviousTaskView.setVisibility(View.INVISIBLE);
|
||||
mFakePreviousTaskView.setAlpha(1);
|
||||
mFakePreviousTaskView.setToSingleRowLayout(false);
|
||||
mShowTasks = false;
|
||||
mShowPreviousTasks = false;
|
||||
mRunningWindowAnim = null;
|
||||
resetTaskView();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -137,6 +121,26 @@ abstract class SwipeUpGestureTutorialController extends TutorialController {
|
||||
mRunningWindowAnim = null;
|
||||
}
|
||||
|
||||
void resetTaskView() {
|
||||
mFakeHotseatView.setVisibility(View.INVISIBLE);
|
||||
mFakeIconView.setVisibility(View.INVISIBLE);
|
||||
if (mTutorialFragment.getActivity() != null) {
|
||||
int height = mTutorialFragment.getRootView().getFullscreenHeight();
|
||||
int width = mTutorialFragment.getRootView().getWidth();
|
||||
mFakeTaskViewRect.set(0, 0, width, height);
|
||||
}
|
||||
mFakeTaskViewRadius = 0;
|
||||
mFakeTaskView.invalidateOutline();
|
||||
mFakeTaskView.setVisibility(View.VISIBLE);
|
||||
mFakeTaskView.setAlpha(1);
|
||||
mFakePreviousTaskView.setVisibility(View.INVISIBLE);
|
||||
mFakePreviousTaskView.setAlpha(1);
|
||||
mFakePreviousTaskView.setToSingleRowLayout(false);
|
||||
mShowTasks = false;
|
||||
mShowPreviousTasks = false;
|
||||
mRunningWindowAnim = null;
|
||||
}
|
||||
|
||||
/** Fades the task view, optionally after animating to a fake Overview. */
|
||||
void fadeOutFakeTaskView(boolean toOverviewFirst, boolean reset,
|
||||
@Nullable Runnable onEndRunnable) {
|
||||
|
||||
Reference in New Issue
Block a user