summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Android.bp8
-rw-r--r--Android.mk1
-rw-r--r--AndroidManifest-common.xml9
-rw-r--r--AndroidManifest.xml2
-rw-r--r--libs/libGoogleFeed.jarbin0 -> 50896 bytes
-rw-r--r--quickstep/AndroidManifest-launcher.xml2
-rw-r--r--quickstep/res/drawable/ic_clear_all.xml22
-rw-r--r--quickstep/res/drawable/task_menu_item_bg.xml15
-rw-r--r--quickstep/res/layout/overview_actions_container.xml14
-rw-r--r--quickstep/src/com/android/launcher3/CustomLauncher.java29
-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.java8
-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.java11
-rw-r--r--res/color-night-v31/all_apps_tab_text.xml6
-rw-r--r--res/color-night-v31/all_apps_tabs_background.xml18
-rw-r--r--res/color-v31/all_apps_tab_text.xml6
-rw-r--r--res/drawable/all_apps_search_hint.xml4
-rw-r--r--res/drawable/bg_all_apps_searchbox.xml6
-rw-r--r--res/layout/search_container_all_apps.xml14
-rw-r--r--res/layout/secondary_launcher.xml16
-rw-r--r--res/values-v31/colors.xml2
-rw-r--r--res/values/config.xml2
-rw-r--r--res/values/ice_strings.xml27
-rw-r--r--res/values/styles.xml5
-rw-r--r--res/xml/default_workspace_4x5.xml (renamed from res/xml/default_workspace_4x4.xml)10
-rw-r--r--res/xml/default_workspace_5x5.xml13
-rw-r--r--res/xml/default_workspace_5x6.xml (renamed from res/xml/default_workspace_3x3.xml)64
-rw-r--r--res/xml/device_profiles.xml70
-rw-r--r--res/xml/launcher_preferences.xml6
-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/OverlayCallbackImpl.java185
-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/AllAppsContainerView.java1
-rw-r--r--src/com/android/launcher3/allapps/FloatingHeaderView.java4
-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/settings/SettingsActivity.java28
-rw-r--r--src/com/android/launcher3/touch/WorkspaceTouchListener.java19
48 files changed, 564 insertions, 142 deletions
diff --git a/Android.bp b/Android.bp
index bab994add5..817d2120da 100644
--- a/Android.bp
+++ b/Android.bp
@@ -100,6 +100,13 @@ java_library {
min_sdk_version: min_launcher3_sdk_version,
}
+java_import {
+ name: "libGoogleFeed",
+ jars: [
+ "libs/libGoogleFeed.jar",
+ ],
+}
+
// Library with all the dependencies for building Launcher3
android_library {
name: "Launcher3ResLib",
@@ -117,6 +124,7 @@ android_library {
"androidx.cardview_cardview",
"com.google.android.material_material",
"iconloader_base",
+ "libGoogleFeed",
],
manifest: "AndroidManifest-common.xml",
sdk_version: "current",
diff --git a/Android.mk b/Android.mk
index 8105d58b4b..40f3874ea3 100644
--- a/Android.mk
+++ b/Android.mk
@@ -69,6 +69,7 @@ else
LOCAL_MIN_SDK_VERSION := 26
endif
LOCAL_PACKAGE_NAME := Launcher3QuickStep
+LOCAL_CERTIFICATE := platform
LOCAL_PRIVILEGED_MODULE := true
LOCAL_SYSTEM_EXT_MODULE := true
LOCAL_OVERRIDES_PACKAGES := Home Launcher2 Launcher3
diff --git a/AndroidManifest-common.xml b/AndroidManifest-common.xml
index eee6db5ec0..364e52a24b 100644
--- a/AndroidManifest-common.xml
+++ b/AndroidManifest-common.xml
@@ -41,7 +41,9 @@
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<!-- for rotating surface by arbitrary degree -->
<uses-permission android:name="android.permission.ROTATE_SURFACE_FLINGER" />
-
+ <!-- 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
should not conflict with that defined in other apps, as such an app should embed its package
@@ -130,12 +132,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/AndroidManifest.xml b/AndroidManifest.xml
index b838a516be..1309b81ae2 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -44,7 +44,7 @@
attributes and intent filters the same
-->
<activity
- android:name="com.android.launcher3.Launcher"
+ android:name="com.android.launcher3.CustomLauncher"
android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
diff --git a/libs/libGoogleFeed.jar b/libs/libGoogleFeed.jar
new file mode 100644
index 0000000000..158b76de40
--- /dev/null
+++ b/libs/libGoogleFeed.jar
Binary files differ
diff --git a/quickstep/AndroidManifest-launcher.xml b/quickstep/AndroidManifest-launcher.xml
index 53910e344b..f249276400 100644
--- a/quickstep/AndroidManifest-launcher.xml
+++ b/quickstep/AndroidManifest-launcher.xml
@@ -43,7 +43,7 @@
attributes and intent filters the same
-->
<activity
- android:name="com.android.launcher3.uioverrides.QuickstepLauncher"
+ android:name="com.android.launcher3.CustomLauncher"
android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
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/drawable/task_menu_item_bg.xml b/quickstep/res/drawable/task_menu_item_bg.xml
index 16c13ebebc..bd863f2bc4 100644
--- a/quickstep/res/drawable/task_menu_item_bg.xml
+++ b/quickstep/res/drawable/task_menu_item_bg.xml
@@ -15,8 +15,13 @@
limitations under the License.
-->
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
- <solid android:color="?androidprv:attr/colorSurface" />
- <corners android:radius="@dimen/task_menu_item_corner_radius" />
-</shape>
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
+ android:color="?android:attr/colorControlHighlight">
+ <item>
+ <shape>
+ <solid android:color="?androidprv:attr/colorSurface" />
+ <corners android:radius="@dimen/task_menu_item_corner_radius" />
+ </shape>
+ </item>
+</ripple>
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/CustomLauncher.java b/quickstep/src/com/android/launcher3/CustomLauncher.java
new file mode 100644
index 0000000000..1e41f42436
--- /dev/null
+++ b/quickstep/src/com/android/launcher3/CustomLauncher.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2019 Paranoid Android
+ *
+ * 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.launcher3;
+
+import com.android.launcher3.uioverrides.QuickstepLauncher;
+import com.android.systemui.plugins.shared.LauncherOverlayManager;
+
+public class CustomLauncher extends QuickstepLauncher {
+
+ @Override
+ protected LauncherOverlayManager getDefaultOverlay() {
+ return new OverlayCallbackImpl(this);
+ }
+
+}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java b/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
index b7330072d4..3e737bb6f3 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
@@ -73,7 +73,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 6f084a1f97..8ffdf176c1 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 08d0a80f03..56cbefc427 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
@@ -88,7 +88,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 9f1e47f15a..d170f75b9a 100644
--- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
+++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
@@ -424,12 +424,10 @@ 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();
- }
- });
mRecentsView.onRecentsAnimationComplete();
+ if (mRecentsAnimationController != null) {
+ mRecentsAnimationController.cleanupScreenshot();
+ }
}
});
diff --git a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java
index 719c2ae78c..8875f6d942 100644
--- a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java
+++ b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java
@@ -234,7 +234,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 276e1c2a6f..208ba7efc9 100644
--- a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
+++ b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
@@ -249,6 +249,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.
*/
@@ -343,13 +348,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);
+ }
}
}
@@ -363,5 +375,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 15feb18367..dcd172170b 100644
--- a/quickstep/src/com/android/quickstep/fallback/RecentsState.java
+++ b/quickstep/src/com/android/quickstep/fallback/RecentsState.java
@@ -102,7 +102,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 029482892d..783f677f5d 100644
--- a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
+++ b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
@@ -115,6 +115,7 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
protected void onFinishInflate() {
super.onFinishInflate();
findViewById(R.id.action_screenshot).setOnClickListener(this);
+ findViewById(R.id.action_clear_all).setOnClickListener(this);
mSplitButton = findViewById(R.id.action_split);
mSplitButton.setOnClickListener(this);
@@ -134,11 +135,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 02261af499..c8bbf43619 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -3426,6 +3426,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) {
@@ -3962,6 +3966,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
mSplitSelectStateController.getActiveSplitStagePosition(), firstTaskEndingBounds,
secondTaskEndingBounds);
+ if (mFirstFloatingTaskView == null) return;
mFirstFloatingTaskView.getBoundsOnScreen(firstTaskStartingBounds);
mFirstFloatingTaskView.addAnimation(pendingAnimation,
new RectF(firstTaskStartingBounds), firstTaskEndingBounds, mFirstFloatingTaskView,
@@ -4035,8 +4040,10 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
mSplitSelectStateController.getActiveSplitStagePosition(), mTempRect);
mTempRectF.set(mTempRect);
// TODO(194414938) set correct corner radius
- mFirstFloatingTaskView.updateOrientationHandler(mOrientationHandler);
- mFirstFloatingTaskView.update(mTempRectF, /*progress=*/1f, /*windowRadius=*/0f);
+ if (mFirstFloatingTaskView != null) {
+ mFirstFloatingTaskView.updateOrientationHandler(mOrientationHandler);
+ mFirstFloatingTaskView.update(mTempRectF, /*progress=*/1f, /*windowRadius=*/0f);
+ }
PagedOrientationHandler orientationHandler = getPagedOrientationHandler();
Pair<FloatProperty, FloatProperty> taskViewsFloat =
diff --git a/res/color-night-v31/all_apps_tab_text.xml b/res/color-night-v31/all_apps_tab_text.xml
index 83237b49e5..eaac621cfc 100644
--- a/res/color-night-v31/all_apps_tab_text.xml
+++ b/res/color-night-v31/all_apps_tab_text.xml
@@ -14,6 +14,6 @@
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_50" android:state_selected="true"/>
- <item android:color="@android:color/system_neutral2_700"/>
-</selector> \ No newline at end of file
+ <item android:color="?android:textColorPrimaryInverse" android:state_selected="true"/>
+ <item android:color="?android:textColorSecondary"/>
+</selector>
diff --git a/res/color-night-v31/all_apps_tabs_background.xml b/res/color-night-v31/all_apps_tabs_background.xml
new file mode 100644
index 0000000000..fc8a4d7d79
--- /dev/null
+++ b/res/color-night-v31/all_apps_tabs_background.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:color="@android:color/system_neutral1_800" />
+</selector>
diff --git a/res/color-v31/all_apps_tab_text.xml b/res/color-v31/all_apps_tab_text.xml
index c3520a7ab5..d133a31a2d 100644
--- a/res/color-v31/all_apps_tab_text.xml
+++ b/res/color-v31/all_apps_tab_text.xml
@@ -14,6 +14,6 @@
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@android:color/system_neutral1_900" android:state_selected="true"/>
- <item android:color="@android:color/system_neutral2_700"/>
-</selector> \ No newline at end of file
+ <item android:color="?android:textColorPrimary" android:state_selected="true"/>
+ <item android:color="?android:textColorSecondary"/>
+</selector>
diff --git a/res/drawable/all_apps_search_hint.xml b/res/drawable/all_apps_search_hint.xml
index b2ff7a428e..c0e6811bb9 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"/>
-</selector> \ No newline at end of file
+ <item android:color="?android:attr/textColorSecondary" android:alpha="?android:attr/disabledAlpha" />
+</selector>
diff --git a/res/drawable/bg_all_apps_searchbox.xml b/res/drawable/bg_all_apps_searchbox.xml
index c3249279af..2d02238f1b 100644
--- a/res/drawable/bg_all_apps_searchbox.xml
+++ b/res/drawable/bg_all_apps_searchbox.xml
@@ -14,6 +14,6 @@
limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
- <solid android:color="?attr/popupColorPrimary" />
- <corners android:radius="2dp" />
-</shape> \ No newline at end of file
+ <solid android:color="?attr/allappsHeaderProtectionColor" />
+ <corners android:radius="58dp" />
+</shape>
diff --git a/res/layout/search_container_all_apps.xml b/res/layout/search_container_all_apps.xml
index e1646ba43e..f166f49967 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:elevation="1dp"
+ android:elevation="0dp"
android:focusableInTouchMode="true"
- android:gravity="center"
+ android:gravity="center_vertical"
android:hint="@string/all_apps_search_bar_hint"
android:imeOptions="actionSearch|flagNoExtractUi"
android:inputType="text|textNoSuggestions|textCapWords"
android:maxLines="1"
- android:padding="8dp"
+ android:paddingVertical="12dp"
+ android:paddingStart="12dp"
+ android:paddingEnd="0dp"
+ 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" />
diff --git a/res/layout/secondary_launcher.xml b/res/layout/secondary_launcher.xml
index b15a320bba..d46362855a 100644
--- a/res/layout/secondary_launcher.xml
+++ b/res/layout/secondary_launcher.xml
@@ -101,25 +101,29 @@
<com.android.launcher3.allapps.search.AppsSearchContainerLayout
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:elevation="1dp"
+ android:elevation="0dp"
android:focusableInTouchMode="true"
- android:gravity="center"
+ android:gravity="center_vertical"
android:hint="@string/all_apps_search_bar_hint"
android:imeOptions="actionSearch|flagNoExtractUi"
android:inputType="text|textNoSuggestions|textCapWords"
android:maxLines="1"
- android:padding="8dp"
+ android:paddingVertical="12dp"
+ android:paddingStart="12dp"
+ android:paddingEnd="0dp"
+ 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" />
+ android:textSize="20sp" />
<include layout="@layout/all_apps_fast_scroller" />
</com.android.launcher3.allapps.AllAppsContainerView>
-</com.android.launcher3.secondarydisplay.SecondaryDragLayer> \ No newline at end of file
+</com.android.launcher3.secondarydisplay.SecondaryDragLayer>
diff --git a/res/values-v31/colors.xml b/res/values-v31/colors.xml
index 7bbdbd18fa..85a66783f2 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/config.xml b/res/values/config.xml
index 25911e688f..2a001fb971 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -35,7 +35,7 @@
<string name="popup_container_iterate_children" translatable="false">popup_container_iterate_children</string>
<!-- config used to determine if header protection is supported in AllApps -->
- <bool name="config_header_protection_supported">false</bool>
+ <bool name="config_header_protection_supported">true</bool>
<!-- Workspace -->
<!-- The duration (in ms) of the fade animation on the object outlines, used when
diff --git a/res/values/ice_strings.xml b/res/values/ice_strings.xml
new file mode 100644
index 0000000000..fc75f8f81f
--- /dev/null
+++ b/res/values/ice_strings.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+* Copyright (C) 2016 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.
+*/
+-->
+<resources>
+ <!-- Settings title to show Google Now at -1 screen on launcher. [CHAR LIMIT=50] -->
+ <string name="title_show_google_app">Swipe to access Google app</string>
+ <!-- Settings message explaining when the -1 screen is available on an LTR device. [CHAR LIMIT=100] -->
+ <string name="msg_minus_one_on_left">From Home screen, swipe left to open Google app</string>
+ <!-- Settings message explaining when the -1 screen is available on an RTL device. [CHAR LIMIT=100] -->
+ <string name="msg_minus_one_on_right">From Home screen, swipe right to open Google app</string>
+ <string name="pref_show_google_now_summary" translatable="false">@string/msg_minus_one_on_left</string>
+</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 818a032f94..b6ffc53971 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -99,6 +99,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="allAppsTheme">@style/AllAppsTheme.Dark</item>
<item name="popupColorPrimary">@color/popup_color_primary_dark</item>
@@ -211,7 +212,9 @@
<item name="disabledIconAlpha">.54</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..dfde7de186 100644
--- a/res/xml/default_workspace_4x4.xml
+++ b/res/xml/default_workspace_4x5.xml
@@ -16,6 +16,16 @@
<favorites xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3">
+ <!-- Smartspace Widget -->
+ <appwidget
+ launcher:screen="0"
+ launcher:x="0"
+ launcher:y="0"
+ launcher:spanX="4"
+ launcher:spanY="1"
+ launcher:packageName="com.google.android.googlequicksearchbox"
+ launcher:className="com.google.android.apps.gsa.staticplugins.smartspace.widget.SmartspaceWidgetProvider" />
+
<!-- Hotseat (We use the screen as the position of the item in the hotseat) -->
<!-- Dialer, Messaging, Browser, Camera -->
<resolve
diff --git a/res/xml/default_workspace_5x5.xml b/res/xml/default_workspace_5x5.xml
index b4ac8f63df..7cba7ac335 100644
--- a/res/xml/default_workspace_5x5.xml
+++ b/res/xml/default_workspace_5x5.xml
@@ -16,8 +16,18 @@
<favorites xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3">
+ <!-- Smartspace Widget -->
+ <appwidget
+ launcher:screen="0"
+ launcher:x="0"
+ launcher:y="0"
+ launcher:spanX="5"
+ launcher:spanY="1"
+ launcher:packageName="com.google.android.googlequicksearchbox"
+ launcher:className="com.google.android.apps.gsa.staticplugins.smartspace.widget.SmartspaceWidgetProvider" />
+
<!-- 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 +57,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..7cba7ac335 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.
@@ -16,14 +16,33 @@
<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 -->
+ <!-- Smartspace Widget -->
+ <appwidget
+ launcher:screen="0"
+ launcher:x="0"
+ launcher:y="0"
+ launcher:spanX="5"
+ launcher:spanY="1"
+ launcher:packageName="com.google.android.googlequicksearchbox"
+ launcher:className="com.google.android.apps.gsa.staticplugins.smartspace.widget.SmartspaceWidgetProvider" />
+ <!-- Hotseat (We use the screen as the position of the item in the hotseat) -->
+ <!-- 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 +50,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 +84,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 08698e7d9d..3e9fcac8b9 100644
--- a/res/xml/device_profiles.xml
+++ b/res/xml/device_profiles.xml
@@ -18,50 +18,21 @@
<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|multi_display" >
-
- <display-option
- launcher:name="Super Short Stubby"
- launcher:minWidthDps="255"
- launcher:minHeightDps="300"
- launcher:iconImageSize="48"
- launcher:iconTextSize="13.0"
- launcher:canBeDefault="true" />
-
- <display-option
- launcher:name="Shorter Stubby"
- launcher:minWidthDps="255"
- launcher:minHeightDps="400"
- launcher:iconImageSize="48"
- launcher:iconTextSize="13.0"
- 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:dbFile="launcher_4_by_4.db"
- launcher:defaultLayoutId="@xml/default_workspace_4x4"
+ launcher:dbFile="launcher_4_by_5.db"
+ 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:canBeDefault="true" />
@@ -69,7 +40,7 @@
launcher:name="Stubby"
launcher:minWidthDps="255"
launcher:minHeightDps="450"
- launcher:iconImageSize="48"
+ launcher:iconImageSize="66"
launcher:iconTextSize="13.0"
launcher:canBeDefault="true" />
@@ -77,7 +48,7 @@
launcher:name="Nexus S"
launcher:minWidthDps="296"
launcher:minHeightDps="491.33"
- launcher:iconImageSize="48"
+ launcher:iconImageSize="66"
launcher:iconTextSize="13.0"
launcher:canBeDefault="true" />
@@ -85,7 +56,7 @@
launcher:name="Nexus 4"
launcher:minWidthDps="359"
launcher:minHeightDps="567"
- launcher:iconImageSize="54"
+ launcher:iconImageSize="66"
launcher:iconTextSize="13.0"
launcher:canBeDefault="true" />
@@ -93,7 +64,7 @@
launcher:name="Nexus 5"
launcher:minWidthDps="335"
launcher:minHeightDps="567"
- launcher:iconImageSize="54"
+ launcher:iconImageSize="66"
launcher:iconTextSize="13.0"
launcher:canBeDefault="true" />
@@ -137,6 +108,27 @@
</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="13.0"
+ launcher:canBeDefault="true" />
+
+ </grid-option>
+
+ <grid-option
launcher:name="6_by_5"
launcher:numRows="5"
launcher:numColumns="6"
diff --git a/res/xml/launcher_preferences.xml b/res/xml/launcher_preferences.xml
index 90de4987f5..3ae0f0c481 100644
--- a/res/xml/launcher_preferences.xml
+++ b/res/xml/launcher_preferences.xml
@@ -50,6 +50,12 @@
launcher:logIdOn="615"
launcher:logIdOff="616" />
+ <SwitchPreference
+ android:defaultValue="true"
+ android:key="pref_enable_minus_one"
+ android:summary="@string/pref_show_google_now_summary"
+ android:title="@string/title_show_google_app"/>
+
<androidx.preference.PreferenceScreen
android:key="pref_developer_options"
android:persistent="false"
diff --git a/src/com/android/launcher3/AppWidgetResizeFrame.java b/src/com/android/launcher3/AppWidgetResizeFrame.java
index 300f22bd96..3625e2da06 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;
@@ -238,23 +237,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);
@@ -307,12 +289,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 ff7a90cb2c..5d3b5fd166 100644
--- a/src/com/android/launcher3/InvariantDeviceProfile.java
+++ b/src/com/android/launcher3/InvariantDeviceProfile.java
@@ -402,7 +402,7 @@ public class InvariantDeviceProfile {
// Re-init grid
String gridName = getCurrentGridName(context);
- initGrid(context, gridName);
+ initGrid(context, Utilities.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/OverlayCallbackImpl.java b/src/com/android/launcher3/OverlayCallbackImpl.java
new file mode 100644
index 0000000000..8d8609bce4
--- /dev/null
+++ b/src/com/android/launcher3/OverlayCallbackImpl.java
@@ -0,0 +1,185 @@
+/*
+ * Copyright (C) 2016 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.launcher3;
+
+import android.app.Activity;
+import android.content.SharedPreferences;
+import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
+import android.os.Bundle;
+
+import com.android.launcher3.Launcher;
+import com.android.launcher3.Utilities;
+import com.android.systemui.plugins.shared.LauncherOverlayManager;
+import com.android.systemui.plugins.shared.LauncherOverlayManager.LauncherOverlay;
+
+import com.google.android.libraries.gsa.launcherclient.LauncherClient;
+import com.google.android.libraries.gsa.launcherclient.LauncherClientCallbacks;
+
+import java.io.PrintWriter;
+
+/**
+ * Implements {@link LauncherOverlay} and passes all the corresponding events to {@link
+ * LauncherClient}. {@see setClient}
+ *
+ * <p>Implements {@link LauncherClientCallbacks} and sends all the corresponding callbacks to {@link
+ * Launcher}.
+ */
+public class OverlayCallbackImpl
+ implements LauncherOverlay, LauncherClientCallbacks, LauncherOverlayManager,
+ OnSharedPreferenceChangeListener {
+
+ public static final String KEY_ENABLE_MINUS_ONE = "pref_enable_minus_one";
+
+ private final Launcher mLauncher;
+ private final LauncherClient mClient;
+
+ private LauncherOverlayCallbacks mLauncherOverlayCallbacks;
+ private boolean mWasOverlayAttached = false;
+
+ public OverlayCallbackImpl(Launcher launcher) {
+ SharedPreferences prefs = Utilities.getPrefs(launcher);
+
+ mLauncher = launcher;
+ mClient = new LauncherClient(mLauncher, this, getClientOptions(prefs));
+ prefs.registerOnSharedPreferenceChangeListener(this);
+ }
+
+ @Override
+ public void onDeviceProvideChanged() {
+ mClient.reattachOverlay();
+ }
+
+ @Override
+ public void onAttachedToWindow() {
+ mClient.onAttachedToWindow();
+ }
+
+ @Override
+ public void onDetachedFromWindow() {
+ mClient.onDetachedFromWindow();
+ }
+
+ @Override
+ public void dump(String prefix, PrintWriter w) {
+ mClient.dump(prefix, w);
+ }
+
+ @Override
+ public void openOverlay() {
+ mClient.showOverlay(true);
+ }
+
+ @Override
+ public void hideOverlay(boolean animate) {
+ mClient.hideOverlay(animate);
+ }
+
+ @Override
+ public void hideOverlay(int duration) {
+ mClient.hideOverlay(duration);
+ }
+
+ @Override
+ public boolean startSearch(byte[] config, Bundle extras) {
+ return false;
+ }
+
+ @Override
+ public void onActivityCreated(Activity activity, Bundle bundle) {
+ // Not called
+ }
+
+ @Override
+ public void onActivityStarted(Activity activity) {
+ mClient.onStart();
+ }
+
+ @Override
+ public void onActivityResumed(Activity activity) {
+ mClient.onResume();
+ }
+
+ @Override
+ public void onActivityPaused(Activity activity) {
+ mClient.onPause();
+ }
+
+ @Override
+ public void onActivityStopped(Activity activity) {
+ mClient.onStop();
+ }
+
+ @Override
+ public void onActivitySaveInstanceState(Activity activity, Bundle bundle) { }
+
+ @Override
+ public void onActivityDestroyed(Activity activity) {
+ mClient.onDestroy();
+ mLauncher.getSharedPrefs().unregisterOnSharedPreferenceChangeListener(this);
+ }
+
+ @Override
+ public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
+ if (KEY_ENABLE_MINUS_ONE.equals(key)) {
+ mClient.setClientOptions(getClientOptions(prefs));
+ }
+ }
+
+ @Override
+ public void onServiceStateChanged(boolean overlayAttached, boolean hotwordActive) {
+ if (overlayAttached != mWasOverlayAttached) {
+ mWasOverlayAttached = overlayAttached;
+ mLauncher.setLauncherOverlay(overlayAttached ? this : null);
+ }
+ }
+
+ @Override
+ public void onOverlayScrollChanged(float progress) {
+ if (mLauncherOverlayCallbacks != null) {
+ mLauncherOverlayCallbacks.onScrollChanged(progress);
+ }
+ }
+
+ @Override
+ public void onScrollInteractionBegin() {
+ mClient.startMove();
+ }
+
+ @Override
+ public void onScrollInteractionEnd() {
+ mClient.endMove();
+ }
+
+ @Override
+ public void onScrollChange(float progress, boolean rtl) {
+ mClient.updateMove(progress);
+ }
+
+ @Override
+ public void setOverlayCallbacks(LauncherOverlayCallbacks callbacks) {
+ mLauncherOverlayCallbacks = callbacks;
+ }
+
+
+ private LauncherClient.ClientOptions getClientOptions(SharedPreferences prefs) {
+ return new LauncherClient.ClientOptions(
+ prefs.getBoolean(KEY_ENABLE_MINUS_ONE, true),
+ true, /* enableHotword */
+ true /* enablePrewarming */
+ );
+ }
+}
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index d2fe483c96..84663c64ac 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -139,7 +139,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 281dfea492..f4f14e802d 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -2078,8 +2078,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
final LauncherAppWidgetHostView hostView = (LauncherAppWidgetHostView) cell;
AppWidgetProviderInfo pInfo = hostView.getAppWidgetInfo();
- if (pInfo != null && pInfo.resizeMode != AppWidgetProviderInfo.RESIZE_NONE
- && !options.isAccessibleDrag) {
+ if (pInfo != null && !options.isAccessibleDrag) {
onCompleteRunnable = () -> {
if (!isPageInTransition()) {
AppWidgetResizeFrame.showForWidget(hostView, cellLayout);
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index 3ba6ea4de9..a796d13931 100644
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -760,6 +760,7 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
if (headerColor != mHeaderColor || mTabsProtectionAlpha != tabsAlpha) {
mHeaderColor = headerColor;
mTabsProtectionAlpha = tabsAlpha;
+ getSearchView().setBackgroundResource(R.drawable.bg_all_apps_searchbox);
invalidateHeader();
}
if (mSearchUiManager.getEditText() != null) {
diff --git a/src/com/android/launcher3/allapps/FloatingHeaderView.java b/src/com/android/launcher3/allapps/FloatingHeaderView.java
index 85ee636a12..44ec71c2ec 100644
--- a/src/com/android/launcher3/allapps/FloatingHeaderView.java
+++ b/src/com/android/launcher3/allapps/FloatingHeaderView.java
@@ -314,7 +314,7 @@ public class FloatingHeaderView extends LinearLayout implements
mTabLayout.setTranslationY(mTranslationY);
- int clipHeight = mHeaderTopPadding - getPaddingBottom();
+ int clipHeight = mHeaderTopPadding - getPaddingBottom() * 2;
mRVClip.top = mTabsHidden ? clipHeight : 0;
mHeaderClip.top = clipHeight;
// clipping on a draw might cause additional redraw
@@ -441,7 +441,7 @@ public class FloatingHeaderView extends LinearLayout implements
if (mTabsHidden || !mHeaderCollapsed) {
return 0;
}
- return Math.max(getHeight() - getPaddingTop() + mTranslationY, 0);
+ return Math.max(getHeight() - getPaddingTop() + mTranslationY + getPaddingBottom(), 0);
}
}
diff --git a/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java b/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java
index 0137e2a2c0..c24b2d4680 100644
--- a/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java
+++ b/src/com/android/launcher3/allapps/search/AllAppsSearchBarController.java
@@ -134,7 +134,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 4c5a9e64c9..77ed7962ac 100644
--- a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
+++ b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
@@ -79,7 +79,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_field_height) / 2;
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index 2d31aa4687..26045f0066 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -52,7 +52,7 @@ public final class FeatureFlags {
* Enable moving the QSB on the 0th screen of the workspace. This is not a configuration feature
* and should be modified at a project level.
*/
- public static final boolean QSB_ON_FIRST_SCREEN = true;
+ public static final boolean QSB_ON_FIRST_SCREEN = false;
/**
* Feature flag to handle define config changes dynamically instead of killing the process.
@@ -209,7 +209,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_SPLIT_SELECT = getDebugFlag(
diff --git a/src/com/android/launcher3/settings/SettingsActivity.java b/src/com/android/launcher3/settings/SettingsActivity.java
index 0c39632708..0885df9be2 100644
--- a/src/com/android/launcher3/settings/SettingsActivity.java
+++ b/src/com/android/launcher3/settings/SettingsActivity.java
@@ -20,8 +20,12 @@ import static androidx.core.view.accessibility.AccessibilityNodeInfoCompat.ACTIO
import static com.android.launcher3.states.RotationHelper.ALLOW_ROTATION_PREFERENCE_KEY;
+import static com.android.launcher3.OverlayCallbackImpl.KEY_ENABLE_MINUS_ONE;
+
+import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
+import android.content.pm.PackageManager;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.MenuItem;
@@ -189,6 +193,10 @@ public class SettingsActivity extends FragmentActivity
private boolean mPreferenceHighlighted = false;
private Preference mDeveloperOptionPref;
+ protected static final String GSA_PACKAGE = "com.google.android.googlequicksearchbox";
+
+ private Preference mShowGoogleAppPref;
+
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
final Bundle args = getArguments();
@@ -270,6 +278,11 @@ public class SettingsActivity extends FragmentActivity
case DEVELOPER_OPTIONS_KEY:
mDeveloperOptionPref = preference;
return updateDeveloperOption();
+
+ case KEY_ENABLE_MINUS_ONE:
+ mShowGoogleAppPref = preference;
+ updateIsGoogleAppEnabled();
+ return true;
}
return true;
@@ -293,6 +306,20 @@ public class SettingsActivity extends FragmentActivity
return showPreference;
}
+ public static boolean isGSAEnabled(Context context) {
+ try {
+ return context.getPackageManager().getApplicationInfo(GSA_PACKAGE, 0).enabled;
+ } catch (PackageManager.NameNotFoundException e) {
+ return false;
+ }
+ }
+
+ private void updateIsGoogleAppEnabled() {
+ if (mShowGoogleAppPref != null) {
+ mShowGoogleAppPref.setEnabled(isGSAEnabled(getContext()));
+ }
+ }
+
@Override
public void onResume() {
super.onResume();
@@ -308,6 +335,7 @@ public class SettingsActivity extends FragmentActivity
requestAccessibilityFocus(getListView());
}
}
+ updateIsGoogleAppEnabled();
}
private PreferenceHighlighter createHighlighter() {
diff --git a/src/com/android/launcher3/touch/WorkspaceTouchListener.java b/src/com/android/launcher3/touch/WorkspaceTouchListener.java
index 20d2ad36a5..de484de283 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.Secure.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;
@@ -24,8 +26,12 @@ import static android.view.MotionEvent.ACTION_UP;
import static com.android.launcher3.LauncherState.NORMAL;
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;
@@ -67,15 +73,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
@@ -180,4 +192,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;
+ }
}