diff --git a/quickstep/res/drawable/redesigned_default_sandbox_app_icon.xml b/quickstep/res/drawable/redesigned_default_sandbox_app_icon.xml deleted file mode 100644 index 2ab6749aa3..0000000000 --- a/quickstep/res/drawable/redesigned_default_sandbox_app_icon.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - diff --git a/quickstep/res/drawable/hotseat_icon_home.xml b/quickstep/res/drawable/redesigned_hotseat_icon.xml similarity index 94% rename from quickstep/res/drawable/hotseat_icon_home.xml rename to quickstep/res/drawable/redesigned_hotseat_icon.xml index 9ef4863a36..535756dec0 100644 --- a/quickstep/res/drawable/hotseat_icon_home.xml +++ b/quickstep/res/drawable/redesigned_hotseat_icon.xml @@ -16,6 +16,5 @@ - \ No newline at end of file diff --git a/quickstep/res/layout-land/redesigned_gesture_tutorial_mock_hotseat.xml b/quickstep/res/layout-land/redesigned_gesture_tutorial_mock_hotseat.xml index af86ae735d..3b484dc5c9 100644 --- a/quickstep/res/layout-land/redesigned_gesture_tutorial_mock_hotseat.xml +++ b/quickstep/res/layout-land/redesigned_gesture_tutorial_mock_hotseat.xml @@ -40,28 +40,28 @@ android:id="@+id/hotseat_icon_1" android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size" android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size" - android:background="@drawable/hotseat_icon_home" + android:background="@drawable/redesigned_hotseat_icon" android:clipToOutline="true" /> \ No newline at end of file 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 983c15b23b..850f6e3c5a 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 @@ -39,42 +39,42 @@ android:id="@+id/hotseat_search_bar" android:layout_width="200dp" android:layout_height="@dimen/gesture_tutorial_hotseat_search_height" - android:background="@drawable/hotseat_icon_home" + android:background="@drawable/redesigned_hotseat_icon" android:clipToOutline="true" /> \ 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 b41eb8d570..821628ac62 100644 --- a/quickstep/res/layout/redesigned_gesture_tutorial_foldable_mock_hotseat.xml +++ b/quickstep/res/layout/redesigned_gesture_tutorial_foldable_mock_hotseat.xml @@ -26,7 +26,7 @@ android:id="@+id/hotseat_search_bar" android:layout_width="0dp" android:layout_height="@dimen/gesture_tutorial_hotseat_search_height" - android:background="@drawable/hotseat_icon_home" + android:background="@drawable/redesigned_hotseat_icon" android:clipToOutline="true" app:layout_constraintTop_toTopOf="parent" @@ -50,35 +50,35 @@ android:id="@+id/hotseat_icon_1" android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size" android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size" - android:background="@drawable/hotseat_icon_home" + android:background="@drawable/redesigned_hotseat_icon" android:clipToOutline="true" /> \ No newline at end of file diff --git a/quickstep/res/layout/redesigned_gesture_tutorial_fragment.xml b/quickstep/res/layout/redesigned_gesture_tutorial_fragment.xml index 6c4ca2e28a..7d5505e4e2 100644 --- a/quickstep/res/layout/redesigned_gesture_tutorial_fragment.xml +++ b/quickstep/res/layout/redesigned_gesture_tutorial_fragment.xml @@ -96,15 +96,6 @@ android:layout_height="match_parent" android:background="@drawable/gesture_tutorial_ripple" /> - - \ 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 db38cb66d3..0012d47057 100644 --- a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java +++ b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java @@ -130,6 +130,11 @@ final class HomeGestureTutorialController extends SwipeUpGestureTutorialControll return mTutorialFragment.mRootView.mColorSurfaceHome; } + @Override + protected int getHotseatIconColor() { + return getExitingAppColor(); + } + @Override public void onBackGestureAttempted(BackGestureResult result) { if (isGestureCompleted()) { diff --git a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java index d031677fa9..593e6d9a9f 100644 --- a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java +++ b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java @@ -134,7 +134,7 @@ final class OverviewGestureTutorialController extends SwipeUpGestureTutorialCont } @Override - protected int getExitingAppColor() { + protected int getHotseatIconColor() { return mTutorialFragment.mRootView.mColorOnSurfaceOverview; } diff --git a/quickstep/src/com/android/quickstep/interaction/TutorialController.java b/quickstep/src/com/android/quickstep/interaction/TutorialController.java index 06d957aa38..36655d2b01 100644 --- a/quickstep/src/com/android/quickstep/interaction/TutorialController.java +++ b/quickstep/src/com/android/quickstep/interaction/TutorialController.java @@ -29,6 +29,7 @@ import android.animation.ValueAnimator; import android.annotation.RawRes; import android.content.Context; import android.content.pm.PackageManager; +import android.graphics.Color; import android.graphics.Outline; import android.graphics.Rect; import android.graphics.drawable.AnimatedVectorDrawable; @@ -107,7 +108,7 @@ abstract class TutorialController implements BackGestureAttemptCallback, @Nullable View mHotseatIconView; final ClipIconView mFakeIconView; final FrameLayout mFakeTaskView; - final AnimatedTaskbarView mFakeTaskbarView; + @Nullable final AnimatedTaskbarView mFakeTaskbarView; final AnimatedTaskView mFakePreviousTaskView; final View mRippleView; final RippleDrawable mRippleDrawable; @@ -149,7 +150,8 @@ abstract class TutorialController implements BackGestureAttemptCallback, mFakeHotseatView = rootView.findViewById(R.id.gesture_tutorial_fake_hotseat_view); mFakeIconView = rootView.findViewById(R.id.gesture_tutorial_fake_icon_view); mFakeTaskView = rootView.findViewById(R.id.gesture_tutorial_fake_task_view); - mFakeTaskbarView = rootView.findViewById(R.id.gesture_tutorial_fake_taskbar_view); + mFakeTaskbarView = ENABLE_NEW_GESTURE_NAV_TUTORIAL.get() + ? null : rootView.findViewById(R.id.gesture_tutorial_fake_taskbar_view); mFakePreviousTaskView = rootView.findViewById(R.id.gesture_tutorial_fake_previous_task_view); mRippleView = rootView.findViewById(R.id.gesture_tutorial_ripple_view); @@ -269,12 +271,19 @@ abstract class TutorialController implements BackGestureAttemptCallback, protected abstract int getSwipeActionColor(); @ColorInt - protected abstract int getExitingAppColor(); + protected int getExitingAppColor() { + return Color.TRANSPARENT; + } + + @ColorInt + protected int getHotseatIconColor() { + return Color.TRANSPARENT; + } @DrawableRes public int getMockAppIconResId() { return ENABLE_NEW_GESTURE_NAV_TUTORIAL.get() - ? R.drawable.redesigned_default_sandbox_app_icon + ? R.drawable.redesigned_hotseat_icon : R.drawable.default_sandbox_app_icon; } @@ -463,7 +472,7 @@ abstract class TutorialController implements BackGestureAttemptCallback, mFakeTaskView.removeCallbacks(mFakeTaskViewCallback); mFakeTaskViewCallback = null; } - if (mFakeTaskbarViewCallback != null) { + if (mFakeTaskbarViewCallback != null && mFakeTaskbarView != null) { mFakeTaskbarView.removeCallbacks(mFakeTaskbarViewCallback); mFakeTaskbarViewCallback = null; } @@ -621,7 +630,7 @@ abstract class TutorialController implements BackGestureAttemptCallback, } void hideFakeTaskbar(boolean animateToHotseat) { - if (!mTutorialFragment.isLargeScreen()) { + if (!mTutorialFragment.isLargeScreen() || mFakeTaskbarView == null) { return; } if (mFakeTaskbarViewCallback != null) { @@ -635,7 +644,7 @@ abstract class TutorialController implements BackGestureAttemptCallback, } void showFakeTaskbar(boolean animateFromHotseat) { - if (!mTutorialFragment.isLargeScreen()) { + if (!mTutorialFragment.isLargeScreen() || mFakeTaskbarView == null) { return; } if (mFakeTaskbarViewCallback != null) { @@ -670,6 +679,11 @@ abstract class TutorialController implements BackGestureAttemptCallback, } } + private void updateHotseatChildViewColor(@Nullable View child) { + if (child == null) return; + child.getBackground().setTint(getHotseatIconColor()); + } + private void updateDrawables() { if (mContext != null) { mTutorialFragment.getRootView().setBackground(AppCompatResources.getDrawable( @@ -689,6 +703,12 @@ abstract class TutorialController implements BackGestureAttemptCallback, if (ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()) { mExitingAppView.setBackgroundColor(getExitingAppColor()); + updateHotseatChildViewColor(mFakeIconView); + 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_search_bar)); } } } @@ -712,8 +732,10 @@ abstract class TutorialController implements BackGestureAttemptCallback, ? R.dimen.gesture_tutorial_tablet_feedback_margin_top : R.dimen.gesture_tutorial_feedback_margin_top); - mFakeTaskbarView.setVisibility((mTutorialFragment.isLargeScreen() - && !ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()) ? View.VISIBLE : GONE); + if (mFakeTaskbarView != null) { + mFakeTaskbarView.setVisibility( + mTutorialFragment.isLargeScreen() ? View.VISIBLE : GONE); + } RelativeLayout.LayoutParams hotseatLayoutParams = (RelativeLayout.LayoutParams) mFakeHotseatView.getLayoutParams();