diff --git a/quickstep/res/drawable-sw600dp-land/gesture_tutorial_home_step_shape.xml b/quickstep/res/drawable-sw600dp-land/gesture_tutorial_home_step_shape.xml index 4cccd09bf5..fd14d346fa 100644 --- a/quickstep/res/drawable-sw600dp-land/gesture_tutorial_home_step_shape.xml +++ b/quickstep/res/drawable-sw600dp-land/gesture_tutorial_home_step_shape.xml @@ -17,11 +17,7 @@ android:height="67dp" android:viewportWidth="232" android:viewportHeight="67"> - - - - + diff --git a/quickstep/res/drawable-sw600dp-land/gesture_tutorial_overview_step_shape.xml b/quickstep/res/drawable-sw600dp-land/gesture_tutorial_overview_step_shape.xml index 7011f6c263..f271c47bbd 100644 --- a/quickstep/res/drawable-sw600dp-land/gesture_tutorial_overview_step_shape.xml +++ b/quickstep/res/drawable-sw600dp-land/gesture_tutorial_overview_step_shape.xml @@ -17,11 +17,7 @@ android:height="94dp" android:viewportWidth="194" android:viewportHeight="94"> - - - - + diff --git a/quickstep/res/drawable-sw720dp-land/gesture_tutorial_home_step_shape.xml b/quickstep/res/drawable-sw720dp-land/gesture_tutorial_home_step_shape.xml index 5becb8b0fe..3e71a3d85a 100644 --- a/quickstep/res/drawable-sw720dp-land/gesture_tutorial_home_step_shape.xml +++ b/quickstep/res/drawable-sw720dp-land/gesture_tutorial_home_step_shape.xml @@ -17,11 +17,7 @@ android:height="73dp" android:viewportWidth="362" android:viewportHeight="73"> - - - - + diff --git a/quickstep/res/drawable-sw720dp-land/gesture_tutorial_overview_step_shape.xml b/quickstep/res/drawable-sw720dp-land/gesture_tutorial_overview_step_shape.xml index 7143089d48..2f111927d4 100644 --- a/quickstep/res/drawable-sw720dp-land/gesture_tutorial_overview_step_shape.xml +++ b/quickstep/res/drawable-sw720dp-land/gesture_tutorial_overview_step_shape.xml @@ -17,11 +17,7 @@ android:height="144dp" android:viewportWidth="297" android:viewportHeight="144"> - - - - + diff --git a/quickstep/res/drawable/gesture_tutorial_back_step_shape.xml b/quickstep/res/drawable/gesture_tutorial_back_step_shape.xml index 68c5eb1fbd..5f951e42b4 100644 --- a/quickstep/res/drawable/gesture_tutorial_back_step_shape.xml +++ b/quickstep/res/drawable/gesture_tutorial_back_step_shape.xml @@ -17,11 +17,7 @@ android:height="208dp" android:viewportWidth="83" android:viewportHeight="208"> - - - - + diff --git a/quickstep/res/layout-sw600dp-land/gesture_tutorial_step_menu.xml b/quickstep/res/layout-sw600dp-land/gesture_tutorial_step_menu.xml index 39c7e73d2d..d24219d253 100644 --- a/quickstep/res/layout-sw600dp-land/gesture_tutorial_step_menu.xml +++ b/quickstep/res/layout-sw600dp-land/gesture_tutorial_step_menu.xml @@ -28,11 +28,13 @@ android:layout_width="0dp" android:layout_height="@dimen/gesture_tutorial_menu_button_height" android:layout_marginEnd="@dimen/gesture_tutorial_menu_button_spacing" + android:layout_marginBottom="24dp" android:background="@drawable/gesture_tutorial_menu_button_background" android:clipToOutline="true" android:backgroundTint="@color/gesture_home_tutorial_background" app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toTopOf="@id/guideline" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toStartOf="@id/gesture_tutorial_menu_back_button"> @@ -40,6 +42,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/gesture_tutorial_home_step_shape" + android:scaleType="fitXY" + android:adjustViewBounds="true" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -64,11 +68,13 @@ android:layout_width="0dp" android:layout_height="@dimen/gesture_tutorial_menu_button_height" android:layout_marginEnd="@dimen/gesture_tutorial_menu_button_spacing" + android:layout_marginBottom="24dp" android:background="@drawable/gesture_tutorial_menu_button_background" android:clipToOutline="true" android:backgroundTint="@color/gesture_back_tutorial_exiting_app" app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toTopOf="@id/guideline" app:layout_constraintStart_toEndOf="@id/gesture_tutorial_menu_home_button" app:layout_constraintEnd_toStartOf="@id/gesture_tutorial_menu_overview_button"> @@ -77,6 +83,8 @@ android:layout_height="wrap_content" android:src="@drawable/gesture_tutorial_back_step_shape" android:layout_marginBottom="@dimen/gesture_tutorial_menu_back_shape_bottom_margin" + android:scaleType="fitXY" + android:adjustViewBounds="true" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent"/> @@ -99,11 +107,13 @@ android:id="@+id/gesture_tutorial_menu_overview_button" android:layout_width="0dp" android:layout_height="@dimen/gesture_tutorial_menu_button_height" + android:layout_marginBottom="24dp" android:background="@drawable/gesture_tutorial_menu_button_background" android:clipToOutline="true" android:backgroundTint="@color/gesture_overview_tutorial_background" app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toTopOf="@id/guideline" app:layout_constraintStart_toEndOf="@id/gesture_tutorial_menu_back_button" app:layout_constraintEnd_toEndOf="parent"> @@ -111,6 +121,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/gesture_tutorial_overview_step_shape" + android:scaleType="fitXY" + android:adjustViewBounds="true" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -142,10 +154,8 @@ style="@style/TextAppearance.GestureTutorial.ButtonLabel" android:id="@+id/gesture_tutorial_menu_done_button" android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:paddingVertical="16dp" - android:paddingHorizontal="26dp" - android:layout_marginVertical="@dimen/gesture_tutorial_menu_done_button_margin" + android:layout_height="40dp" + android:layout_marginVertical="16dp" android:text="@string/gesture_tutorial_action_button_label" android:background="@drawable/gesture_tutorial_action_button_background" android:stateListAnimator="@null" diff --git a/quickstep/res/layout/gesture_tutorial_step_menu.xml b/quickstep/res/layout/gesture_tutorial_step_menu.xml index 2836259e1a..cf1e4d7b9c 100644 --- a/quickstep/res/layout/gesture_tutorial_step_menu.xml +++ b/quickstep/res/layout/gesture_tutorial_step_menu.xml @@ -42,6 +42,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/gesture_tutorial_home_step_shape" + android:scaleType="fitXY" + android:adjustViewBounds="true" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -79,6 +81,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/gesture_tutorial_back_step_shape" + android:scaleType="fitXY" + android:adjustViewBounds="true" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" @@ -116,6 +120,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/gesture_tutorial_overview_step_shape" + android:scaleType="fitXY" + android:adjustViewBounds="true" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -147,9 +153,8 @@ style="@style/TextAppearance.GestureTutorial.ButtonLabel" android:id="@+id/gesture_tutorial_menu_done_button" android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:paddingVertical="16dp" - android:paddingHorizontal="26dp" + android:layout_height="40dp" + android:layout_marginVertical="16dp" android:text="@string/gesture_tutorial_action_button_label" android:background="@drawable/gesture_tutorial_action_button_background" android:stateListAnimator="@null" diff --git a/quickstep/res/values-sw600dp-land/dimens.xml b/quickstep/res/values-sw600dp-land/dimens.xml index 9853140f01..9cb3fecfb4 100644 --- a/quickstep/res/values-sw600dp-land/dimens.xml +++ b/quickstep/res/values-sw600dp-land/dimens.xml @@ -26,6 +26,5 @@ 24dp 40dp 49dp - 16dp diff --git a/quickstep/res/values-sw720dp-land/dimens.xml b/quickstep/res/values-sw720dp-land/dimens.xml index 1d02ab5bc0..4634a2d577 100644 --- a/quickstep/res/values-sw720dp-land/dimens.xml +++ b/quickstep/res/values-sw720dp-land/dimens.xml @@ -21,7 +21,5 @@ 49dp 24dp 21dp - 80dp - 0dp diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml index 959fea7572..3cf6a72df1 100644 --- a/quickstep/res/values/dimens.xml +++ b/quickstep/res/values/dimens.xml @@ -134,7 +134,6 @@ 0dp 0dp 72dp - 0dp 44dp diff --git a/quickstep/src/com/android/quickstep/interaction/GestureSandboxActivity.java b/quickstep/src/com/android/quickstep/interaction/GestureSandboxActivity.java index 1ac07425bd..aeac760025 100644 --- a/quickstep/src/com/android/quickstep/interaction/GestureSandboxActivity.java +++ b/quickstep/src/com/android/quickstep/interaction/GestureSandboxActivity.java @@ -186,7 +186,8 @@ public class GestureSandboxActivity extends FragmentActivity { public void launchTutorialMenu() { mFragment = new MenuFragment(); getSupportFragmentManager().beginTransaction() - .add(R.id.gesture_tutorial_fragment_container, mFragment) + .replace(R.id.gesture_tutorial_fragment_container, mFragment) + .runOnCommit(() -> mFragment.onAttachedToWindow()) .commit(); } diff --git a/quickstep/src/com/android/quickstep/interaction/MenuFragment.java b/quickstep/src/com/android/quickstep/interaction/MenuFragment.java index ccff30d319..46f79b1ce8 100644 --- a/quickstep/src/com/android/quickstep/interaction/MenuFragment.java +++ b/quickstep/src/com/android/quickstep/interaction/MenuFragment.java @@ -19,6 +19,7 @@ import static com.android.quickstep.interaction.GestureSandboxActivity.KEY_GESTU import static com.android.quickstep.interaction.GestureSandboxActivity.KEY_TUTORIAL_TYPE; import static com.android.quickstep.interaction.GestureSandboxActivity.KEY_USE_TUTORIAL_MENU; +import android.graphics.Rect; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; @@ -27,17 +28,33 @@ import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.R; /** Displays the gesture nav tutorial menu. */ public final class MenuFragment extends GestureSandboxFragment { + @NonNull private Rect mInsets = new Rect(); + + @Override + public void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + mInsets = InvariantDeviceProfile.INSTANCE.get(getContext()) + .getDeviceProfile(getContext()).getInsets(); + } + @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View root = inflater.inflate( R.layout.gesture_tutorial_step_menu, container, false); + root.setPadding( + root.getPaddingLeft() + mInsets.left, + root.getPaddingTop() + mInsets.top, + root.getPaddingRight() + mInsets.right, + root.getPaddingBottom() + mInsets.bottom); + root.findViewById(R.id.gesture_tutorial_menu_home_button).setOnClickListener( v -> launchTutorialStep(TutorialController.TutorialType.HOME_NAVIGATION)); root.findViewById(R.id.gesture_tutorial_menu_back_button).setOnClickListener(