summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaj Yengisetty <raj@cyngn.com>2015-10-21 00:41:32 (GMT)
committerGerrit Code Review <gerrit@cyanogenmod.org>2015-11-16 19:06:45 (GMT)
commit1c46bab868b72d2f8b14a2e87441e01de791f6ef (patch)
treef0b19446497d4061d276b1f66574b170495c902a
parent692799c6d18b5afc53ab1739857b34cda164ae26 (diff)
downloadandroid_packages_apps_Trebuchet-1c46bab868b72d2f8b14a2e87441e01de791f6ef.zip
android_packages_apps_Trebuchet-1c46bab868b72d2f8b14a2e87441e01de791f6ef.tar.gz
android_packages_apps_Trebuchet-1c46bab868b72d2f8b14a2e87441e01de791f6ef.tar.bz2
Live Settings: always rebuild DynamicGrid
Fixes bug with Dynamic Grid resize not applying. Change-Id: I39b9d8eea3bf4c36ce010728fd1cbb0b498c6f28
-rw-r--r--src/com/android/launcher3/LauncherAppState.java70
1 files changed, 34 insertions, 36 deletions
diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java
index c55adfc..78d3118 100644
--- a/src/com/android/launcher3/LauncherAppState.java
+++ b/src/com/android/launcher3/LauncherAppState.java
@@ -218,56 +218,54 @@ public class LauncherAppState implements DeviceProfile.DeviceProfileCallbacks {
Resources resources = context.getResources();
- if (dynamicGrid == null) {
- Point smallestSize = new Point();
- Point largestSize = new Point();
- display.getCurrentSizeRange(smallestSize, largestSize);
+ Point smallestSize = new Point();
+ Point largestSize = new Point();
+ display.getCurrentSizeRange(smallestSize, largestSize);
- String mcc = SystemProperties.get(MCC_PROP_NAME);
+ String mcc = SystemProperties.get(MCC_PROP_NAME);
- if (!TextUtils.isEmpty(mcc)) {
- Log.d(TAG, "mcc not empty: " + mcc);
+ if (!TextUtils.isEmpty(mcc)) {
+ Log.d(TAG, "mcc not empty: " + mcc);
- Configuration tempConfiguration = new Configuration(resources.getConfiguration());
- boolean shouldUseTempConfig = false;
+ Configuration tempConfiguration = new Configuration(resources.getConfiguration());
+ boolean shouldUseTempConfig = false;
+ try {
+ tempConfiguration.mcc = Integer.parseInt(mcc);
+ shouldUseTempConfig = true;
+ } catch (NumberFormatException e) {
+ // not able to parse mcc, catch exception and exit out of this logic
+ e.printStackTrace();
+ }
+
+ if (shouldUseTempConfig) {
+ String publicSrcDir = null;
try {
- tempConfiguration.mcc = Integer.parseInt(mcc);
- shouldUseTempConfig = true;
- } catch (NumberFormatException e) {
- // not able to parse mcc, catch exception and exit out of this logic
+ String packageName = sContext.getPackageName();
+ publicSrcDir = sContext.getPackageManager().getApplicationInfo(packageName,
+ 0).publicSourceDir;
+ } catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
- if (shouldUseTempConfig) {
- String publicSrcDir = null;
- try {
- String packageName = sContext.getPackageName();
- publicSrcDir = sContext.getPackageManager().getApplicationInfo(packageName,
- 0).publicSourceDir;
- } catch (PackageManager.NameNotFoundException e) {
- e.printStackTrace();
- }
-
- AssetManager assetManager = new AssetManager();
- if (!TextUtils.isEmpty(publicSrcDir)) {
- assetManager.addAssetPath(publicSrcDir);
- }
-
- resources = new Resources(assetManager, new DisplayMetrics(),
- tempConfiguration);
+ AssetManager assetManager = new AssetManager();
+ if (!TextUtils.isEmpty(publicSrcDir)) {
+ assetManager.addAssetPath(publicSrcDir);
}
+ resources = new Resources(assetManager, new DisplayMetrics(),
+ tempConfiguration);
}
- dynamicGrid = new DynamicGrid(context,
- resources,
- Math.min(smallestSize.x, smallestSize.y),
- Math.min(largestSize.x, largestSize.y),
- realSize.x, realSize.y,
- dm.widthPixels, dm.heightPixels);
}
+ dynamicGrid = new DynamicGrid(context,
+ resources,
+ Math.min(smallestSize.x, smallestSize.y),
+ Math.min(largestSize.x, largestSize.y),
+ realSize.x, realSize.y,
+ dm.widthPixels, dm.heightPixels);
+
// Update the icon size
DeviceProfile grid = dynamicGrid.getDeviceProfile();
grid.updateFromConfiguration(context, resources,