Merge "Commit to OtherActivityInputConsumer when swiping up in app" into udc-dev
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 6c08d14..af86ae7 100644
--- a/quickstep/res/layout-land/redesigned_gesture_tutorial_mock_hotseat.xml
+++ b/quickstep/res/layout-land/redesigned_gesture_tutorial_mock_hotseat.xml
@@ -22,49 +22,46 @@
android:paddingVertical="26dp"
android:paddingHorizontal="56dp">
+ <androidx.constraintlayout.helper.widget.Flow
+ android:id="@+id/hotseat_flow"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+
+ app:constraint_referenced_ids=
+ "hotseat_icon_1, hotseat_icon_2, hotseat_icon_3, hotseat_icon_4"
+ app:flow_wrapMode="aligned"
+ app:flow_maxElementsWrap="1"
+ app:flow_verticalStyle="spread_inside"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintBottom_toBottomOf="parent" />
+
<View
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:clipToOutline="true"
-
- app:layout_constraintBottom_toTopOf="@id/hotseat_icon_2"
- app:layout_constraintVertical_chainStyle="spread_inside"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent" />
+ android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_2"
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:clipToOutline="true"
-
- app:layout_constraintBottom_toTopOf="@id/hotseat_icon_3"
- app:layout_constraintTop_toBottomOf="@id/hotseat_icon_1"
- app:layout_constraintStart_toStartOf="parent" />
+ android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_3"
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:clipToOutline="true"
-
- app:layout_constraintBottom_toTopOf="@id/hotseat_icon_4"
- app:layout_constraintTop_toBottomOf="@id/hotseat_icon_2"
- app:layout_constraintStart_toStartOf="parent" />
+ android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_4"
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:clipToOutline="true"
-
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/hotseat_icon_3"
- app:layout_constraintBottom_toBottomOf="parent" />
+ android:clipToOutline="true" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ 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
new file mode 100644
index 0000000..983c15b
--- /dev/null
+++ b/quickstep/res/layout-land/redesigned_gesture_tutorial_tablet_mock_hotseat.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2023 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.
+-->
+<androidx.constraintlayout.widget.ConstraintLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingBottom="32dp"
+ android:paddingStart="@dimen/gesture_tutorial_hotseat_padding_start_end"
+ android:paddingEnd="@dimen/gesture_tutorial_hotseat_padding_start_end">
+
+ <androidx.constraintlayout.helper.widget.Flow
+ android:id="@+id/hotseat_flow"
+ android:layout_width="match_parent"
+ 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"
+ app:flow_horizontalStyle="spread"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
+
+ <View
+ 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:clipToOutline="true" />
+
+ <View
+ 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:clipToOutline="true" />
+
+ <View
+ android:id="@+id/hotseat_icon_2"
+ 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:clipToOutline="true" />
+
+ <View
+ android:id="@+id/hotseat_icon_3"
+ 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:clipToOutline="true" />
+
+ <View
+ android:id="@+id/hotseat_icon_4"
+ 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:clipToOutline="true" />
+
+ <View
+ android:id="@+id/hotseat_icon_5"
+ 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: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
new file mode 100644
index 0000000..b41eb8d
--- /dev/null
+++ b/quickstep/res/layout/redesigned_gesture_tutorial_foldable_mock_hotseat.xml
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2023 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.
+-->
+<androidx.constraintlayout.widget.ConstraintLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingBottom="32dp"
+ android:paddingStart="@dimen/gesture_tutorial_hotseat_padding_start_end"
+ android:paddingEnd="@dimen/gesture_tutorial_hotseat_padding_start_end">
+
+ <View
+ 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:clipToOutline="true"
+
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"/>
+
+ <androidx.constraintlayout.helper.widget.Flow
+ android:id="@+id/hotseat_flow"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ 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"
+ app:flow_horizontalStyle="spread_inside"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@id/hotseat_search_bar" />
+
+ <View
+ 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:clipToOutline="true" />
+
+ <View
+ android:id="@+id/hotseat_icon_2"
+ 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:clipToOutline="true" />
+
+ <View
+ android:id="@+id/hotseat_icon_3"
+ 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:clipToOutline="true" />
+
+ <View
+ android:id="@+id/hotseat_icon_4"
+ 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:clipToOutline="true" />
+
+ <View
+ android:id="@+id/hotseat_icon_5"
+ 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:clipToOutline="true" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
diff --git a/quickstep/res/layout/redesigned_gesture_tutorial_mock_hotseat.xml b/quickstep/res/layout/redesigned_gesture_tutorial_mock_hotseat.xml
index b1c8b31..e93a0fc 100644
--- a/quickstep/res/layout/redesigned_gesture_tutorial_mock_hotseat.xml
+++ b/quickstep/res/layout/redesigned_gesture_tutorial_mock_hotseat.xml
@@ -23,54 +23,45 @@
android:paddingStart="26dp"
android:paddingEnd="26dp">
+ <androidx.constraintlayout.helper.widget.Flow
+ android:id="@+id/hotseat_flow"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+
+ app:constraint_referenced_ids=
+ "hotseat_icon_1, hotseat_icon_2, hotseat_icon_3, hotseat_icon_4"
+ app:flow_horizontalStyle="spread_inside"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
+
<View
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:clipToOutline="true"
-
- app:layout_constraintDimensionRatio="1:1"
- app:layout_constraintEnd_toStartOf="@id/hotseat_icon_2"
- app:layout_constraintHorizontal_chainStyle="spread_inside"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent" />
+ android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_2"
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:clipToOutline="true"
-
- app:layout_constraintDimensionRatio="1:1"
- app:layout_constraintEnd_toStartOf="@id/hotseat_icon_3"
- app:layout_constraintStart_toEndOf="@id/hotseat_icon_1"
- app:layout_constraintTop_toTopOf="parent" />
+ android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_3"
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:clipToOutline="true"
-
- app:layout_constraintDimensionRatio="1:1"
- app:layout_constraintEnd_toStartOf="@id/hotseat_icon_4"
- app:layout_constraintStart_toEndOf="@id/hotseat_icon_2"
- app:layout_constraintTop_toTopOf="parent" />
+ android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_4"
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:clipToOutline="true"
-
- app:layout_constraintDimensionRatio="1:1"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toEndOf="@id/hotseat_icon_3"
- app:layout_constraintTop_toTopOf="parent" />
+ android:clipToOutline="true" />
<View
android:layout_width="0dp"
@@ -81,6 +72,6 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/hotseat_icon_1" />
+ app:layout_constraintTop_toBottomOf="@id/hotseat_flow" />
</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
new file mode 100644
index 0000000..b41eb8d
--- /dev/null
+++ b/quickstep/res/layout/redesigned_gesture_tutorial_tablet_mock_hotseat.xml
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2023 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.
+-->
+<androidx.constraintlayout.widget.ConstraintLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingBottom="32dp"
+ android:paddingStart="@dimen/gesture_tutorial_hotseat_padding_start_end"
+ android:paddingEnd="@dimen/gesture_tutorial_hotseat_padding_start_end">
+
+ <View
+ 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:clipToOutline="true"
+
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"/>
+
+ <androidx.constraintlayout.helper.widget.Flow
+ android:id="@+id/hotseat_flow"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ 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"
+ app:flow_horizontalStyle="spread_inside"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@id/hotseat_search_bar" />
+
+ <View
+ 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:clipToOutline="true" />
+
+ <View
+ android:id="@+id/hotseat_icon_2"
+ 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:clipToOutline="true" />
+
+ <View
+ android:id="@+id/hotseat_icon_3"
+ 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:clipToOutline="true" />
+
+ <View
+ android:id="@+id/hotseat_icon_4"
+ 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:clipToOutline="true" />
+
+ <View
+ android:id="@+id/hotseat_icon_5"
+ 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:clipToOutline="true" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java
index d69769a..f0d28df 100644
--- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java
@@ -71,13 +71,6 @@
} else {
mTranslationShift = TRANSLATION_SHIFT_OPENED;
}
-
- if (FeatureFlags.ENABLE_BACK_SWIPE_LAUNCHER_ANIMATION.get()) {
- mAppsView.getAppsRecyclerViewContainer().setOutlineProvider(mViewOutlineProvider);
- mAppsView.getAppsRecyclerViewContainer().setClipToOutline(true);
- findOnBackInvokedDispatcher().registerOnBackInvokedCallback(
- OnBackInvokedDispatcher.PRIORITY_DEFAULT, this);
- }
}
/** The apps container inside this view. */
@@ -88,9 +81,6 @@
@Override
protected void handleClose(boolean animate) {
handleClose(animate, mAllAppsCallbacks.getCloseDuration());
- if (FeatureFlags.ENABLE_BACK_SWIPE_LAUNCHER_ANIMATION.get()) {
- findOnBackInvokedDispatcher().unregisterOnBackInvokedCallback(this);
- }
}
@Override
@@ -121,12 +111,29 @@
protected void onAttachedToWindow() {
super.onAttachedToWindow();
mActivityContext.addOnDeviceProfileChangeListener(this);
+ if (FeatureFlags.ENABLE_BACK_SWIPE_LAUNCHER_ANIMATION.get()) {
+ mAppsView.getAppsRecyclerViewContainer().setOutlineProvider(mViewOutlineProvider);
+ mAppsView.getAppsRecyclerViewContainer().setClipToOutline(true);
+ OnBackInvokedDispatcher dispatcher = findOnBackInvokedDispatcher();
+ if (dispatcher != null) {
+ dispatcher.registerOnBackInvokedCallback(
+ OnBackInvokedDispatcher.PRIORITY_DEFAULT, this);
+ }
+ }
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
mActivityContext.removeOnDeviceProfileChangeListener(this);
+ if (FeatureFlags.ENABLE_BACK_SWIPE_LAUNCHER_ANIMATION.get()) {
+ mAppsView.getAppsRecyclerViewContainer().setOutlineProvider(null);
+ mAppsView.getAppsRecyclerViewContainer().setClipToOutline(false);
+ OnBackInvokedDispatcher dispatcher = findOnBackInvokedDispatcher();
+ if (dispatcher != null) {
+ dispatcher.unregisterOnBackInvokedCallback(this);
+ }
+ }
}
@Override
diff --git a/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java b/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java
index 3990dad..0eef70e 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java
@@ -402,8 +402,9 @@
PredictedAppIcon icon = (PredictedAppIcon) LayoutInflater.from(parent.getContext())
.inflate(R.layout.predicted_app_icon, parent, false);
icon.applyFromWorkspaceItem(info);
- icon.setOnClickListener(ItemClickHandler.INSTANCE);
- icon.setOnFocusChangeListener(Launcher.getLauncher(parent.getContext()).getFocusHandler());
+ Launcher launcher = Launcher.getLauncher(parent.getContext());
+ icon.setOnClickListener(launcher.getItemOnClickListener());
+ icon.setOnFocusChangeListener(launcher.getFocusHandler());
return icon;
}
diff --git a/quickstep/src/com/android/quickstep/interaction/TutorialController.java b/quickstep/src/com/android/quickstep/interaction/TutorialController.java
index 6f50e3e..67a0756 100644
--- a/quickstep/src/com/android/quickstep/interaction/TutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/TutorialController.java
@@ -233,13 +233,19 @@
@LayoutRes
protected int getMockHotseatResId() {
- return mTutorialFragment.isLargeScreen()
- ? (mTutorialFragment.isFoldable()
+ if (ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()) {
+ return mTutorialFragment.isLargeScreen()
+ ? mTutorialFragment.isFoldable()
+ ? R.layout.redesigned_gesture_tutorial_foldable_mock_hotseat
+ : R.layout.redesigned_gesture_tutorial_tablet_mock_hotseat
+ : R.layout.redesigned_gesture_tutorial_mock_hotseat;
+ } else {
+ return mTutorialFragment.isLargeScreen()
+ ? mTutorialFragment.isFoldable()
? R.layout.gesture_tutorial_foldable_mock_hotseat
- : R.layout.gesture_tutorial_tablet_mock_hotseat)
- : (ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()
- ? R.layout.redesigned_gesture_tutorial_mock_hotseat
- : R.layout.gesture_tutorial_mock_hotseat);
+ : R.layout.gesture_tutorial_tablet_mock_hotseat
+ : R.layout.gesture_tutorial_mock_hotseat;
+ }
}
@LayoutRes
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index cdebe44..492bcf5 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -35,6 +35,12 @@
/**
* Defines a set of flags used to control various launcher behaviors.
*
+ * Please only add flags to your assigned block to prevent merge conflicts. If you do not have
+ * a block, please update the current empty block and add a new empty block below to prevent
+ * merge conflicts with the previous block.
+ * List of blocks can be found:
+ * <a href="http://go/gnl-flags-block-directory">here</a>
+ *
* <p>All the flags should be defined here with appropriate default values.
*/
public final class FeatureFlags {
@@ -74,9 +80,6 @@
* Declare a new ToggleableFlag below. Give it a unique key (e.g. "QSB_ON_FIRST_SCREEN"),
* and set a default value for the flag. This will be the default value on Debug builds.
* <p>
- * Please only add flags to your assigned block to prevent merge conflicts. If you do not have
- * a block, please update the current empty block and add a new empty block below to prevent
- * merge conflicts with the previous block.
*/
// TODO(Block 1): Clean up flags
public static final BooleanFlag ENABLE_ONE_SEARCH_MOTION = getReleaseFlag(270394223,
@@ -179,7 +182,7 @@
// TODO(Block 10): Clean up flags
public static final BooleanFlag ENABLE_BACK_SWIPE_LAUNCHER_ANIMATION = getDebugFlag(270614790,
"ENABLE_BACK_SWIPE_LAUNCHER_ANIMATION", DISABLED,
- "Enables predictive back aniamtion from all apps and widgets to home");
+ "Enables predictive back animation from all apps and widgets to home");
// TODO(Block 11): Clean up flags
public static final BooleanFlag ENABLE_TWO_PANEL_HOME = getDebugFlag(270392643,
@@ -312,6 +315,10 @@
"ENABLE_GRID_ONLY_OVERVIEW", DISABLED,
"Enable a grid-only overview without a focused task.");
+ public static final BooleanFlag ENABLE_CURSOR_HOVER_STATES = getDebugFlag(243191650,
+ "ENABLE_CURSOR_HOVER_STATES", DISABLED,
+ "Enables cursor hover states for certain elements.");
+
// TODO(Block 24): Clean up flags
public static final BooleanFlag ENABLE_NEW_MIGRATION_LOGIC = getDebugFlag(270393455,
"ENABLE_NEW_MIGRATION_LOGIC", ENABLED,
@@ -398,10 +405,6 @@
// TODO(Block 31): Empty block
- public static final BooleanFlag ENABLE_CURSOR_HOVER_STATES = getDebugFlag(243191650,
- "ENABLE_CURSOR_HOVER_STATES", DISABLED,
- "Enables cursor hover states for certain elements.");
-
public static class BooleanFlag {
private final boolean mCurrentValue;
diff --git a/src/com/android/launcher3/folder/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java
index 86f4beb..48239ae 100644
--- a/src/com/android/launcher3/folder/FolderIcon.java
+++ b/src/com/android/launcher3/folder/FolderIcon.java
@@ -205,7 +205,7 @@
lp.topMargin = grid.iconSizePx + grid.iconDrawablePaddingPx;
icon.setTag(folderInfo);
- icon.setOnClickListener(ItemClickHandler.INSTANCE);
+ icon.setOnClickListener(activity.getItemOnClickListener());
icon.mInfo = folderInfo;
icon.mActivity = activity;
icon.mDotRenderer = grid.mDotRendererWorkSpace;
diff --git a/src/com/android/launcher3/folder/FolderPagedView.java b/src/com/android/launcher3/folder/FolderPagedView.java
index d43731b..6ff8ece 100644
--- a/src/com/android/launcher3/folder/FolderPagedView.java
+++ b/src/com/android/launcher3/folder/FolderPagedView.java
@@ -216,7 +216,7 @@
final BubbleTextView textView = mViewCache.getView(
R.layout.folder_application, getContext(), null);
textView.applyFromWorkspaceItem(item);
- textView.setOnClickListener(ItemClickHandler.INSTANCE);
+ textView.setOnClickListener(mFolder.mActivityContext.getItemOnClickListener());
textView.setOnLongClickListener(mFolder);
textView.setOnFocusChangeListener(mFocusIndicatorHelper);
CellLayoutLayoutParams lp = (CellLayoutLayoutParams) textView.getLayoutParams();
diff --git a/src/com/android/launcher3/widget/PendingAppWidgetHostView.java b/src/com/android/launcher3/widget/PendingAppWidgetHostView.java
index 130ee3a..1c88c4a 100644
--- a/src/com/android/launcher3/widget/PendingAppWidgetHostView.java
+++ b/src/com/android/launcher3/widget/PendingAppWidgetHostView.java
@@ -86,7 +86,7 @@
setWillNotDraw(false);
super.updateAppWidget(null);
- setOnClickListener(ItemClickHandler.INSTANCE);
+ setOnClickListener(mLauncher.getItemOnClickListener());
if (info.pendingItemInfo == null) {
info.pendingItemInfo = new PackageItemInfo(info.providerName.getPackageName(),