summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaj Yengisetty <rajesh@cyngn.com>2015-03-02 21:49:07 -0800
committerRajesh Yengisetty <rajesh@cyngn.com>2015-03-10 17:23:19 +0000
commit0a30cc5518f03d6db1464cb2503d1db1240f2e08 (patch)
tree89d0e23075846541744157b0fe321b022492dd79
parent4f44bd18da1f6f407bc2cd3145ad5d0f28dd4835 (diff)
downloadandroid_packages_apps_Trebuchet-0a30cc5518f03d6db1464cb2503d1db1240f2e08.tar.gz
android_packages_apps_Trebuchet-0a30cc5518f03d6db1464cb2503d1db1240f2e08.tar.bz2
android_packages_apps_Trebuchet-0a30cc5518f03d6db1464cb2503d1db1240f2e08.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 (cherry picked from commit 751627337db296cc97f34be38307ad91ad64163d)
-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 737cb0d30..551430a17 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -1407,7 +1407,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());