Various cleanups in the drag viz code.
Most importantly: - Don't allocate a new Paint object in CellLayout.onDraw - Scale holographic outlines based on the screen density
This commit is contained in:
1 parent
ce34a9768b
commit
8e58e91606
4 files changed
+44
-26
No files matched your search
@@ -29,6 +29,7 @@ public class LauncherApplication extends Application {
|
||||
public LauncherModel mModel;
|
||||
public IconCache mIconCache;
|
||||
private static boolean sIsScreenXLarge;
|
||||
private static float sScreenDensity;
|
||||
private static final boolean ENABLE_ROTATION = false;
|
||||
|
||||
@Override
|
||||
@@ -40,6 +41,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;
|
||||
sScreenDensity = getResources().getDisplayMetrics().density;
|
||||
|
||||
// Register intent receivers
|
||||
IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED);
|
||||
@@ -101,4 +103,8 @@ public class LauncherApplication extends Application {
|
||||
public static boolean isScreenXLarge() {
|
||||
return sIsScreenXLarge;
|
||||
}
|
||||
|
||||
public static float getScreenDensity() {
|
||||
return sScreenDensity;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user