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:
Patrick Dubroy
2010-10-14 13:21:48 -07:00
parent ce34a9768b
commit 8e58e91606
4 changed files with 44 additions and 26 deletions

View File

@@ -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;
}
}