diff options
author | huiwan <huiwan@codeaurora.org> | 2014-11-10 10:35:03 -0800 |
---|---|---|
committer | Rajesh Yengisetty <rajesh@cyngn.com> | 2014-11-21 00:15:11 +0000 |
commit | ce99e9fa247e28cfe5036d8febf4a95149a40e0f (patch) | |
tree | 40514ed88778571d55dd0456fb0010ef13eaafca | |
parent | 9b398417ff00bb67a43579c748fd335effad1c5b (diff) | |
download | packages_apps_Trebuchet-ce99e9fa247e28cfe5036d8febf4a95149a40e0f.tar.gz packages_apps_Trebuchet-ce99e9fa247e28cfe5036d8febf4a95149a40e0f.tar.bz2 packages_apps_Trebuchet-ce99e9fa247e28cfe5036d8febf4a95149a40e0f.zip |
Launcher: Customize app shortcuts for Carrier
App shortcuts are displayed on home:
Screen 2
- deskclock
- calendar
Screen 3
- bestpay, imusic, video, ezone, pdager, FJDXCartoon, mail189, sfreader
- elive, ecp, pim, hall, jt, egame, mdesk
Change-Id: I848333548eabded42700aa11e874fae3c5362246
Signed-off-by: Xiaojing Zhang <zhangx@codeaurora.org>
-rw-r--r-- | res/xml/ct_default_workspace_4x4.xml | 174 | ||||
-rw-r--r-- | src/com/android/launcher3/DynamicGrid.java | 19 | ||||
-rw-r--r-- | src/com/android/launcher3/LauncherApplication.java | 3 |
3 files changed, 188 insertions, 8 deletions
diff --git a/res/xml/ct_default_workspace_4x4.xml b/res/xml/ct_default_workspace_4x4.xml new file mode 100644 index 000000000..a9a4cb226 --- /dev/null +++ b/res/xml/ct_default_workspace_4x4.xml @@ -0,0 +1,174 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. + Not a Contribution. + + 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. + 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"> + <!-- Far-left screen [0] --> + <!-- Left screen [1] --> + <!-- Middle screen [2] --> + <favorite + launcher:packageName="com.android.deskclock" + launcher:className="com.android.deskclock.DeskClock" + launcher:screen="2" + launcher:x="0" + launcher:y="3" + /> + <favorite + launcher:packageName="com.android.calendar" + launcher:className="com.android.calendar.AllInOneActivity" + launcher:screen="2" + launcher:x="3" + launcher:y="3" /> + + <!-- Right screen [3] --> + <favorite + launcher:packageName="com.chinatelecom.bestpayclient" + launcher:className="com.chinatelecom.bestpayclient.BufferActivity" + launcher:screen="3" + launcher:x="0" + launcher:y="0" + /> + <favorite + launcher:packageName="com.gwsoft.imusic.controller" + launcher:className="com.gwsoft.imusic.controller.IMusicActivity" + launcher:screen="3" + launcher:x="1" + launcher:y="0" + /> + <favorite + launcher:packageName="com.telecom.video" + launcher:className="com.telecom.video.ui.activity.LoadingActivity" + launcher:screen="3" + launcher:x="2" + launcher:y="0" + /> + <favorite + launcher:packageName="com.eshore.ezone" + launcher:className="com.eshore.ezone.StartActivity" + launcher:screen="3" + launcher:x="3" + launcher:y="0" + /> + <favorite + launcher:packageName="com.pdager" + launcher:className="com.pdager.enavi.Act.APIMain" + launcher:screen="3" + launcher:x="0" + launcher:y="1" + /> + <favorite + launcher:packageName="com.erdo.android.FJDXCartoon" + launcher:className="com.erdo.android.FJDXCartoon.Activity_Start" + launcher:screen="3" + launcher:x="1" + launcher:y="1" + /> + <favorite + launcher:packageName="com.corp21cn.mail189" + launcher:className="com.corp21cn.mailapp.activity.ClientIntroducePage" + launcher:screen="3" + launcher:x="2" + launcher:y="1" + /> + <favorite + launcher:packageName="com.lectek.android.sfreader" + launcher:className="com.lectek.android.sfreader.ui.SplashActivity" + launcher:screen="3" + launcher:x="3" + launcher:y="1" + /> + <favorite + launcher:packageName="com.pica.elive" + launcher:className="com.pica.elive.SplashActivity" + launcher:screen="3" + launcher:x="0" + launcher:y="2" + /> + <favorite + launcher:packageName="com.lectek.android.ecp" + launcher:className="com.lectek.android.ecp.ui.LoginActivity" + launcher:screen="3" + launcher:x="1" + launcher:y="2" + /> + <favorite + launcher:packageName="com.chinatelecom.pim" + launcher:className="com.chinatelecom.pim.activity.PimLauncherActivity" + launcher:screen="3" + launcher:x="2" + launcher:y="2" + /> + <favorite + launcher:packageName="com.besttone.hall" + launcher:className="com.besttone.hall.StartAppActivity" + launcher:screen="3" + launcher:x="3" + launcher:y="2" /> + <favorite + launcher:packageName="com.ideal.mobile.jt" + launcher:className="com.gift.android.Mains" + launcher:screen="3" + launcher:x="0" + launcher:y="3" + /> + <favorite + launcher:packageName="com.egame" + launcher:className="com.egame.app.FlashScreenActivity" + launcher:screen="3" + launcher:x="1" + launcher:y="3" + /> + <favorite + launcher:packageName="telecom.mdesk" + launcher:className="telecom.mdesk.Launcher" + launcher:screen="3" + launcher:x="2" + launcher:y="3" + /> + <!-- Far-right screen [4] --> + + <!-- Hotseat (We use the screen as the position of the item in the hotseat) --> + <favorite + launcher:packageName="com.android.mms" + launcher:className="com.android.mms.ui.ConversationList" + launcher:container="-101" + launcher:screen="0" + launcher:x="0" + launcher:y="0" /> + <favorite + launcher:packageName="com.android.dialer" + launcher:className="com.android.dialer.DialtactsActivity" + launcher:container="-101" + launcher:screen="1" + launcher:x="1" + launcher:y="0" /> + <favorite + launcher:packageName="com.android.contacts" + launcher:className="com.android.contacts.activities.PeopleActivity" + launcher:container="-101" + launcher:screen="3" + launcher:x="3" + launcher:y="0" /> + <favorite + launcher:packageName="com.android.browser" + launcher:className="com.android.browser.BrowserActivity" + 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 dfb41528c..1acba379b 100644 --- a/src/com/android/launcher3/DynamicGrid.java +++ b/src/com/android/launcher3/DynamicGrid.java @@ -56,28 +56,31 @@ public class DynamicGrid { ArrayList<DeviceProfile> deviceProfiles = new ArrayList<DeviceProfile>(); boolean hasAA = !LauncherAppState.isDisableAllApps(); + boolean launcherShortcutEnabled = LauncherApplication.LAUNCHER_SHORTCUT_ENABLED; + int fourByFourDefaultLayout = launcherShortcutEnabled ? R.xml.ct_default_workspace_4x4 + : R.xml.default_workspace_4x4; 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 ? 3 : 5), 48, R.xml.default_workspace_4x4, + 255, 300, 2, 3, 48, 13, (hasAA ? 3 : 5), 48, fourByFourDefaultLayout, R.xml.default_workspace_4x4_no_all_apps)); deviceProfiles.add(new DeviceProfile("Shorter Stubby", - 255, 400, 3, 3, 48, 13, (hasAA ? 3 : 5), 48, R.xml.default_workspace_4x4, + 255, 400, 3, 3, 48, 13, (hasAA ? 3 : 5), 48, fourByFourDefaultLayout, R.xml.default_workspace_4x4_no_all_apps)); deviceProfiles.add(new DeviceProfile("Short Stubby", - 275, 420, 3, 4, 48, 13, (hasAA ? 5 : 5), 48, R.xml.default_workspace_4x4, + 275, 420, 3, 4, 48, 13, (hasAA ? 5 : 5), 48, fourByFourDefaultLayout, R.xml.default_workspace_4x4_no_all_apps)); deviceProfiles.add(new DeviceProfile("Stubby", - 255, 450, 3, 4, 48, 13, (hasAA ? 5 : 5), 48, R.xml.default_workspace_4x4, + 255, 450, 3, 4, 48, 13, (hasAA ? 5 : 5), 48, fourByFourDefaultLayout, R.xml.default_workspace_4x4_no_all_apps)); deviceProfiles.add(new DeviceProfile("Nexus S", - 296, 491.33f, 4, 4, 48, 13, (hasAA ? 5 : 5), 48, R.xml.default_workspace_4x4, + 296, 491.33f, 4, 4, 48, 13, (hasAA ? 5 : 5), 48, fourByFourDefaultLayout, R.xml.default_workspace_4x4_no_all_apps)); deviceProfiles.add(new DeviceProfile("Nexus 4", - 335, 567, 4, 4, DEFAULT_ICON_SIZE_DP, 13, (hasAA ? 5 : 5), 56, R.xml.default_workspace_4x4, + 335, 567, 4, 4, DEFAULT_ICON_SIZE_DP, 13, (hasAA ? 5 : 5), 56, fourByFourDefaultLayout, R.xml.default_workspace_4x4_no_all_apps)); deviceProfiles.add(new DeviceProfile("Nexus 5", - 359, 567, 4, 4, DEFAULT_ICON_SIZE_DP, 13, (hasAA ? 5 : 5), 56, R.xml.default_workspace_4x4, + 359, 567, 4, 4, DEFAULT_ICON_SIZE_DP, 13, (hasAA ? 5 : 5), 56, fourByFourDefaultLayout, R.xml.default_workspace_4x4_no_all_apps)); deviceProfiles.add(new DeviceProfile("Large Phone", 406, 694, 5, 5, 64, 14.4f, 5, 56, R.xml.default_workspace_5x5, @@ -92,7 +95,7 @@ public class DynamicGrid { 727, 1207, 5, 6, 76, 14.4f, 7, 64, R.xml.default_workspace_5x6, R.xml.default_workspace_5x6_no_all_apps)); deviceProfiles.add(new DeviceProfile("20-inch Tablet", - 1527, 2527, 7, 7, 100, 20, 7, 72, R.xml.default_workspace_4x4, + 1527, 2527, 7, 7, 100, 20, 7, 72, fourByFourDefaultLayout, R.xml.default_workspace_4x4_no_all_apps)); mMinWidth = dpiFromPx(minWidthPx, dm); mMinHeight = dpiFromPx(minHeightPx, dm); diff --git a/src/com/android/launcher3/LauncherApplication.java b/src/com/android/launcher3/LauncherApplication.java index f0a08ffbe..1a74ab276 100644 --- a/src/com/android/launcher3/LauncherApplication.java +++ b/src/com/android/launcher3/LauncherApplication.java @@ -20,12 +20,15 @@ import android.app.Application; public class LauncherApplication extends Application { public static boolean LAUNCHER_SHOW_UNREAD_NUMBER; + public static boolean LAUNCHER_SHORTCUT_ENABLED; @Override public void onCreate() { super.onCreate(); LAUNCHER_SHOW_UNREAD_NUMBER = getResources().getBoolean( R.bool.config_launcher_show_unread_number); + LAUNCHER_SHORTCUT_ENABLED = getResources().getBoolean( + R.bool.config_launcher_shortcut); LauncherAppState.setApplicationContext(this); LauncherAppState.getInstance(); } |