diff options
author | Winson Chung <winsonc@google.com> | 2010-06-11 17:34:16 -0700 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2010-06-30 16:24:40 -0700 |
commit | aafa03cbb925c74be1c13f8bb99d928be429e62f (patch) | |
tree | 7d63432c1439f2249b506eeb7109d40e947a037f /src/com/android/launcher2/LauncherApplication.java | |
parent | 6404116682ff30f9e2170c68a1b56dfa7c6836cc (diff) | |
download | android_packages_apps_Trebuchet-aafa03cbb925c74be1c13f8bb99d928be429e62f.tar.gz android_packages_apps_Trebuchet-aafa03cbb925c74be1c13f8bb99d928be429e62f.tar.bz2 android_packages_apps_Trebuchet-aafa03cbb925c74be1c13f8bb99d928be429e62f.zip |
Allow for NxM layout and in-place rotation of items on homescreen.
Currently, rotation is disabled as designs are still in flux, but the NxM grid is enabled (8x4).
Change-Id: I0026f88c674719e3d67de6d6d481d2d4cd606362
Diffstat (limited to 'src/com/android/launcher2/LauncherApplication.java')
-rw-r--r-- | src/com/android/launcher2/LauncherApplication.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/launcher2/LauncherApplication.java b/src/com/android/launcher2/LauncherApplication.java index eda92d999..ca08378d8 100644 --- a/src/com/android/launcher2/LauncherApplication.java +++ b/src/com/android/launcher2/LauncherApplication.java @@ -20,6 +20,7 @@ import android.app.Application; import android.content.ContentResolver; import android.content.Intent; import android.content.IntentFilter; +import android.content.res.Configuration; import android.database.ContentObserver; import android.os.Handler; import dalvik.system.VMRuntime; @@ -27,6 +28,8 @@ import dalvik.system.VMRuntime; public class LauncherApplication extends Application { public LauncherModel mModel; public IconCache mIconCache; + private static boolean sIsScreenXLarge; + private static final boolean ENABLE_ROTATION = false; @Override public void onCreate() { @@ -36,6 +39,7 @@ public class LauncherApplication extends Application { mIconCache = new IconCache(this); mModel = new LauncherModel(this, mIconCache); + sIsScreenXLarge = (getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE; // Register intent receivers IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED); @@ -89,4 +93,12 @@ public class LauncherApplication extends Application { LauncherModel getModel() { return mModel; } + + public static boolean isInPlaceRotationEnabled() { + return sIsScreenXLarge && ENABLE_ROTATION; + } + + public static boolean isScreenXLarge() { + return sIsScreenXLarge; + } } |