am da41ea66: Allow 5 hotseat icons in DISABLE_ALL_APPS mode.

* commit 'da41ea669890a79a4d2bc57dab9ae03157fd9e75':
  Allow 5 hotseat icons in DISABLE_ALL_APPS mode.
This commit is contained in:
Nilesh Agrawal
2014-02-14 20:38:32 +00:00
committed by Android Git Automerger
3 changed files with 72 additions and 7 deletions
+56
View File
@@ -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>
+6 -6
View File
@@ -60,17 +60,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, 48, 13, (hasAA ? 5 : 4), 48));
255, 300, 2, 3, 48, 13, (hasAA ? 5 : 5), 48));
deviceProfiles.add(new DeviceProfile("Shorter Stubby",
255, 400, 3, 3, 48, 13, (hasAA ? 5 : 4), 48));
255, 400, 3, 3, 48, 13, (hasAA ? 5 : 5), 48));
deviceProfiles.add(new DeviceProfile("Short Stubby",
275, 420, 3, 4, 48, 13, (hasAA ? 5 : 4), 48));
275, 420, 3, 4, 48, 13, (hasAA ? 5 : 5), 48));
deviceProfiles.add(new DeviceProfile("Stubby",
255, 450, 3, 4, 48, 13, (hasAA ? 5 : 4), 48));
255, 450, 3, 4, 48, 13, (hasAA ? 5 : 5), 48));
deviceProfiles.add(new DeviceProfile("Nexus S",
296, 491.33f, 4, 4, 48, 13, (hasAA ? 5 : 4), 48));
296, 491.33f, 4, 4, 48, 13, (hasAA ? 5 : 5), 48));
deviceProfiles.add(new DeviceProfile("Nexus 4",
359, 518, 4, 4, DEFAULT_ICON_SIZE_DP, 13, (hasAA ? 5 : 4), 56));
359, 518, 4, 4, DEFAULT_ICON_SIZE_DP, 13, (hasAA ? 5 : 5), 56));
// The tablet profile is odd in that the landscape orientation
// also includes the nav bar on the side
deviceProfiles.add(new DeviceProfile("Nexus 7",
@@ -270,7 +270,8 @@ public class LauncherProvider extends ContentProvider {
// Use default workspace resource if none provided
if (workspaceResId == 0) {
workspaceResId = sp.getInt(DEFAULT_WORKSPACE_RESOURCE_ID, R.xml.default_workspace);
workspaceResId =
sp.getInt(DEFAULT_WORKSPACE_RESOURCE_ID, getDefaultWorkspaceResourceId());
}
// Populate favorites table with initial favorites
@@ -286,6 +287,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);
}