summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/LauncherAppState.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2013-10-25 15:24:24 -0700
committerWinson Chung <winsonc@google.com>2013-10-28 18:30:25 -0700
commit6e1c0d34bb31cacc24c57c89ab01deaa8985814f (patch)
tree71e51b408e5466f1a6ddde1bb5b8d46d420a77b2 /src/com/android/launcher3/LauncherAppState.java
parent1c6dee72042cb20cd8ce12064305acdade7ebb8a (diff)
downloadandroid_packages_apps_Trebuchet-6e1c0d34bb31cacc24c57c89ab01deaa8985814f.tar.gz
android_packages_apps_Trebuchet-6e1c0d34bb31cacc24c57c89ab01deaa8985814f.tar.bz2
android_packages_apps_Trebuchet-6e1c0d34bb31cacc24c57c89ab01deaa8985814f.zip
Initial changes to support smaller landscape layouts.
Change-Id: If0abe2b82eb08bae4f1ce65b805362d548acb876
Diffstat (limited to 'src/com/android/launcher3/LauncherAppState.java')
-rw-r--r--src/com/android/launcher3/LauncherAppState.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java
index a255b89a2..fe2b43fe4 100644
--- a/src/com/android/launcher3/LauncherAppState.java
+++ b/src/com/android/launcher3/LauncherAppState.java
@@ -28,7 +28,7 @@ import android.view.Display;
import java.lang.ref.WeakReference;
-public class LauncherAppState {
+public class LauncherAppState implements DeviceProfile.DeviceProfileCallbacks {
private static final String TAG = "LauncherAppState";
private static final String SHARED_PREFERENCES_KEY = "com.android.launcher3.prefs";
@@ -182,12 +182,12 @@ public class LauncherAppState {
context.getResources(),
minWidth, minHeight, width, height,
availableWidth, availableHeight);
+ mDynamicGrid.getDeviceProfile().addCallback(this);
}
// Update the icon size
DeviceProfile grid = mDynamicGrid.getDeviceProfile();
- Utilities.setIconSize(grid.iconSizePx);
- grid.updateFromConfiguration(context.getResources(), width, height,
+ grid.updateFromConfiguration(context, context.getResources(), width, height,
availableWidth, availableHeight);
return grid;
}
@@ -216,4 +216,9 @@ public class LauncherAppState {
public int getLongPressTimeout() {
return mLongPressTimeout;
}
+
+ @Override
+ public void onAvailableSizeChanged(DeviceProfile grid) {
+ Utilities.setIconSize(grid.iconSizePx);
+ }
}