Initial implementation of new wallpaper picker.
Change-Id: Ib4c5ac4989b4959fa62465d9cde3cac662e24949
diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java
index 0c577e5..53d2ec5 100644
--- a/src/com/android/launcher3/LauncherAppState.java
+++ b/src/com/android/launcher3/LauncherAppState.java
@@ -19,6 +19,7 @@
import android.app.SearchManager;
import android.content.*;
import android.content.res.Configuration;
+import android.content.res.Resources;
import android.database.ContentObserver;
import android.os.Handler;
import android.provider.Settings;
@@ -76,7 +77,7 @@
}
// set sIsScreenXLarge and mScreenDensity *before* creating icon cache
- mIsScreenLarge = sContext.getResources().getBoolean(R.bool.is_large_tablet);
+ mIsScreenLarge = isScreenLarge(sContext.getResources());
mScreenDensity = sContext.getResources().getDisplayMetrics().density;
mWidgetPreviewCacheDb = new WidgetPreviewLoader.CacheDb(sContext);
@@ -188,6 +189,11 @@
return mIsScreenLarge;
}
+ // Need a version that doesn't require an instance of LauncherAppState for the wallpaper picker
+ public static boolean isScreenLarge(Resources res) {
+ return res.getBoolean(R.bool.is_large_tablet);
+ }
+
public static boolean isScreenLandscape(Context context) {
return context.getResources().getConfiguration().orientation ==
Configuration.ORIENTATION_LANDSCAPE;