summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaj Yengisetty <rajesh@cyngn.com>2015-03-02 21:49:07 -0800
committerRaj Yengisetty <rajesh@cyngn.com>2015-03-02 21:50:59 -0800
commit751627337db296cc97f34be38307ad91ad64163d (patch)
tree72258ef327d10072c656dbef36e7cbefb428568f
parentb29ee17e3d999b78d8a6b22a082906b077ad6e9b (diff)
downloadandroid_packages_apps_Trebuchet-751627337db296cc97f34be38307ad91ad64163d.tar.gz
android_packages_apps_Trebuchet-751627337db296cc97f34be38307ad91ad64163d.tar.bz2
android_packages_apps_Trebuchet-751627337db296cc97f34be38307ad91ad64163d.zip
Fix: Dynamic Grid resizing for custom values
Update the grid when the custom values are changed Repro: - Set custom grid to 7x7 - press home and observe grid is updated to 7x7 - Set custom grid to 2x3 - press home and observe that the grid isn't updated Change-Id: I8284eff08a96992b01b406ec1bff61f38d0ca683
-rw-r--r--src/com/android/launcher3/Launcher.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 90d5337c9..8de95e9ff 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -1287,7 +1287,18 @@ public class Launcher extends Activity
public void setDynamicGridSize(DeviceProfile.GridSize size) {
int gridSize = SettingsProvider.getIntCustomDefault(this,
SettingsProvider.SETTINGS_UI_DYNAMIC_GRID_SIZE, 0);
- if (gridSize != size.getValue()) {
+ boolean customValuesChanged = false;
+ if (gridSize == size.getValue() && size == DeviceProfile.GridSize.Custom) {
+ int tempRows = SettingsProvider.getIntCustomDefault(this,
+ SettingsProvider.SETTINGS_UI_HOMESCREEN_ROWS, (int)mGrid.numRows);
+ int tempColumns = SettingsProvider.getIntCustomDefault(this,
+ SettingsProvider.SETTINGS_UI_HOMESCREEN_COLUMNS, (int)mGrid.numColumns);
+ if (tempColumns != (int) mGrid.numColumns || tempRows != (int) mGrid.numRows) {
+ customValuesChanged = true;
+ }
+ }
+
+ if (gridSize != size.getValue() || customValuesChanged) {
SettingsProvider.putInt(this,
SettingsProvider.SETTINGS_UI_DYNAMIC_GRID_SIZE, size.getValue());