Merge "Remove the step indicator for the gesture tutorial" into main
diff --git a/quickstep/res/layout/gesture_tutorial_fragment.xml b/quickstep/res/layout/gesture_tutorial_fragment.xml
index 64ad1f7..6e7ff86 100644
--- a/quickstep/res/layout/gesture_tutorial_fragment.xml
+++ b/quickstep/res/layout/gesture_tutorial_fragment.xml
@@ -153,16 +153,6 @@
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintTop_toBottomOf="@id/gesture_tutorial_fragment_feedback_title"/>
 
-        <com.android.quickstep.interaction.TutorialStepIndicator
-            android:id="@+id/gesture_tutorial_fragment_feedback_tutorial_step"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintTop_toTopOf="@id/gesture_tutorial_fragment_action_button"
-            app:layout_constraintBottom_toBottomOf="@id/gesture_tutorial_fragment_action_button"/>
-
         <Button
             android:id="@+id/gesture_tutorial_fragment_action_button"
             style="@style/TextAppearance.GestureTutorial.ButtonLabel"
diff --git a/quickstep/res/layout/redesigned_gesture_tutorial_fragment.xml b/quickstep/res/layout/redesigned_gesture_tutorial_fragment.xml
index 8ca59c4..863319f 100644
--- a/quickstep/res/layout/redesigned_gesture_tutorial_fragment.xml
+++ b/quickstep/res/layout/redesigned_gesture_tutorial_fragment.xml
@@ -165,16 +165,6 @@
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toBottomOf="@id/gesture_tutorial_fragment_feedback_title" />
 
-        <com.android.quickstep.interaction.TutorialStepIndicator
-            android:id="@+id/gesture_tutorial_fragment_feedback_tutorial_step"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toTopOf="parent" />
-
         <Button
             android:id="@+id/gesture_tutorial_fragment_close_button"
             style="@style/TextAppearance.GestureTutorial.Feedback.Subtext"
diff --git a/quickstep/src/com/android/quickstep/interaction/TutorialController.java b/quickstep/src/com/android/quickstep/interaction/TutorialController.java
index 22227c9..1e61967 100644
--- a/quickstep/src/com/android/quickstep/interaction/TutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/TutorialController.java
@@ -109,7 +109,6 @@
     final AnimatedTaskView mFakePreviousTaskView;
     final View mRippleView;
     final RippleDrawable mRippleDrawable;
-    final TutorialStepIndicator mTutorialStepView;
     final ImageView mFingerDotView;
     private final Rect mExitingAppRect = new Rect();
     protected View mExitingAppView;
@@ -152,8 +151,6 @@
         mRippleView = rootView.findViewById(R.id.gesture_tutorial_ripple_view);
         mRippleDrawable = (RippleDrawable) mRippleView.getBackground();
         mDoneButton = rootView.findViewById(R.id.gesture_tutorial_fragment_action_button);
-        mTutorialStepView =
-                rootView.findViewById(R.id.gesture_tutorial_fragment_feedback_tutorial_step);
         mFingerDotView = rootView.findViewById(R.id.gesture_tutorial_finger_dot);
         mSkipTutorialDialog = createSkipTutorialDialog();
 
@@ -488,7 +485,6 @@
     @CallSuper
     void transitToController() {
         updateCloseButton();
-        updateSubtext();
         updateDrawables();
         updateLayout();
 
@@ -605,11 +601,6 @@
         }
     }
 
-    private void updateSubtext() {
-        mTutorialStepView.setTutorialProgress(
-                mTutorialFragment.getCurrentStep(), mTutorialFragment.getNumSteps());
-    }
-
     private void updateHotseatChildViewColor(@Nullable View child) {
         if (child == null) return;
         child.getBackground().setTint(getHotseatIconColor());
diff --git a/quickstep/src/com/android/quickstep/interaction/TutorialStepIndicator.java b/quickstep/src/com/android/quickstep/interaction/TutorialStepIndicator.java
deleted file mode 100644
index f1fc179..0000000
--- a/quickstep/src/com/android/quickstep/interaction/TutorialStepIndicator.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep.interaction;
-
-import android.content.Context;
-import android.graphics.drawable.Drawable;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-
-import com.android.launcher3.R;
-import com.android.launcher3.Utilities;
-import com.android.launcher3.icons.GraphicsUtils;
-
-/** Indicator displaying the current progress through the gesture navigation tutorial. */
-public class TutorialStepIndicator extends LinearLayout {
-
-    private static final String LOG_TAG = "TutorialStepIndicator";
-
-    private int mCurrentStep = -1;
-    private int mTotalSteps = -1;
-
-    public TutorialStepIndicator(Context context) {
-        super(context);
-    }
-
-    public TutorialStepIndicator(Context context, AttributeSet attrs) {
-        super(context, attrs);
-    }
-
-    public TutorialStepIndicator(Context context, AttributeSet attrs, int defStyleAttr) {
-        super(context, attrs, defStyleAttr);
-    }
-
-    public TutorialStepIndicator(Context context, AttributeSet attrs, int defStyleAttr,
-            int defStyleRes) {
-        super(context, attrs, defStyleAttr, defStyleRes);
-    }
-
-    /**
-     * Updates this indicator to display totalSteps indicator pills, with the first currentStep
-     * pills highlighted.
-     */
-    public void setTutorialProgress(int currentStep, int totalSteps) {
-        if (currentStep <= 0) {
-            Log.w(LOG_TAG, "Current step number invalid: " + currentStep + ". Assuming step 1.");
-            currentStep = 1;
-        }
-        if (totalSteps <= 0) {
-            Log.w(LOG_TAG, "Total number of steps invalid: " + totalSteps + ". Assuming 1 step.");
-            totalSteps = 1;
-        }
-        if (currentStep > totalSteps) {
-            Log.w(LOG_TAG, "Current step number greater than the total number of steps. Assuming"
-                    + " final step.");
-            currentStep = totalSteps;
-        }
-        if (totalSteps < 2) {
-            setVisibility(GONE);
-            return;
-        }
-        setVisibility(VISIBLE);
-        mCurrentStep = currentStep;
-        mTotalSteps = totalSteps;
-
-        initializeStepIndicators();
-    }
-
-    private void initializeStepIndicators() {
-        for (int i = mTotalSteps; i < getChildCount(); i++) {
-            removeViewAt(i);
-        }
-        int activeStepIndicatorColor = GraphicsUtils.getAttrColor(
-                getContext(), android.R.attr.textColorPrimary);
-        int inactiveStepIndicatorColor = GraphicsUtils.getAttrColor(
-                getContext(), android.R.attr.textColorSecondaryInverse);
-        for (int i = 0; i < mTotalSteps; i++) {
-            Drawable pageIndicatorPillDrawable =
-                    getContext().getDrawable(R.drawable.tutorial_step_indicator_pill);
-            if (i >= getChildCount()) {
-                ImageView pageIndicatorPill = new ImageView(getContext());
-                pageIndicatorPill.setImageDrawable(pageIndicatorPillDrawable);
-
-                LinearLayout.LayoutParams lp = new LayoutParams(
-                        LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
-
-                lp.setMarginStart(Utilities.dpToPx(3));
-                lp.setMarginEnd(Utilities.dpToPx(3));
-
-                addView(pageIndicatorPill, lp);
-            }
-            if (pageIndicatorPillDrawable != null) {
-                if (i < mCurrentStep) {
-                    pageIndicatorPillDrawable.setTint(activeStepIndicatorColor);
-                } else {
-                    pageIndicatorPillDrawable.setTint(inactiveStepIndicatorColor);
-                }
-            }
-        }
-    }
-}