From 657097fd0f4e28f597f15547ee70e3e8ef90c388 Mon Sep 17 00:00:00 2001 From: "Jing (Mia) Wang" Date: Mon, 22 Dec 2014 14:18:53 +0800 Subject: Trebuchet: Add Backup icon on main screen Change-Id: Idcfcabcba72ebdc96b22f7b50c0fdfbc2e7c922b --- src/com/android/launcher3/DynamicGrid.java | 11 ++++++++--- src/com/android/launcher3/LauncherApplication.java | 3 +++ 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src/com/android') diff --git a/src/com/android/launcher3/DynamicGrid.java b/src/com/android/launcher3/DynamicGrid.java index d2a5ff7e2..1bf9afb56 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 520beb639..56ca3267f 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(); } -- cgit v1.2.3