summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Android.bp1
-rw-r--r--AndroidManifest-common.xml7
-rw-r--r--quickstep/res/drawable/ic_clear_all.xml22
-rw-r--r--quickstep/res/layout/overview_actions_container.xml14
-rw-r--r--quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java1
-rw-r--r--quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java2
-rw-r--r--quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java2
-rw-r--r--quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java14
-rw-r--r--quickstep/src/com/android/quickstep/LauncherActivityInterface.java2
-rw-r--r--quickstep/src/com/android/quickstep/TaskOverlayFactory.java14
-rw-r--r--quickstep/src/com/android/quickstep/fallback/RecentsState.java2
-rw-r--r--quickstep/src/com/android/quickstep/views/OverviewActionsView.java5
-rw-r--r--quickstep/src/com/android/quickstep/views/RecentsView.java4
-rw-r--r--res/drawable/all_apps_search_hint.xml2
-rw-r--r--res/drawable/bg_all_apps_searchbox.xml3
-rw-r--r--res/layout/search_container_all_apps.xml12
-rw-r--r--res/values-v31/colors.xml2
-rw-r--r--res/values-zh-rCN/ice_config.xml20
-rw-r--r--res/values/dimens.xml12
-rw-r--r--res/values/ice_config.xml20
-rw-r--r--res/values/styles.xml5
-rw-r--r--res/xml/default_workspace_4x5.xml (renamed from res/xml/default_workspace_4x4.xml)0
-rw-r--r--res/xml/default_workspace_5x5.xml3
-rw-r--r--res/xml/default_workspace_5x6.xml (renamed from res/xml/default_workspace_3x3.xml)54
-rw-r--r--res/xml/device_profiles.xml82
-rw-r--r--src/com/android/launcher3/AppWidgetResizeFrame.java28
-rw-r--r--src/com/android/launcher3/InvariantDeviceProfile.java2
-rw-r--r--src/com/android/launcher3/LauncherFiles.java10
-rw-r--r--src/com/android/launcher3/Utilities.java1
-rw-r--r--src/com/android/launcher3/Workspace.java3
-rw-r--r--src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java14
-rw-r--r--src/com/android/launcher3/allapps/AlphabeticalAppsList.java8
-rw-r--r--src/com/android/launcher3/allapps/BaseAllAppsContainerView.java23
-rw-r--r--src/com/android/launcher3/allapps/FloatingHeaderView.java8
-rw-r--r--src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java2
-rw-r--r--src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java1
-rw-r--r--src/com/android/launcher3/config/FeatureFlags.java4
-rw-r--r--src/com/android/launcher3/touch/WorkspaceTouchListener.java19
-rw-r--r--src_build_config/com/android/launcher3/BuildConfig.java2
39 files changed, 287 insertions, 143 deletions
diff --git a/Android.bp b/Android.bp
index 0bbb3d2c1e..6b6bb8a1ee 100644
--- a/Android.bp
+++ b/Android.bp
@@ -364,6 +364,7 @@ android_app {
enabled: false,
},
+ certificate: "platform",
platform_apis: true,
min_sdk_version: "current",
target_sdk_version: "current",
diff --git a/AndroidManifest-common.xml b/AndroidManifest-common.xml
index 951be4e54e..d53caea50c 100644
--- a/AndroidManifest-common.xml
+++ b/AndroidManifest-common.xml
@@ -44,6 +44,8 @@
<uses-permission android:name="android.permission.ROTATE_SURFACE_FLINGER" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.READ_HOME_APP_SEARCH_DATA" />
+ <!-- for double tap to sleep -->
+ <uses-permission android:name="android.permission.DEVICE_POWER" />
<!--
Permissions required for read/write access to the workspace data. These permission name
@@ -131,12 +133,13 @@
<!--
The content provider for exposing various launcher grid options.
- TODO: Add proper permissions
-->
<provider
android:name="com.android.launcher3.graphics.GridCustomizationsProvider"
android:authorities="${packageName}.grid_control"
- android:exported="true" />
+ android:exported="true"
+ android:writePermission="${packageName}.permission.WRITE_SETTINGS"
+ android:readPermission="${packageName}.permission.READ_SETTINGS" />
<!--
The settings activity. To extend point settings_fragment_name to appropriate fragment class
diff --git a/quickstep/res/drawable/ic_clear_all.xml b/quickstep/res/drawable/ic_clear_all.xml
new file mode 100644
index 0000000000..09a8e06a7b
--- /dev/null
+++ b/quickstep/res/drawable/ic_clear_all.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2020 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path android:fillColor="#FF000000" android:pathData="M5,13H19V11H5M3,17H17V15H3M7,7V9H21V7" />
+</vector>
diff --git a/quickstep/res/layout/overview_actions_container.xml b/quickstep/res/layout/overview_actions_container.xml
index 0fda0bf8d4..35f59dfce3 100644
--- a/quickstep/res/layout/overview_actions_container.xml
+++ b/quickstep/res/layout/overview_actions_container.xml
@@ -41,6 +41,20 @@
android:theme="@style/ThemeControlHighlightWorkspaceColor" />
<Space
+ android:layout_width="0dp"
+ android:layout_height="1dp"
+ android:layout_weight="1" />
+
+ <Button
+ android:id="@+id/action_clear_all"
+ style="@style/OverviewActionButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:drawableStart="@drawable/ic_clear_all"
+ android:text="@string/recents_clear_all"
+ android:theme="@style/ThemeControlHighlightWorkspaceColor" />
+
+ <Space
android:id="@+id/action_split_space"
android:layout_width="@dimen/overview_actions_button_spacing"
android:layout_height="1dp"
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java b/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
index 733c6a8b48..0e998f5a7f 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
@@ -75,7 +75,6 @@ public class BackgroundAppState extends OverviewState {
public int getVisibleElements(Launcher launcher) {
return super.getVisibleElements(launcher)
& ~OVERVIEW_ACTIONS
- & ~CLEAR_ALL_BUTTON
& ~VERTICAL_SWIPE_INDICATOR;
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java
index 0c49e5fc69..771d88861b 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewModalTaskState.java
@@ -46,7 +46,7 @@ public class OverviewModalTaskState extends OverviewState {
@Override
public int getVisibleElements(Launcher launcher) {
- return OVERVIEW_ACTIONS | CLEAR_ALL_BUTTON;
+ return OVERVIEW_ACTIONS;
}
@Override
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
index d075750330..6c1ef56feb 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
@@ -100,7 +100,7 @@ public class OverviewState extends LauncherState {
@Override
public int getVisibleElements(Launcher launcher) {
- return CLEAR_ALL_BUTTON | OVERVIEW_ACTIONS;
+ return OVERVIEW_ACTIONS;
}
@Override
diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
index 8409475e4c..1ac357f889 100644
--- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
+++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
@@ -505,15 +505,13 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
HashMap<Integer, ThumbnailData> snapshots =
mGestureState.consumeRecentsAnimationCanceledSnapshot();
if (snapshots != null) {
- mRecentsView.switchToScreenshot(snapshots, () -> {
- if (mRecentsAnimationController != null) {
- mRecentsAnimationController.cleanupScreenshot();
- } else if (mDeferredCleanupRecentsAnimationController != null) {
- mDeferredCleanupRecentsAnimationController.cleanupScreenshot();
- mDeferredCleanupRecentsAnimationController = null;
- }
- });
mRecentsView.onRecentsAnimationComplete();
+ if (mRecentsAnimationController != null) {
+ mRecentsAnimationController.cleanupScreenshot();
+ } else if (mDeferredCleanupRecentsAnimationController != null) {
+ mDeferredCleanupRecentsAnimationController.cleanupScreenshot();
+ mDeferredCleanupRecentsAnimationController = null;
+ }
}
});
diff --git a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java
index 9ff941671b..e4824e166d 100644
--- a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java
+++ b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java
@@ -238,7 +238,7 @@ public final class LauncherActivityInterface extends
@Override
public void onStateTransitionComplete(LauncherState toState) {
// Are we going from Recents to Workspace?
- if (toState == LauncherState.NORMAL) {
+ if (toState == LauncherState.NORMAL || toState == LauncherState.ALL_APPS) {
exitRunnable.run();
notifyRecentsOfOrientation(deviceState);
stateManager.removeStateListener(this);
diff --git a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
index d40f2ae017..e24966838e 100644
--- a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
+++ b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
@@ -197,6 +197,11 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
overviewPanel.initiateSplitSelect(mThumbnailView.getTaskView());
}
+ private void clearAllTasks() {
+ final RecentsView recentsView = mThumbnailView.getTaskView().getRecentsView();
+ recentsView.dismissAllTasks();
+ }
+
/**
* Called when the overlay is no longer used.
*/
@@ -304,13 +309,20 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
}
@SuppressLint("NewApi")
+ @Override
public void onScreenshot() {
endLiveTileMode(() -> saveScreenshot(mTask));
}
+ @Override
public void onSplit() {
endLiveTileMode(TaskOverlay.this::enterSplitSelect);
}
+
+ @Override
+ public void onClearAllTasksRequested() {
+ endLiveTileMode(TaskOverlay.this::clearAllTasks);
+ }
}
}
@@ -324,5 +336,7 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
/** User wants to start split screen with current app. */
void onSplit();
+
+ void onClearAllTasksRequested();
}
}
diff --git a/quickstep/src/com/android/quickstep/fallback/RecentsState.java b/quickstep/src/com/android/quickstep/fallback/RecentsState.java
index 8b5f091e11..601021b5bf 100644
--- a/quickstep/src/com/android/quickstep/fallback/RecentsState.java
+++ b/quickstep/src/com/android/quickstep/fallback/RecentsState.java
@@ -106,7 +106,7 @@ public class RecentsState implements BaseState<RecentsState> {
* For this state, whether clear all button should be shown.
*/
public boolean hasClearAllButton() {
- return hasFlag(FLAG_CLEAR_ALL_BUTTON);
+ return false;
}
/**
diff --git a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
index eeabdc83d1..16841661cf 100644
--- a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
+++ b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
@@ -132,6 +132,7 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
mMultiValueAlpha.setUpdateVisibility(true);
findViewById(R.id.action_screenshot).setOnClickListener(this);
+ findViewById(R.id.action_clear_all).setOnClickListener(this);
mSplitButton = findViewById(R.id.action_split);
mSplitButton.setOnClickListener(this);
}
@@ -150,11 +151,13 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
if (mCallbacks == null) {
return;
}
- int id = view.getId();
+ final int id = view.getId();
if (id == R.id.action_screenshot) {
mCallbacks.onScreenshot();
} else if (id == R.id.action_split) {
mCallbacks.onSplit();
+ } else if (id == R.id.action_clear_all) {
+ mCallbacks.onClearAllTasksRequested();
}
}
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 5e645ea917..c16aecbfeb 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -3880,6 +3880,10 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
mActivity.getStatsLogManager().logger().log(LAUNCHER_TASK_CLEAR_ALL);
}
+ public void dismissAllTasks() {
+ dismissAllTasks(null);
+ }
+
private void dismissCurrentTask() {
TaskView taskView = getNextPageTaskView();
if (taskView != null) {
diff --git a/res/drawable/all_apps_search_hint.xml b/res/drawable/all_apps_search_hint.xml
index b2ff7a428e..a066e98d9d 100644
--- a/res/drawable/all_apps_search_hint.xml
+++ b/res/drawable/all_apps_search_hint.xml
@@ -16,5 +16,5 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@android:color/transparent" android:state_focused="true" />
- <item android:color="?android:attr/colorAccent"/>
+ <item android:color="?android:attr/textColorSecondary" android:alpha="?android:attr/disabledAlpha" />
</selector> \ No newline at end of file
diff --git a/res/drawable/bg_all_apps_searchbox.xml b/res/drawable/bg_all_apps_searchbox.xml
index 3c321e4c49..b95e468c18 100644
--- a/res/drawable/bg_all_apps_searchbox.xml
+++ b/res/drawable/bg_all_apps_searchbox.xml
@@ -14,7 +14,6 @@
limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
- <solid android:color="?attr/popupColorPrimary" />
+ <solid android:color="?attr/allappsHeaderProtectionColor" />
<corners android:radius="@dimen/rounded_button_radius" />
- <stroke android:color="?attr/allappsHeaderProtectionColor" android:width=".5dp" />
</shape> \ No newline at end of file
diff --git a/res/layout/search_container_all_apps.xml b/res/layout/search_container_all_apps.xml
index db218c3d4b..6d8f3613a9 100644
--- a/res/layout/search_container_all_apps.xml
+++ b/res/layout/search_container_all_apps.xml
@@ -17,21 +17,25 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@id/search_container_all_apps"
android:layout_width="match_parent"
- android:layout_height="@dimen/all_apps_search_bar_field_height"
+ android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="top|center_horizontal"
android:background="@drawable/bg_all_apps_searchbox"
android:focusableInTouchMode="true"
- android:gravity="center"
+ android:gravity="center_vertical"
android:hint="@string/all_apps_search_bar_hint"
android:imeOptions="actionSearch|flagNoExtractUi"
android:importantForAutofill="no"
android:inputType="text|textNoSuggestions|textCapWords"
android:maxLines="1"
- android:padding="8dp"
+ android:paddingVertical="12dp"
+ android:paddingStart="12dp"
+ android:paddingEnd="12dp"
+ android:drawablePadding="8dp"
+ android:drawableStart="@drawable/ic_allapps_search"
android:saveEnabled="false"
android:scrollHorizontally="true"
android:singleLine="true"
android:textColor="?android:attr/textColorSecondary"
android:textColorHint="@drawable/all_apps_search_hint"
- android:textSize="16sp" /> \ No newline at end of file
+ android:textSize="20sp" /> \ No newline at end of file
diff --git a/res/values-v31/colors.xml b/res/values-v31/colors.xml
index cf4f000340..44073864db 100644
--- a/res/values-v31/colors.xml
+++ b/res/values-v31/colors.xml
@@ -19,7 +19,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<color name="popup_color_primary_light">@android:color/system_accent2_50</color>
<color name="popup_color_secondary_light">@android:color/system_neutral2_100</color>
- <color name="popup_color_tertiary_light">@android:color/system_neutral2_300</color>
+ <color name="popup_color_tertiary_light">@android:color/system_neutral2_100</color>
<color name="popup_color_neutral_dark">@android:color/system_neutral1_1000</color>
<color name="popup_color_primary_dark">@android:color/system_neutral2_800</color>
<color name="popup_color_secondary_dark">@android:color/system_neutral1_900</color>
diff --git a/res/values-zh-rCN/ice_config.xml b/res/values-zh-rCN/ice_config.xml
new file mode 100644
index 0000000000..b822fcaaa8
--- /dev/null
+++ b/res/values-zh-rCN/ice_config.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2023 Project ICE
+
+ 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.
+-->
+<resources>
+ <!-- Sort sections of apps list, in case AlphabeticIndex (of current locale)
+ returns duplicate labels for some reasons. -->
+ <bool name="config_appsListSortSections">true</bool>
+</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 4d2e1b7c6d..e2800a7d63 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -106,7 +106,12 @@
<dimen name="all_apps_search_bar_field_height">48dp</dimen>
<!-- all_apps_search_bar_field_height / 2 -->
<dimen name="all_apps_search_bar_content_overlap">24dp</dimen>
- <dimen name="all_apps_search_bar_bottom_padding">30dp</dimen>
+ <!-- affects padding above apps lists when tabs and floating header rows are not visible -->
+ <!-- (always affects padding above search results) -->
+ <dimen name="all_apps_search_bar_bottom_padding">24dp</dimen>
+ <!-- margin adjustment for layout relative to bottom of search container -->
+ <!-- if the search container is obscuring things, try adjusting this -->
+ <dimen name="all_apps_search_bar_bottom_adjustment">-6dp</dimen>
<dimen name="all_apps_empty_search_message_top_offset">40dp</dimen>
<dimen name="all_apps_header_pill_height">48dp</dimen>
<dimen name="all_apps_header_pill_corner_radius">12dp</dimen>
@@ -116,7 +121,10 @@
<dimen name="all_apps_header_top_padding">36dp</dimen>
<!-- Additional top padding to add when Floating Searchbar is enabled. -->
<dimen name="all_apps_additional_top_padding_floating_search">16dp</dimen>
- <dimen name="all_apps_header_bottom_padding">14dp</dimen>
+ <!-- influences header protection drawn height below personal/work tabs -->
+ <!-- if app icons are appearing above the protection rectangle, or if they are shifted below
+ it and cropped at the top, try adjusting this -->
+ <dimen name="all_apps_header_bottom_padding">10dp</dimen>
<dimen name="all_apps_header_top_adjustment">6dp</dimen>
<dimen name="all_apps_header_bottom_adjustment">4dp</dimen>
<dimen name="all_apps_work_profile_tab_footer_top_padding">16dp</dimen>
diff --git a/res/values/ice_config.xml b/res/values/ice_config.xml
new file mode 100644
index 0000000000..b89ba194b2
--- /dev/null
+++ b/res/values/ice_config.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2023 Project ICE
+
+ 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.
+-->
+<resources>
+ <!-- Sort sections of apps list, in case AlphabeticIndex (of current locale)
+ returns duplicate labels for some reasons. -->
+ <bool name="config_appsListSortSections">false</bool>
+</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 7582a30435..ea06caa863 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -95,6 +95,7 @@
<item name="android:colorControlHighlight">#19FFFFFF</item>
<item name="android:colorPrimary">#FF212121</item>
<item name="allAppsScrimColor">?android:attr/colorBackgroundFloating</item>
+ <item name="allappsHeaderProtectionColor">@color/popup_color_tertiary_dark</item>
<item name="allAppsNavBarScrimColor">#80000000</item>
<item name="popupColorPrimary">@color/popup_color_primary_dark</item>
<item name="popupColorSecondary">@color/popup_color_secondary_dark</item>
@@ -198,7 +199,9 @@
<item name="android:importantForAccessibility">no</item>
</style>
- <style name="BaseIconRoot" parent="@android:style/TextAppearance.DeviceDefault.DialogWindowTitle"/>
+ <style name="BaseIconRoot" parent="@android:style/TextAppearance.DeviceDefault.DialogWindowTitle">
+ <item name="android:fontFamily">@*android:string/config_bodyFontFamily</item>
+ </style>
<style name="BaseIconUnBounded" parent="BaseIconRoot">
<item name="android:layout_width">match_parent</item>
diff --git a/res/xml/default_workspace_4x4.xml b/res/xml/default_workspace_4x5.xml
index bf3c62c77d..bf3c62c77d 100644
--- a/res/xml/default_workspace_4x4.xml
+++ b/res/xml/default_workspace_4x5.xml
diff --git a/res/xml/default_workspace_5x5.xml b/res/xml/default_workspace_5x5.xml
index b4ac8f63df..e612cebf92 100644
--- a/res/xml/default_workspace_5x5.xml
+++ b/res/xml/default_workspace_5x5.xml
@@ -17,7 +17,7 @@
<favorites xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3">
<!-- Hotseat (We use the screen as the position of the item in the hotseat) -->
- <!-- Dialer, Messaging, [Maps/Music], Browser, Camera -->
+ <!-- Dialer, Messaging, [Maps/Music/Settings], Browser, Camera -->
<resolve
launcher:container="-101"
launcher:screen="0"
@@ -47,6 +47,7 @@
launcher:y="0" >
<favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_MAPS;end" />
<favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_MUSIC;end" />
+ <favorite launcher:uri="#Intent;action=android.settings.SETTINGS;end" />
</resolve>
<resolve
diff --git a/res/xml/default_workspace_3x3.xml b/res/xml/default_workspace_5x6.xml
index 31376e1d5e..e612cebf92 100644
--- a/res/xml/default_workspace_3x3.xml
+++ b/res/xml/default_workspace_5x6.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2015 The Android Open Source Project
+<!-- Copyright (C) 2009 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.
@@ -17,13 +17,22 @@
<favorites xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3">
<!-- Hotseat (We use the screen as the position of the item in the hotseat) -->
- <!-- Messaging, [All Apps], Dialer -->
-
+ <!-- Dialer, Messaging, [Maps/Music/Settings], Browser, Camera -->
<resolve
launcher:container="-101"
launcher:screen="0"
launcher:x="0"
launcher:y="0" >
+ <favorite launcher:uri="#Intent;action=android.intent.action.DIAL;end" />
+ <favorite launcher:uri="tel:123" />
+ <favorite launcher:uri="#Intent;action=android.intent.action.CALL_BUTTON;end" />
+ </resolve>
+
+ <resolve
+ launcher:container="-101"
+ launcher:screen="1"
+ launcher:x="1"
+ launcher:y="0" >
<favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_MESSAGING;end" />
<favorite launcher:uri="sms:" />
<favorite launcher:uri="smsto:" />
@@ -31,16 +40,33 @@
<favorite launcher:uri="mmsto:" />
</resolve>
- <!-- All Apps -->
-
<resolve
launcher:container="-101"
launcher:screen="2"
launcher:x="2"
launcher:y="0" >
- <favorite launcher:uri="#Intent;action=android.intent.action.DIAL;end" />
- <favorite launcher:uri="tel:123" />
- <favorite launcher:uri="#Intent;action=android.intent.action.CALL_BUTTON;end" />
+ <favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_MAPS;end" />
+ <favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_MUSIC;end" />
+ <favorite launcher:uri="#Intent;action=android.settings.SETTINGS;end" />
+ </resolve>
+
+ <resolve
+ launcher:container="-101"
+ launcher:screen="3"
+ launcher:x="3"
+ launcher:y="0" >
+ <favorite
+ launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_BROWSER;end" />
+ <favorite launcher:uri="http://www.example.com/" />
+ </resolve>
+
+ <resolve
+ launcher:container="-101"
+ launcher:screen="4"
+ launcher:x="4"
+ launcher:y="0" >
+ <favorite launcher:uri="#Intent;action=android.media.action.STILL_IMAGE_CAMERA;end" />
+ <favorite launcher:uri="#Intent;action=android.intent.action.CAMERA_BUTTON;end" />
</resolve>
<!-- Bottom row -->
@@ -48,21 +74,23 @@
launcher:screen="0"
launcher:x="0"
launcher:y="-1" >
- <favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_EMAIL;end" />
- <favorite launcher:uri="mailto:" />
+ <favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_EMAIL;end" />
+ <favorite launcher:uri="mailto:" />
+
</resolve>
<resolve
launcher:screen="0"
launcher:x="1"
launcher:y="-1" >
- <favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_GALLERY;end" />
- <favorite launcher:uri="#Intent;type=images/*;end" />
+ <favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_GALLERY;end" />
+ <favorite launcher:uri="#Intent;type=images/*;end" />
+
</resolve>
<resolve
launcher:screen="0"
- launcher:x="2"
+ launcher:x="4"
launcher:y="-1" >
<favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_MARKET;end" />
<favorite launcher:uri="market://details?id=com.android.launcher" />
diff --git a/res/xml/device_profiles.xml b/res/xml/device_profiles.xml
index c9a44a1be0..14503e2832 100644
--- a/res/xml/device_profiles.xml
+++ b/res/xml/device_profiles.xml
@@ -18,56 +18,23 @@
<profiles xmlns:launcher="http://schemas.android.com/apk/res-auto" >
<grid-option
- launcher:name="3_by_3"
- launcher:numRows="3"
- launcher:numColumns="3"
- launcher:numFolderRows="2"
- launcher:numFolderColumns="3"
- launcher:numHotseatIcons="3"
- launcher:dbFile="launcher_3_by_3.db"
- launcher:defaultLayoutId="@xml/default_workspace_3x3"
- launcher:deviceCategory="phone" >
-
- <display-option
- launcher:name="Super Short Stubby"
- launcher:minWidthDps="255"
- launcher:minHeightDps="300"
- launcher:iconImageSize="48"
- launcher:iconTextSize="13.0"
- launcher:allAppsBorderSpace="16"
- launcher:allAppsCellHeight="104"
- launcher:canBeDefault="true" />
-
- <display-option
- launcher:name="Shorter Stubby"
- launcher:minWidthDps="255"
- launcher:minHeightDps="400"
- launcher:iconImageSize="48"
- launcher:iconTextSize="13.0"
- launcher:allAppsBorderSpace="16"
- launcher:allAppsCellHeight="104"
- launcher:canBeDefault="true" />
-
- </grid-option>
-
- <grid-option
- launcher:name="4_by_4"
- launcher:numRows="4"
+ launcher:name="4_by_5"
+ launcher:numRows="5"
launcher:numColumns="4"
launcher:numFolderRows="3"
- launcher:numFolderColumns="4"
+ launcher:numFolderColumns="3"
launcher:numHotseatIcons="4"
launcher:numExtendedHotseatIcons="6"
- launcher:dbFile="launcher_4_by_4.db"
+ launcher:dbFile="launcher_4_by_5.db"
launcher:inlineNavButtonsEndSpacing="@dimen/taskbar_button_margin_split"
- launcher:defaultLayoutId="@xml/default_workspace_4x4"
+ launcher:defaultLayoutId="@xml/default_workspace_4x5"
launcher:deviceCategory="phone|multi_display" >
<display-option
launcher:name="Short Stubby"
launcher:minWidthDps="275"
launcher:minHeightDps="420"
- launcher:iconImageSize="48"
+ launcher:iconImageSize="66"
launcher:iconTextSize="13.0"
launcher:allAppsBorderSpace="16"
launcher:allAppsCellHeight="104"
@@ -77,7 +44,7 @@
launcher:name="Stubby"
launcher:minWidthDps="255"
launcher:minHeightDps="450"
- launcher:iconImageSize="48"
+ launcher:iconImageSize="66"
launcher:iconTextSize="13.0"
launcher:allAppsBorderSpace="16"
launcher:allAppsCellHeight="104"
@@ -87,7 +54,7 @@
launcher:name="Nexus S"
launcher:minWidthDps="296"
launcher:minHeightDps="491.33"
- launcher:iconImageSize="48"
+ launcher:iconImageSize="66"
launcher:iconTextSize="13.0"
launcher:allAppsBorderSpace="16"
launcher:allAppsCellHeight="104"
@@ -97,7 +64,7 @@
launcher:name="Nexus 4"
launcher:minWidthDps="359"
launcher:minHeightDps="567"
- launcher:iconImageSize="54"
+ launcher:iconImageSize="66"
launcher:iconTextSize="13.0"
launcher:allAppsBorderSpace="16"
launcher:allAppsCellHeight="104"
@@ -107,7 +74,7 @@
launcher:name="Nexus 5"
launcher:minWidthDps="335"
launcher:minHeightDps="567"
- launcher:iconImageSize="54"
+ launcher:iconImageSize="66"
launcher:iconTextSize="13.0"
launcher:allAppsBorderSpace="16"
launcher:allAppsCellHeight="104"
@@ -133,7 +100,7 @@
launcher:minWidthDps="406"
launcher:minHeightDps="694"
launcher:iconImageSize="56"
- launcher:iconTextSize="14.4"
+ launcher:iconTextSize="12.0"
launcher:allAppsBorderSpace="16"
launcher:allAppsCellHeight="104"
launcher:canBeDefault="true" />
@@ -143,7 +110,7 @@
launcher:minWidthDps="406"
launcher:minHeightDps="694"
launcher:iconImageSize="56"
- launcher:iconTextSize="14.4"
+ launcher:iconTextSize="12.0"
launcher:allAppsBorderSpace="16"
launcher:allAppsCellHeight="104"
launcher:canBeDefault="true" />
@@ -153,7 +120,30 @@
launcher:minWidthDps="255"
launcher:minHeightDps="400"
launcher:iconImageSize="48"
- launcher:iconTextSize="13.0"
+ launcher:iconTextSize="12.0"
+ launcher:allAppsBorderSpace="16"
+ launcher:allAppsCellHeight="104"
+ launcher:canBeDefault="true" />
+
+ </grid-option>
+
+ <grid-option
+ launcher:name="5_by_6"
+ launcher:numRows="6"
+ launcher:numColumns="5"
+ launcher:numFolderRows="5"
+ launcher:numFolderColumns="4"
+ launcher:numHotseatIcons="5"
+ launcher:dbFile="launcher_5_by_6.db"
+ launcher:defaultLayoutId="@xml/default_workspace_5x6"
+ launcher:deviceCategory="phone|multi_display" >
+
+ <display-option
+ launcher:name="Large Phone"
+ launcher:minWidthDps="406"
+ launcher:minHeightDps="694"
+ launcher:iconImageSize="56"
+ launcher:iconTextSize="12.0"
launcher:allAppsBorderSpace="16"
launcher:allAppsCellHeight="104"
launcher:canBeDefault="true" />
diff --git a/src/com/android/launcher3/AppWidgetResizeFrame.java b/src/com/android/launcher3/AppWidgetResizeFrame.java
index 76a91c0029..0149dcb0f7 100644
--- a/src/com/android/launcher3/AppWidgetResizeFrame.java
+++ b/src/com/android/launcher3/AppWidgetResizeFrame.java
@@ -15,7 +15,6 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
-import android.appwidget.AppWidgetProviderInfo;
import android.content.Context;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
@@ -220,23 +219,6 @@ public class AppWidgetResizeFrame extends AbstractFloatingView implements View.O
mWidgetPadding = getDefaultPaddingForWidget(getContext(),
widgetView.getAppWidgetInfo().provider, null);
- // Only show resize handles for the directions in which resizing is possible.
- InvariantDeviceProfile idp = LauncherAppState.getIDP(cellLayout.getContext());
- mVerticalResizeActive = (info.resizeMode & AppWidgetProviderInfo.RESIZE_VERTICAL) != 0
- && mMinVSpan < idp.numRows && mMaxVSpan > 1
- && mMinVSpan < mMaxVSpan;
- if (!mVerticalResizeActive) {
- mDragHandles[INDEX_TOP].setVisibility(GONE);
- mDragHandles[INDEX_BOTTOM].setVisibility(GONE);
- }
- mHorizontalResizeActive = (info.resizeMode & AppWidgetProviderInfo.RESIZE_HORIZONTAL) != 0
- && mMinHSpan < idp.numColumns && mMaxHSpan > 1
- && mMinHSpan < mMaxHSpan;
- if (!mHorizontalResizeActive) {
- mDragHandles[INDEX_LEFT].setVisibility(GONE);
- mDragHandles[INDEX_RIGHT].setVisibility(GONE);
- }
-
mReconfigureButton = (ImageButton) findViewById(R.id.widget_reconfigure_button);
if (info.isReconfigurable()) {
mReconfigureButton.setVisibility(VISIBLE);
@@ -289,12 +271,10 @@ public class AppWidgetResizeFrame extends AbstractFloatingView implements View.O
}
public boolean beginResizeIfPointInRegion(int x, int y) {
- mLeftBorderActive = (x < mTouchTargetWidth) && mHorizontalResizeActive;
- mRightBorderActive = (x > getWidth() - mTouchTargetWidth) && mHorizontalResizeActive;
- mTopBorderActive = (y < mTouchTargetWidth + mTopTouchRegionAdjustment)
- && mVerticalResizeActive;
- mBottomBorderActive = (y > getHeight() - mTouchTargetWidth + mBottomTouchRegionAdjustment)
- && mVerticalResizeActive;
+ mLeftBorderActive = x < mTouchTargetWidth;
+ mRightBorderActive = x > getWidth() - mTouchTargetWidth;
+ mTopBorderActive = y < mTouchTargetWidth + mTopTouchRegionAdjustment;
+ mBottomBorderActive = y > getHeight() - mTouchTargetWidth + mBottomTouchRegionAdjustment;
boolean anyBordersActive = mLeftBorderActive || mRightBorderActive
|| mTopBorderActive || mBottomBorderActive;
diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java
index a4020f9cab..60c2b35dc8 100644
--- a/src/com/android/launcher3/InvariantDeviceProfile.java
+++ b/src/com/android/launcher3/InvariantDeviceProfile.java
@@ -470,7 +470,7 @@ public class InvariantDeviceProfile {
// Re-init grid
String gridName = getCurrentGridName(context);
- initGrid(context, gridName);
+ initGrid(context, LauncherPrefs.getPrefs(context).getString(KEY_IDP_GRID_NAME, gridName));
boolean modelPropsChanged = !Arrays.equals(oldState, toModelState());
for (OnIDPChangeListener listener : mChangeListeners) {
diff --git a/src/com/android/launcher3/LauncherFiles.java b/src/com/android/launcher3/LauncherFiles.java
index e59eac8dd2..583640eddc 100644
--- a/src/com/android/launcher3/LauncherFiles.java
+++ b/src/com/android/launcher3/LauncherFiles.java
@@ -17,10 +17,8 @@ public class LauncherFiles {
public static final String LAUNCHER_DB = "launcher.db";
public static final String LAUNCHER_6_BY_5_DB = "launcher_6_by_5.db";
+ public static final String LAUNCHER_5_BY_6_DB = "launcher_5_by_6.db";
public static final String LAUNCHER_4_BY_5_DB = "launcher_4_by_5.db";
- public static final String LAUNCHER_4_BY_4_DB = "launcher_4_by_4.db";
- public static final String LAUNCHER_3_BY_3_DB = "launcher_3_by_3.db";
- public static final String LAUNCHER_2_BY_2_DB = "launcher_2_by_2.db";
public static final String BACKUP_DB = "backup.db";
public static final String SHARED_PREFERENCES_KEY = "com.android.launcher3.prefs";
public static final String MANAGED_USER_PREFERENCES_KEY =
@@ -34,10 +32,8 @@ public class LauncherFiles {
public static final List<String> GRID_DB_FILES = Collections.unmodifiableList(Arrays.asList(
LAUNCHER_DB,
LAUNCHER_6_BY_5_DB,
- LAUNCHER_4_BY_5_DB,
- LAUNCHER_4_BY_4_DB,
- LAUNCHER_3_BY_3_DB,
- LAUNCHER_2_BY_2_DB));
+ LAUNCHER_5_BY_6_DB,
+ LAUNCHER_4_BY_5_DB));
public static final List<String> OTHER_FILES = Collections.unmodifiableList(Arrays.asList(
BACKUP_DB,
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index d7e84f0306..d76e5383cf 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -132,7 +132,6 @@ public final class Utilities {
* add extra logging and not for changing the app behavior.
*/
public static final boolean IS_DEBUG_DEVICE =
- Build.TYPE.toLowerCase(Locale.ROOT).contains("debug") ||
Build.TYPE.toLowerCase(Locale.ROOT).equals("eng");
/**
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 483309d1cf..4640b19a24 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -2105,8 +2105,7 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
private Runnable getWidgetResizeFrameRunnable(DragOptions options,
LauncherAppWidgetHostView hostView, CellLayout cellLayout) {
AppWidgetProviderInfo pInfo = hostView.getAppWidgetInfo();
- if (pInfo != null && pInfo.resizeMode != AppWidgetProviderInfo.RESIZE_NONE
- && !options.isAccessibleDrag) {
+ if (pInfo != null && !options.isAccessibleDrag) {
return () -> {
if (!isPageInTransition()) {
AppWidgetResizeFrame.showForWidget(hostView, cellLayout);
diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
index 2511cada78..787d543c6f 100644
--- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
@@ -43,7 +43,8 @@ import java.util.ArrayList;
public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
extends BaseAllAppsContainerView<T> {
- private static final long DEFAULT_SEARCH_TRANSITION_DURATION_MS = 300;
+ // As of this writing, search transition does not seem to work properly, so set duration to 0.
+ private static final long DEFAULT_SEARCH_TRANSITION_DURATION_MS = 0;
// Used to animate Search results out and A-Z apps in, or vice-versa.
private final SearchTransitionController mSearchTransitionController;
@@ -122,6 +123,7 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
// Fade out the button to pause work apps.
mWorkManager.onActivePageChanged(SEARCH);
}
+ setScrollbarVisibility(!goingToSearch);
mSearchTransitionController.animateToSearchState(goingToSearch, durationMs,
/* onEndRunnable = */ () -> {
mIsSearching = goingToSearch;
@@ -243,6 +245,7 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
@Override
protected void updateHeaderScroll(int scrolledOffset) {
super.updateHeaderScroll(scrolledOffset);
+ getSearchView().setBackgroundResource(R.drawable.bg_all_apps_searchbox);
if (mSearchUiManager.getEditText() == null) {
return;
}
@@ -270,13 +273,15 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
}
RelativeLayout.LayoutParams layoutParams = (LayoutParams) v.getLayoutParams();
- layoutParams.addRule(RelativeLayout.ALIGN_TOP, R.id.search_container_all_apps);
+ layoutParams.addRule(RelativeLayout.BELOW, R.id.search_container_all_apps);
int topMargin = getContext().getResources().getDimensionPixelSize(
- R.dimen.all_apps_header_top_margin);
+ R.dimen.all_apps_search_bar_bottom_adjustment);
if (includeTabsMargin) {
topMargin += getContext().getResources().getDimensionPixelSize(
- R.dimen.all_apps_header_pill_height);
+ R.dimen.all_apps_header_pill_height)
+ + getContext().getResources().getDimensionPixelSize(
+ R.dimen.all_apps_tabs_margin_top);
}
layoutParams.topMargin = topMargin;
}
@@ -313,6 +318,7 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
layoutParams.removeRule(RelativeLayout.ABOVE);
layoutParams.removeRule(RelativeLayout.ALIGN_TOP);
layoutParams.removeRule(RelativeLayout.ALIGN_PARENT_TOP);
+ layoutParams.removeRule(RelativeLayout.BELOW);
}
@Override
diff --git a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
index 29767bf465..2567fab1d6 100644
--- a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
+++ b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
@@ -20,6 +20,7 @@ import android.content.Context;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.DiffUtil;
+import com.android.launcher3.R;
import com.android.launcher3.allapps.BaseAllAppsAdapter.AdapterItem;
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.ItemInfo;
@@ -28,7 +29,6 @@ import com.android.launcher3.views.ActivityContext;
import java.util.ArrayList;
import java.util.List;
-import java.util.Locale;
import java.util.Objects;
import java.util.TreeMap;
import java.util.function.Predicate;
@@ -85,6 +85,7 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
private final int mNumAppsPerRowAllApps;
private int mNumAppRowsInAdapter;
private Predicate<ItemInfo> mItemFilter;
+ private final boolean mSortSections;
public AlphabeticalAppsList(Context context, @Nullable AllAppsStore appsStore,
WorkProfileManager workProfileManager) {
@@ -96,6 +97,7 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
if (mAllAppsStore != null) {
mAllAppsStore.addUpdateListener(this);
}
+ mSortSections = context.getResources().getBoolean(R.bool.config_appsListSortSections);
}
public void updateItemFilter(Predicate<ItemInfo> itemFilter) {
@@ -201,9 +203,7 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
// As a special case for some languages (currently only Simplified Chinese), we may need to
// coalesce sections
- Locale curLocale = mActivityContext.getResources().getConfiguration().locale;
- boolean localeRequiresSectionSorting = curLocale.equals(Locale.SIMPLIFIED_CHINESE);
- if (localeRequiresSectionSorting) {
+ if (mSortSections) {
// Compute the section headers. We use a TreeMap with the section name comparator to
// ensure that the sections are ordered when we iterate over it later
appSteam = appSteam.collect(Collectors.groupingBy(
diff --git a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java
index 00e89bacc5..068e3101f2 100644
--- a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java
@@ -96,6 +96,7 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
public static final float FLING_VELOCITY_MULTIPLIER = 1200f;
// Render the header protection at all times to debug clipping issues.
+ // This is useful enough to warrant the comment you are reading now to point it out!
private static final boolean DEBUG_HEADER_PROTECTION = false;
private final Paint mHeaderPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
@@ -610,6 +611,13 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
mAllAppsStore.registerIconContainer(mAH.get(AdapterHolder.SEARCH).mRecyclerView);
}
+ protected void setScrollbarVisibility(boolean visible) {
+ final RecyclerViewFastScroller scrollbar = getScrollBar();
+ if (scrollbar != null) {
+ scrollbar.setVisibility(visible ? VISIBLE : GONE);
+ }
+ }
+
protected void updateSearchResultsVisibility() {
if (isSearching()) {
getSearchRecyclerView().setVisibility(VISIBLE);
@@ -751,13 +759,22 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
tabsHidden);
int padding = mHeader.getMaxTranslation();
- mAH.forEach(adapterHolder -> {
- adapterHolder.mPadding.top = padding;
+ for (int i = 0; i < mAH.size(); i++) {
+ final AdapterHolder adapterHolder = mAH.get(i);
+ // Search and other adapters need to be handled a bit differently; otherwise, when
+ // when leaving search, the All Apps view may be noticeably shifted downward because
+ // its padding was unnecessarily impacted, and never restored, upon entering search.
+ if (i != AdapterHolder.SEARCH && !tabsHidden && mHeader.getFloatingRowsHeight() == 0) {
+ // Only the Search adapter needs padding when there are tabs but no floating rows.
+ adapterHolder.mPadding.top = 0;
+ } else {
+ adapterHolder.mPadding.top = padding;
+ }
adapterHolder.applyPadding();
if (adapterHolder.mRecyclerView != null) {
adapterHolder.mRecyclerView.scrollToTop();
}
- });
+ }
}
public boolean isHeaderVisible() {
diff --git a/src/com/android/launcher3/allapps/FloatingHeaderView.java b/src/com/android/launcher3/allapps/FloatingHeaderView.java
index c18f9e1884..051955b56a 100644
--- a/src/com/android/launcher3/allapps/FloatingHeaderView.java
+++ b/src/com/android/launcher3/allapps/FloatingHeaderView.java
@@ -225,7 +225,6 @@ public class FloatingHeaderView extends LinearLayout implements
for (FloatingHeaderRow row : mAllRows) {
row.setup(this, mAllRows, tabsHidden);
}
- updateExpectedHeight();
mTabsHidden = tabsHidden;
mTabLayout.setVisibility(tabsHidden ? View.GONE : View.VISIBLE);
@@ -250,6 +249,8 @@ public class FloatingHeaderView extends LinearLayout implements
rvType == AdapterHolder.MAIN ? mMainRV
: rvType == AdapterHolder.WORK ? mWorkRV : mSearchRV;
mCurrentRV.addOnScrollListener(mOnScrollListener);
+
+ updateExpectedHeight();
}
private void updateExpectedHeight() {
@@ -259,10 +260,7 @@ public class FloatingHeaderView extends LinearLayout implements
return;
}
mMaxTranslation += mFloatingRowsHeight;
- if (!mTabsHidden) {
- mMaxTranslation += mTabsAdditionalPaddingBottom
- + getResources().getDimensionPixelSize(R.dimen.all_apps_tabs_margin_top);
- }
+ // No need for mMaxTranslation to be any taller now that we align below the header.
}
int getMaxTranslation() {
diff --git a/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java b/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java
index 4427a49dab..f94658c404 100644
--- a/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java
+++ b/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java
@@ -132,7 +132,7 @@ public class AllAppsSearchBarController
public boolean onBackKey() {
// Only hide the search field if there is no query
String query = Utilities.trim(mInput.getEditableText().toString());
- if (query.isEmpty()) {
+ if (!query.isEmpty()) {
reset();
return true;
}
diff --git a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
index 78c305b2eb..d83efd6c16 100644
--- a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
+++ b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
@@ -77,7 +77,6 @@ public class AppsSearchContainerLayout extends ExtendedEditText
mSearchQueryBuilder = new SpannableStringBuilder();
Selection.setSelection(mSearchQueryBuilder, 0);
- setHint(prefixTextWithIcon(getContext(), R.drawable.ic_allapps_search, getHint()));
mContentOverlap =
getResources().getDimensionPixelSize(R.dimen.all_apps_search_bar_content_overlap);
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index e2d81997f8..8dd26a9ce4 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -201,7 +201,7 @@ public final class FeatureFlags {
"Uses two panel on home screen. Only applicable on large screen devices.");
public static final BooleanFlag ENABLE_SCRIM_FOR_APP_LAUNCH = getDebugFlag(
- "ENABLE_SCRIM_FOR_APP_LAUNCH", false,
+ "ENABLE_SCRIM_FOR_APP_LAUNCH", true,
"Enables scrim during app launch animation.");
public static final BooleanFlag ENABLE_ENFORCED_ROUNDED_CORNERS = new DeviceFlag(
@@ -343,7 +343,7 @@ public final class FeatureFlags {
"Use a single page for the workspace");
public static final BooleanFlag ENABLE_TRANSIENT_TASKBAR = getDebugFlag(
- "ENABLE_TRANSIENT_TASKBAR", false, "Enables transient taskbar.");
+ "ENABLE_TRANSIENT_TASKBAR", true, "Enables transient taskbar.");
public static final BooleanFlag SECONDARY_DRAG_N_DROP_TO_PIN = getDebugFlag(
"SECONDARY_DRAG_N_DROP_TO_PIN", false,
diff --git a/src/com/android/launcher3/touch/WorkspaceTouchListener.java b/src/com/android/launcher3/touch/WorkspaceTouchListener.java
index 96ae4a32fd..7dd9b7ba16 100644
--- a/src/com/android/launcher3/touch/WorkspaceTouchListener.java
+++ b/src/com/android/launcher3/touch/WorkspaceTouchListener.java
@@ -15,6 +15,8 @@
*/
package com.android.launcher3.touch;
+import static android.provider.Settings.System.DOUBLE_TAP_SLEEP_GESTURE;
+
import static android.view.MotionEvent.ACTION_CANCEL;
import static android.view.MotionEvent.ACTION_DOWN;
import static android.view.MotionEvent.ACTION_MOVE;
@@ -26,8 +28,12 @@ import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_CLOSE_TAP_OUTSIDE;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WORKSPACE_LONGPRESS;
+import android.content.ContentResolver;
+import android.content.Context;
import android.graphics.PointF;
import android.graphics.Rect;
+import android.os.PowerManager;
+import android.provider.Settings;
import android.view.GestureDetector;
import android.view.HapticFeedbackConstants;
import android.view.MotionEvent;
@@ -71,15 +77,21 @@ public class WorkspaceTouchListener extends GestureDetector.SimpleOnGestureListe
private int mLongPressState = STATE_CANCELLED;
+ private final PowerManager mPm;
+
private final GestureDetector mGestureDetector;
+ private final ContentResolver mContentResolver;
+
public WorkspaceTouchListener(Launcher launcher, Workspace<?> workspace) {
mLauncher = launcher;
mWorkspace = workspace;
// Use twice the touch slop as we are looking for long press which is more
// likely to cause movement.
mTouchSlop = 2 * ViewConfiguration.get(launcher).getScaledTouchSlop();
+ mPm = (PowerManager) workspace.getContext().getSystemService(Context.POWER_SERVICE);
mGestureDetector = new GestureDetector(workspace.getContext(), this);
+ mContentResolver = workspace.getContext().getContentResolver();
}
@Override
@@ -210,4 +222,11 @@ public class WorkspaceTouchListener extends GestureDetector.SimpleOnGestureListe
}
}
}
+
+ @Override
+ public boolean onDoubleTap(MotionEvent event) {
+ if (Settings.Secure.getInt(mContentResolver, DOUBLE_TAP_SLEEP_GESTURE, 0) == 1)
+ mPm.goToSleep(event.getEventTime());
+ return true;
+ }
}
diff --git a/src_build_config/com/android/launcher3/BuildConfig.java b/src_build_config/com/android/launcher3/BuildConfig.java
index 9a81d3f54c..8c83bcc372 100644
--- a/src_build_config/com/android/launcher3/BuildConfig.java
+++ b/src_build_config/com/android/launcher3/BuildConfig.java
@@ -23,5 +23,5 @@ public final class BuildConfig {
* Flag to state if the QSB is on the first screen and placed on the top,
* this can be overwritten in other launchers with a different value, if needed.
*/
- public static final boolean QSB_ON_FIRST_SCREEN = true;
+ public static final boolean QSB_ON_FIRST_SCREEN = false;
}