Polish redesgined tutorial home and overview animations
- Added a 6th hotseat icon to the tablet and unfolded foldable
- not animating the previous task view when animating to hotseat from the home step
- updating the first hotseat icon's color and visibility at the correct times
- cross fading the animating task view and hotseat icon's color
Flag: ENABLE_NEW_GESTURE_NAV_TUTORIAL
Fixes: 283967613
Test: ran the tutorial on handheld, tablet and foldable with ENABLE_NEW_GESTURE_NAV_TUTORIAL true and false
Merged-In: I7a76646ca71502e924f45bba76d72be17d31249d
Change-Id: I7a76646ca71502e924f45bba76d72be17d31249d
diff --git a/quickstep/res/layout-land/redesigned_gesture_tutorial_tablet_mock_hotseat.xml b/quickstep/res/layout-land/redesigned_gesture_tutorial_tablet_mock_hotseat.xml
index 850f6e3..4f1fabe 100644
--- a/quickstep/res/layout-land/redesigned_gesture_tutorial_tablet_mock_hotseat.xml
+++ b/quickstep/res/layout-land/redesigned_gesture_tutorial_tablet_mock_hotseat.xml
@@ -28,7 +28,7 @@
android:layout_height="wrap_content"
app:constraint_referenced_ids="hotseat_search_bar, hotseat_icon_1, hotseat_icon_2,
- hotseat_icon_3, hotseat_icon_4, hotseat_icon_5"
+ hotseat_icon_3, hotseat_icon_4, hotseat_icon_5, hotseat_icon_6"
app:flow_horizontalStyle="spread"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@@ -77,4 +77,11 @@
android:background="@drawable/redesigned_hotseat_icon"
android:clipToOutline="true" />
+ <View
+ android:id="@+id/hotseat_icon_6"
+ android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
+ android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
+ android:background="@drawable/redesigned_hotseat_icon"
+ android:clipToOutline="true" />
+
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
diff --git a/quickstep/res/layout/redesigned_gesture_tutorial_foldable_mock_hotseat.xml b/quickstep/res/layout/redesigned_gesture_tutorial_foldable_mock_hotseat.xml
index 821628a..154ca1a 100644
--- a/quickstep/res/layout/redesigned_gesture_tutorial_foldable_mock_hotseat.xml
+++ b/quickstep/res/layout/redesigned_gesture_tutorial_foldable_mock_hotseat.xml
@@ -40,7 +40,8 @@
android:layout_marginTop="@dimen/gesture_tutorial_hotseat_icon_search_margin"
app:constraint_referenced_ids=
- "hotseat_icon_1, hotseat_icon_2, hotseat_icon_3, hotseat_icon_4, hotseat_icon_5"
+ "hotseat_icon_1, hotseat_icon_2, hotseat_icon_3, hotseat_icon_4, hotseat_icon_5,
+ hotseat_icon_6"
app:flow_horizontalStyle="spread_inside"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -81,4 +82,11 @@
android:background="@drawable/redesigned_hotseat_icon"
android:clipToOutline="true" />
+ <View
+ android:id="@+id/hotseat_icon_6"
+ android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
+ android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
+ android:background="@drawable/redesigned_hotseat_icon"
+ android:clipToOutline="true" />
+
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
diff --git a/quickstep/res/layout/redesigned_gesture_tutorial_tablet_mock_hotseat.xml b/quickstep/res/layout/redesigned_gesture_tutorial_tablet_mock_hotseat.xml
index 821628a..154ca1a 100644
--- a/quickstep/res/layout/redesigned_gesture_tutorial_tablet_mock_hotseat.xml
+++ b/quickstep/res/layout/redesigned_gesture_tutorial_tablet_mock_hotseat.xml
@@ -40,7 +40,8 @@
android:layout_marginTop="@dimen/gesture_tutorial_hotseat_icon_search_margin"
app:constraint_referenced_ids=
- "hotseat_icon_1, hotseat_icon_2, hotseat_icon_3, hotseat_icon_4, hotseat_icon_5"
+ "hotseat_icon_1, hotseat_icon_2, hotseat_icon_3, hotseat_icon_4, hotseat_icon_5,
+ hotseat_icon_6"
app:flow_horizontalStyle="spread_inside"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -81,4 +82,11 @@
android:background="@drawable/redesigned_hotseat_icon"
android:clipToOutline="true" />
+ <View
+ android:id="@+id/hotseat_icon_6"
+ android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
+ android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
+ android:background="@drawable/redesigned_hotseat_icon"
+ android:clipToOutline="true" />
+
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
diff --git a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java
index 333ecbb..ebfa559 100644
--- a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java
@@ -185,7 +185,7 @@
showFeedback(R.string.home_gesture_feedback_swipe_too_far_from_edge);
break;
case OVERVIEW_GESTURE_COMPLETED:
- fadeOutFakeTaskView(true, () -> {
+ fadeOutFakeTaskView(false, () -> {
showFeedback(R.string.home_gesture_feedback_overview_detected);
showFakeTaskbar(/* animateFromHotseat= */ false);
});
diff --git a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java
index f1cbfcc..558d5dc 100644
--- a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java
@@ -15,6 +15,9 @@
*/
package com.android.quickstep.interaction;
+import static android.view.View.INVISIBLE;
+import static android.view.View.VISIBLE;
+
import static com.android.launcher3.anim.Interpolators.ACCEL;
import static com.android.launcher3.util.window.RefreshRateTracker.getSingleFrameMs;
import static com.android.launcher3.views.FloatingIconView.SHAPE_PROGRESS_DURATION;
@@ -38,6 +41,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.core.graphics.ColorUtils;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.InvariantDeviceProfile;
@@ -46,6 +50,7 @@
import com.android.launcher3.anim.AnimatorListeners;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.PendingAnimation;
+import com.android.launcher3.config.FeatureFlags;
import com.android.quickstep.GestureState;
import com.android.quickstep.OverviewComponentObserver;
import com.android.quickstep.RecentsAnimationDeviceState;
@@ -125,6 +130,9 @@
void resetTaskViews() {
mFakeHotseatView.setVisibility(View.INVISIBLE);
mFakeIconView.setVisibility(View.INVISIBLE);
+ if (FeatureFlags.ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()) {
+ mFakeIconView.getBackground().setTint(getFakeTaskViewColor());
+ }
if (mTutorialFragment.getActivity() != null) {
int height = mTutorialFragment.getRootView().getFullscreenHeight();
int width = mTutorialFragment.getRootView().getWidth();
@@ -133,6 +141,9 @@
mFakeTaskViewRadius = 0;
mFakeTaskView.invalidateOutline();
mFakeTaskView.setVisibility(View.VISIBLE);
+ if (FeatureFlags.ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()) {
+ mFakeTaskView.setBackgroundColor(getFakeTaskViewColor());
+ }
mFakeTaskView.setAlpha(1);
mFakePreviousTaskView.setVisibility(View.INVISIBLE);
mFakePreviousTaskView.setAlpha(1);
@@ -250,6 +261,17 @@
// After home animation finishes, fade out and run onEndRunnable.
PendingAnimation fadeAnim = new PendingAnimation(300);
fadeAnim.setViewAlpha(mFakeIconView, 0, ACCEL);
+ final View hotseatIconView = mHotseatIconView;
+ if (hotseatIconView != null) {
+ hotseatIconView.setVisibility(INVISIBLE);
+ fadeAnim.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationStart(Animator animation) {
+ super.onAnimationStart(animation);
+ hotseatIconView.setVisibility(VISIBLE);
+ }
+ });
+ }
if (onEndRunnable != null) {
fadeAnim.addListener(AnimatorListeners.forSuccessCallback(onEndRunnable));
}
@@ -371,6 +393,12 @@
false, /* isOpening */
mFakeIconView, mDp);
mFakeIconView.setAlpha(1);
+ if (FeatureFlags.ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()) {
+ int iconColor = ColorUtils.blendARGB(
+ getFakeTaskViewColor(), getHotseatIconColor(), progress);
+ mFakeIconView.getBackground().setTint(iconColor);
+ mFakeTaskView.setBackgroundColor(iconColor);
+ }
mFakeTaskView.setAlpha(getWindowAlpha(progress));
mFakePreviousTaskView.setAlpha(getWindowAlpha(progress));
}
diff --git a/quickstep/src/com/android/quickstep/interaction/TutorialController.java b/quickstep/src/com/android/quickstep/interaction/TutorialController.java
index a58f453..178d75b 100644
--- a/quickstep/src/com/android/quickstep/interaction/TutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/TutorialController.java
@@ -715,11 +715,12 @@
if (ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()) {
mExitingAppView.setBackgroundColor(getExitingAppColor());
mFakeTaskView.setBackgroundColor(getFakeTaskViewColor());
- updateHotseatChildViewColor(mFakeIconView);
+ updateHotseatChildViewColor(mHotseatIconView);
updateHotseatChildViewColor(mFakeHotseatView.findViewById(R.id.hotseat_icon_2));
updateHotseatChildViewColor(mFakeHotseatView.findViewById(R.id.hotseat_icon_3));
updateHotseatChildViewColor(mFakeHotseatView.findViewById(R.id.hotseat_icon_4));
updateHotseatChildViewColor(mFakeHotseatView.findViewById(R.id.hotseat_icon_5));
+ updateHotseatChildViewColor(mFakeHotseatView.findViewById(R.id.hotseat_icon_6));
updateHotseatChildViewColor(mFakeHotseatView.findViewById(R.id.hotseat_search_bar));
} else {
updateFakeViewLayout(mFakeTaskView, getMockAppTaskLayoutResId());