summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaj Yengisetty <rajesh@cyngn.com>2014-12-30 03:57:58 (GMT)
committerRaj Yengisetty <rajesh@cyngn.com>2014-12-30 04:05:20 (GMT)
commitbf0c63582b45553468eeff2cb6f6da98009f8930 (patch)
tree070366a456ee076cbc19454bfac1c6a04093f9a5
parent99840f48519809b6b390d53d0378fa4eece0496c (diff)
downloadandroid_packages_apps_Trebuchet-bf0c63582b45553468eeff2cb6f6da98009f8930.zip
android_packages_apps_Trebuchet-bf0c63582b45553468eeff2cb6f6da98009f8930.tar.gz
android_packages_apps_Trebuchet-bf0c63582b45553468eeff2cb6f6da98009f8930.tar.bz2
Adding Large Icons
Change-Id: I85f11768a8dfa4f3df9be397d517686a1c72b9bf
-rw-r--r--src/com/android/launcher3/DynamicGrid.java42
1 files changed, 27 insertions, 15 deletions
diff --git a/src/com/android/launcher3/DynamicGrid.java b/src/com/android/launcher3/DynamicGrid.java
index 1acba37..d2a5ff7 100644
--- a/src/com/android/launcher3/DynamicGrid.java
+++ b/src/com/android/launcher3/DynamicGrid.java
@@ -21,6 +21,8 @@ import android.content.res.Resources;
import android.util.DisplayMetrics;
import android.util.TypedValue;
+import com.android.launcher3.settings.SettingsProvider;
+
import java.util.ArrayList;
public class DynamicGrid {
@@ -56,47 +58,57 @@ public class DynamicGrid {
ArrayList<DeviceProfile> deviceProfiles =
new ArrayList<DeviceProfile>();
boolean hasAA = !LauncherAppState.isDisableAllApps();
+ 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;
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, fourByFourDefaultLayout,
+ 255, 300, 2, 3, (useLargeIcons ? 54 : 48), 13, (hasAA ? 3 : 5),
+ (useLargeIcons ? 54 : 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, fourByFourDefaultLayout,
+ 255, 400, 3, 3, (useLargeIcons ? 54 : 48), 13, (hasAA ? 3 : 5),
+ (useLargeIcons ? 54 : 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, fourByFourDefaultLayout,
+ 275, 420, 3, 4, (useLargeIcons ? 54 : 48), 13, (hasAA ? 5 : 5),
+ (useLargeIcons ? 54 : 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, fourByFourDefaultLayout,
+ 255, 450, 3, 4, (useLargeIcons ? 54 : 48), 13, (hasAA ? 5 : 5),
+ (useLargeIcons ? 54 : 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, fourByFourDefaultLayout,
+ 296, 491.33f, 4, 4, (useLargeIcons ? 54 : 48), 13, (hasAA ? 5 : 5),
+ (useLargeIcons ? 54 : 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, fourByFourDefaultLayout,
+ 335, 567, 4, 4, (useLargeIcons ? DEFAULT_ICON_SIZE_DP : 56), 13, (hasAA ? 5 : 5),
+ (useLargeIcons ? 56 : 48), 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, fourByFourDefaultLayout,
+ 359, 567, 4, 4, (useLargeIcons ? DEFAULT_ICON_SIZE_DP : 56), 13, (hasAA ? 5 : 5),
+ (useLargeIcons ? 56 : 48), 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,
- R.xml.default_workspace_5x5_no_all_apps));
+ 406, 694, 5, 5, (useLargeIcons ? 64 : 56), 14.4f, 5, (useLargeIcons ? 56 : 48),
+ R.xml.default_workspace_5x5, R.xml.default_workspace_5x5_no_all_apps));
// The tablet profile is odd in that the landscape orientation
// also includes the nav bar on the side
deviceProfiles.add(new DeviceProfile("Nexus 7",
- 575, 904, 5, 6, 72, 14.4f, 7, 60, R.xml.default_workspace_5x6,
- R.xml.default_workspace_5x6_no_all_apps));
+ 575, 904, 5, 6, (useLargeIcons ? 72 : 60), 14.4f, 7, (useLargeIcons ? 60 : 52),
+ R.xml.default_workspace_5x6, R.xml.default_workspace_5x6_no_all_apps));
// Larger tablet profiles always have system bars on the top & bottom
deviceProfiles.add(new DeviceProfile("Nexus 10",
- 727, 1207, 5, 6, 76, 14.4f, 7, 64, R.xml.default_workspace_5x6,
- R.xml.default_workspace_5x6_no_all_apps));
+ 727, 1207, 5, 6, (useLargeIcons ? 76 : 64), 14.4f, 7, (useLargeIcons ? 64 : 56),
+ 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, fourByFourDefaultLayout,
- R.xml.default_workspace_4x4_no_all_apps));
+ 1527, 2527, 7, 7, (useLargeIcons ? 100 : 80), 20, 7, (useLargeIcons ? 72 : 64),
+ fourByFourDefaultLayout, R.xml.default_workspace_4x4_no_all_apps));
mMinWidth = dpiFromPx(minWidthPx, dm);
mMinHeight = dpiFromPx(minHeightPx, dm);
mProfile = new DeviceProfile(context, deviceProfiles,