diff options
author | Nilesh Agrawal <nileshagrawal@google.com> | 2013-12-09 14:17:49 -0800 |
---|---|---|
committer | Danesh M <daneshm90@gmail.com> | 2014-06-06 22:54:21 -0700 |
commit | 33832e262378ca9e6da33f43efd406ba692bb530 (patch) | |
tree | 7a3880d7c01ff79cd6d8d9cef7c8f5d0988f280c | |
parent | 3ca339fe99358b4a8acf6f332b932e00b8e3c292 (diff) | |
download | packages_apps_Trebuchet-33832e262378ca9e6da33f43efd406ba692bb530.tar.gz packages_apps_Trebuchet-33832e262378ca9e6da33f43efd406ba692bb530.tar.bz2 packages_apps_Trebuchet-33832e262378ca9e6da33f43efd406ba692bb530.zip |
Allow 5 hotseat icons in DISABLE_ALL_APPS mode.
Added the xml resource in Launcher3 package as well.
This is a dummy resource with just hotseat icons.
Previously reviewed on: http://ag/396580
Change-Id: I31b0d7d4796d028f44f746260c381f2d8226605a
-rw-r--r-- | res/xml/default_workspace_no_all_apps.xml | 56 | ||||
-rw-r--r-- | src/com/android/launcher3/DynamicGrid.java | 12 | ||||
-rw-r--r-- | src/com/android/launcher3/LauncherProvider.java | 10 |
3 files changed, 71 insertions, 7 deletions
diff --git a/res/xml/default_workspace_no_all_apps.xml b/res/xml/default_workspace_no_all_apps.xml new file mode 100644 index 000000000..7e1301cef --- /dev/null +++ b/res/xml/default_workspace_no_all_apps.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2013 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. +--> + +<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 Hangouts Maps Chrome Camera --> + <favorite + launcher:packageName="com.google.android.dialer" + launcher:className="com.google.android.dialer.extensions.GoogleDialtactsActivity" + launcher:container="-101" + launcher:screen="0" + launcher:x="0" + launcher:y="0" /> + <favorite + launcher:packageName="com.google.android.talk" + launcher:className="com.google.android.talk.SigningInActivity" + launcher:container="-101" + launcher:screen="1" + launcher:x="1" + launcher:y="0" /> + <favorite + launcher:packageName="com.google.android.apps.maps" + launcher:className="com.google.android.maps.MapsActivity" + launcher:container="-101" + launcher:screen="2" + launcher:x="2" + launcher:y="0"/> + <favorite + launcher:packageName="com.android.chrome" + launcher:className="com.google.android.apps.chrome.Main" + launcher:container="-101" + launcher:screen="3" + launcher:x="3" + launcher:y="0" /> + <favorite + launcher:packageName="com.google.android.GoogleCamera" + launcher:className="com.android.camera.CameraLauncher" + launcher:container="-101" + launcher:screen="4" + launcher:x="4" + launcher:y="0" /> +</favorites> + diff --git a/src/com/android/launcher3/DynamicGrid.java b/src/com/android/launcher3/DynamicGrid.java index bec6690e1..6b7eee83b 100644 --- a/src/com/android/launcher3/DynamicGrid.java +++ b/src/com/android/launcher3/DynamicGrid.java @@ -63,17 +63,17 @@ public class DynamicGrid { DEFAULT_ICON_SIZE_PX = pxFromDp(DEFAULT_ICON_SIZE_DP, dm); // Our phone profiles include the bar sizes in each orientation deviceProfiles.add(new DeviceProfile("Super Short Stubby", - 255, 300, 2, 3, (useLargeIcons ? 54 : 48), 13, (hasAA ? 5 : 4), (useLargeIcons ? 54 : 48))); + 255, 300, 2, 3, (useLargeIcons ? 54 : 48), 13, (hasAA ? 5 : 5), (useLargeIcons ? 54 : 48))); deviceProfiles.add(new DeviceProfile("Shorter Stubby", - 255, 400, 3, 3, (useLargeIcons ? 54 : 48), 13, (hasAA ? 5 : 4), (useLargeIcons ? 54 : 48))); + 255, 400, 3, 3, (useLargeIcons ? 54 : 48), 13, (hasAA ? 5 : 5), (useLargeIcons ? 54 : 48))); deviceProfiles.add(new DeviceProfile("Short Stubby", - 275, 420, 3, 4, (useLargeIcons ? 54 : 48), 13, (hasAA ? 5 : 4), (useLargeIcons ? 54 : 48))); + 275, 420, 3, 4, (useLargeIcons ? 54 : 48), 13, (hasAA ? 5 : 5), (useLargeIcons ? 54 : 48))); deviceProfiles.add(new DeviceProfile("Stubby", - 255, 450, 3, 4, (useLargeIcons ? 54 : 48), 13, (hasAA ? 5 : 4), (useLargeIcons ? 54 : 48))); + 255, 450, 3, 4, (useLargeIcons ? 54 : 48), 13, (hasAA ? 5 : 5), (useLargeIcons ? 54 : 48))); deviceProfiles.add(new DeviceProfile("Nexus S", - 296, 491.33f, 4, 4, (useLargeIcons ? 56 : 48), 13, (hasAA ? 5 : 4), (useLargeIcons ? 56 : 48))); + 296, 491.33f, 4, 4, (useLargeIcons ? 56 : 48), 13, (hasAA ? 5 : 5), (useLargeIcons ? 56 : 48))); deviceProfiles.add(new DeviceProfile("Nexus 4", - 359, 518, 4, 4, (useLargeIcons ? DEFAULT_ICON_SIZE_DP : 52), 13, (hasAA ? 5 : 4), (useLargeIcons ? 56 : 48))); + 359, 518, 4, 4, (useLargeIcons ? DEFAULT_ICON_SIZE_DP : 52), 13, (hasAA ? 5 : 5), (useLargeIcons ? 56 : 48))); // The tablet profile is odd in that the landscape orientation // also includes the nav bar on the side deviceProfiles.add(new DeviceProfile("Nexus 7", diff --git a/src/com/android/launcher3/LauncherProvider.java b/src/com/android/launcher3/LauncherProvider.java index 3cffa3465..fe7e279a3 100644 --- a/src/com/android/launcher3/LauncherProvider.java +++ b/src/com/android/launcher3/LauncherProvider.java @@ -277,7 +277,7 @@ public class LauncherProvider extends ContentProvider { if (tm.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE) { workspaceResId = sp.getInt(DEFAULT_WORKSPACE_RESOURCE_ID, R.xml.default_workspace_no_telephony); } else { - workspaceResId = sp.getInt(DEFAULT_WORKSPACE_RESOURCE_ID, R.xml.default_workspace); + workspaceResId = sp.getInt(DEFAULT_WORKSPACE_RESOURCE_ID, getDefaultWorkspaceResourceId()); } } @@ -294,6 +294,14 @@ public class LauncherProvider extends ContentProvider { } } + private static int getDefaultWorkspaceResourceId() { + if (AppsCustomizePagedView.DISABLE_ALL_APPS) { + return R.xml.default_workspace_no_all_apps; + } else { + return R.xml.default_workspace; + } + } + private static interface ContentValuesCallback { public void onRow(ContentValues values); } |