summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJing (Mia) Wang <kaiyiz@codeaurora.org>2014-12-22 06:18:53 (GMT)
committerMatt Garnes <matt@cyngn.com>2015-01-15 08:05:55 (GMT)
commit657097fd0f4e28f597f15547ee70e3e8ef90c388 (patch)
tree131074950e9692da9247b3bfc8b6b7eab1f74285
parentd18f58a6b243c52f8c25b8641c70570f21672d6d (diff)
downloadandroid_packages_apps_Trebuchet-657097fd0f4e28f597f15547ee70e3e8ef90c388.zip
android_packages_apps_Trebuchet-657097fd0f4e28f597f15547ee70e3e8ef90c388.tar.gz
android_packages_apps_Trebuchet-657097fd0f4e28f597f15547ee70e3e8ef90c388.tar.bz2
Trebuchet: Add Backup icon on main screen
Change-Id: Idcfcabcba72ebdc96b22f7b50c0fdfbc2e7c922b
-rw-r--r--res/values/config.xml2
-rw-r--r--res/xml/cm_with_backup_default_workspace.xml131
-rw-r--r--src/com/android/launcher3/DynamicGrid.java11
-rw-r--r--src/com/android/launcher3/LauncherApplication.java3
4 files changed, 144 insertions, 3 deletions
diff --git a/res/values/config.xml b/res/values/config.xml
index 1d54e78..59b7c05 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -119,6 +119,8 @@
<integer name="hotseat_item_scale_percentage">100</integer>
<bool name="config_launcher_page">false</bool>
+
<bool name="config_launcher_shortcut">false</bool>
<bool name="config_launcher_show_unread_number">true</bool>
+ <bool name="config_launcher_show_backup_shortcut">false</bool>
</resources>
diff --git a/res/xml/cm_with_backup_default_workspace.xml b/res/xml/cm_with_backup_default_workspace.xml
new file mode 100644
index 0000000..888605f
--- /dev/null
+++ b/res/xml/cm_with_backup_default_workspace.xml
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (c) 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] -->
+ <appwidget
+ launcher:packageName="com.android.settings"
+ launcher:className="com.android.settings.widget.SettingsAppWidgetProvider"
+ launcher:screen="1"
+ launcher:x="0"
+ launcher:y="3"
+ launcher:spanX="4"
+ launcher:spanY="1" />
+
+ <!-- Middle screen [2] -->
+ <appwidget
+ launcher:packageName="com.android.deskclock"
+ launcher:className="com.android.alarmclock.AnalogAppWidgetProvider"
+ launcher:screen="2"
+ launcher:x="1"
+ launcher:y="0"
+ launcher:spanX="2"
+ launcher:spanY="2" />
+
+ <!--UX_Enhance_Middle screen [2]-->
+ <favorite
+ launcher:packageName="com.android.email"
+ launcher:className="com.android.email.activity.Welcome"
+ launcher:screen="2"
+ launcher:x="0"
+ launcher:y="4" />
+ <favorite
+ launcher:packageName="com.android.calendar"
+ launcher:className="com.android.calendar.AllInOneActivity"
+ launcher:screen="2"
+ launcher:x="1"
+ launcher:y="4" />
+ <favorite
+ launcher:packageName="com.android.settings"
+ launcher:className="com.android.settings.Settings"
+ launcher:screen="2"
+ launcher:x="2"
+ launcher:y="4" />
+ <favorite
+ launcher:packageName="com.android.vending"
+ launcher:className="com.google.android.finsky.activities.MainActivity"
+ launcher:screen="2"
+ launcher:x="3"
+ launcher:y="4" />
+
+ <!-- UX_Enhance_screen [3] -->
+ <favorite
+ launcher:packageName="com.android.backup"
+ launcher:className="com.android.backup.MainBackUpActivity"
+ launcher:screen="3"
+ launcher:x="2"
+ launcher:y="3" />
+ <favorite
+ launcher:packageName="com.android.gallery3d"
+ launcher:className="com.android.camera.Camera"
+ launcher:screen="3"
+ launcher:x="0"
+ launcher:y="4" />
+ <favorite
+ launcher:packageName="com.android.gallery3d"
+ launcher:className="com.android.gallery3d.app.Gallery"
+ launcher:screen="3"
+ launcher:x="1"
+ launcher:y="4" />
+ <favorite
+ launcher:packageName="com.android.music"
+ launcher:className="com.android.music.VideoBrowserActivity"
+ launcher:screen="3"
+ launcher:x="2"
+ launcher:y="4" />
+ <favorite
+ launcher:packageName="com.android.music"
+ launcher:className="com.android.music.MusicBrowserActivity"
+ launcher:screen="3"
+ launcher:x="3"
+ launcher:y="4" />
+
+ <!-- Hotseat (We use the screen as the position of the item in the hotseat) -->
+ <favorite
+ launcher:packageName="com.android.dialer"
+ launcher:className="com.android.dialer.DialtactsActivity"
+ launcher:container="-101"
+ launcher:screen="0"
+ launcher:x="0"
+ launcher:y="0" />
+ <favorite
+ launcher:packageName="com.android.contacts"
+ launcher:className="com.android.contacts.activities.PeopleActivity"
+ launcher:container="-101"
+ launcher:screen="1"
+ launcher:x="1"
+ launcher:y="0" />
+ <favorite
+ launcher:packageName="com.android.mms"
+ launcher:className="com.android.mms.ui.ConversationList"
+ 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 d2a5ff7..1bf9afb 100644
--- a/src/com/android/launcher3/DynamicGrid.java
+++ b/src/com/android/launcher3/DynamicGrid.java
@@ -61,9 +61,14 @@ public class DynamicGrid {
boolean useLargeIcons = SettingsProvider.getBoolean(context,
SettingsProvider.SETTINGS_UI_GENERAL_ICONS_LARGE,
R.bool.preferences_interface_general_icons_large_default);
- boolean launcherShortcutEnabled = LauncherApplication.LAUNCHER_SHORTCUT_ENABLED;
- int fourByFourDefaultLayout = launcherShortcutEnabled ? R.xml.ct_default_workspace_4x4
- : R.xml.default_workspace_4x4;
+
+ int fourByFourDefaultLayout = R.xml.default_workspace_4x4;
+ if (LauncherApplication.LAUNCHER_SHORTCUT_ENABLED) {
+ fourByFourDefaultLayout = R.xml.ct_default_workspace_4x4;
+ } else if (LauncherApplication.LAUNCHER_BACKUP_SHORTCUT_ENABLED) {
+ fourByFourDefaultLayout = R.xml.cm_with_backup_default_workspace;
+ }
+
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",
diff --git a/src/com/android/launcher3/LauncherApplication.java b/src/com/android/launcher3/LauncherApplication.java
index 520beb6..56ca326 100644
--- a/src/com/android/launcher3/LauncherApplication.java
+++ b/src/com/android/launcher3/LauncherApplication.java
@@ -22,6 +22,7 @@ public class LauncherApplication extends Application {
public static boolean LAUNCHER_SHOW_UNREAD_NUMBER;
public static boolean LAUNCHER_SHORTCUT_ENABLED;
public static boolean SHOW_CTAPP_FEATURE;
+ public static boolean LAUNCHER_BACKUP_SHORTCUT_ENABLED;
@Override
public void onCreate() {
@@ -31,6 +32,8 @@ public class LauncherApplication extends Application {
LAUNCHER_SHORTCUT_ENABLED = getResources().getBoolean(
R.bool.config_launcher_shortcut);
SHOW_CTAPP_FEATURE = getResources().getBoolean(R.bool.config_launcher_page);
+ LAUNCHER_BACKUP_SHORTCUT_ENABLED =
+ getResources().getBoolean(R.bool.config_launcher_show_backup_shortcut);
LauncherAppState.setApplicationContext(this);
LauncherAppState.getInstance();
}