Update the colors for gesture navigation tutorial.
This change introduces tokens for the lottie animations so that the colors can be changed. In this change, the home gesture tutorial colors have been updated to match the updated design at http://shortn/_VvbigpP0ys Flag: ENABLE_NEW_GESTURE_NAV_TUTORIAL Bug: 279823249 Test: Manually went through the tutorial on handheld, foldable, and tablet Change-Id: Id2270cea41345e8f4d330097e10a7dae2b00032a
This commit is contained in:
@@ -96,7 +96,7 @@ final class BackGestureTutorialController extends TutorialController {
|
||||
|
||||
@Override
|
||||
protected int getSwipeActionColorResId() {
|
||||
return R.color.gesture_back_tutorial_background;
|
||||
return R.color.gesture_tutorial_workspace_background;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,6 +24,9 @@ import android.os.Build;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.quickstep.interaction.EdgeBackGestureHandler.BackGestureResult;
|
||||
import com.android.quickstep.interaction.NavBarGestureHandler.NavBarGestureResult;
|
||||
import com.android.quickstep.util.LottieAnimationColorUtils;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/** A {@link TutorialController} for the Home tutorial. */
|
||||
@TargetApi(Build.VERSION_CODES.R)
|
||||
@@ -31,6 +34,14 @@ final class HomeGestureTutorialController extends SwipeUpGestureTutorialControll
|
||||
|
||||
HomeGestureTutorialController(HomeGestureTutorialFragment fragment, TutorialType tutorialType) {
|
||||
super(fragment, tutorialType);
|
||||
if (ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()) {
|
||||
LottieAnimationColorUtils.updateColors(
|
||||
mAnimatedGestureDemonstration,
|
||||
Map.of(".onSurfaceHome", R.color.gesture_tutorial_workspace_background,
|
||||
".surfaceHome", R.color.gesture_home_tutorial_background,
|
||||
".arrow", R.color.gesture_home_tutorial_arrow),
|
||||
mContext.getTheme());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,7 +90,7 @@ final class HomeGestureTutorialController extends SwipeUpGestureTutorialControll
|
||||
|
||||
@Override
|
||||
protected int getSwipeActionColorResId() {
|
||||
return R.color.gesture_home_tutorial_swipe_up_rect;
|
||||
return R.color.gesture_tutorial_workspace_background;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+4
-4
@@ -89,14 +89,14 @@ final class OverviewGestureTutorialController extends SwipeUpGestureTutorialCont
|
||||
|
||||
@Override
|
||||
protected int getSwipeActionColorResId() {
|
||||
return ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()
|
||||
? R.color.gesture_overview_background
|
||||
: R.color.gesture_overview_tutorial_swipe_rect;
|
||||
return R.color.gesture_overview_background;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMockPreviousAppTaskThumbnailColorResId() {
|
||||
return R.color.gesture_overview_tutorial_swipe_rect;
|
||||
return ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()
|
||||
? R.color.gesture_overview_tutorial_swipe_rect
|
||||
: R.color.gesture_tutorial_fake_previous_task_view_color;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -118,7 +118,7 @@ abstract class TutorialController implements BackGestureAttemptCallback,
|
||||
private final AlertDialog mSkipTutorialDialog;
|
||||
|
||||
private boolean mGestureCompleted = false;
|
||||
private LottieAnimationView mAnimatedGestureDemonstration;
|
||||
protected LottieAnimationView mAnimatedGestureDemonstration;
|
||||
private LottieAnimationView mCheckmarkAnimation;
|
||||
private RelativeLayout mFullGestureDemonstration;
|
||||
|
||||
@@ -553,7 +553,7 @@ abstract class TutorialController implements BackGestureAttemptCallback,
|
||||
protected void resetViewsForBackGesture() {
|
||||
mFakeTaskView.setVisibility(View.VISIBLE);
|
||||
mFakeTaskView.setBackgroundColor(
|
||||
mContext.getColor(R.color.gesture_back_tutorial_background));
|
||||
mContext.getColor(R.color.gesture_tutorial_workspace_background));
|
||||
mExitingAppView.setVisibility(View.VISIBLE);
|
||||
|
||||
// reset the exiting app's dimensions
|
||||
|
||||
Reference in New Issue
Block a user