OSDN Git Service

Using a negative flag for icon notmalization
authorSunny Goyal <sunnygoyal@google.com>
Thu, 3 Mar 2016 21:19:24 +0000 (13:19 -0800)
committerSunny Goyal <sunnygoyal@google.com>
Thu, 3 Mar 2016 21:30:57 +0000 (13:30 -0800)
Change-Id: Iaa94aea730d2b5cc3f15f3578f240127ca0eef63

src/com/android/launcher3/IconCache.java
src/com/android/launcher3/Utilities.java
src/com/android/launcher3/config/FeatureFlags.java
src/com/android/launcher3/folder/Folder.java

index d39ae66..f5fcf47 100644 (file)
@@ -803,7 +803,7 @@ public class IconCache {
         private final static int DB_VERSION = 7;
 
         private final static int RELEASE_VERSION = DB_VERSION +
-                (FeatureFlags.LAUNCHER3_ICON_NORMALIZATION ? 1 : 0);
+                (FeatureFlags.LAUNCHER3_DISABLE_ICON_NORMALIZATION ? 0 : 1);
 
         private final static String TABLE_NAME = "icons";
         private final static String COLUMN_ROWID = "rowid";
index d7a8a4e..ee25e81 100644 (file)
@@ -223,8 +223,8 @@ public final class Utilities {
     @TargetApi(Build.VERSION_CODES.LOLLIPOP)
     public static Bitmap createBadgedIconBitmap(
             Drawable icon, UserHandleCompat user, Context context) {
-        float scale = FeatureFlags.LAUNCHER3_ICON_NORMALIZATION ?
-                IconNormalizer.getInstance().getScale(icon) : 1;
+        float scale = FeatureFlags.LAUNCHER3_DISABLE_ICON_NORMALIZATION ?
+                1 : IconNormalizer.getInstance().getScale(icon);
         Bitmap bitmap = createIconBitmap(icon, context, scale);
         if (Utilities.ATLEAST_LOLLIPOP && user != null
                 && !UserHandleCompat.myUserHandle().equals(user)) {
index 2b3727a..386ca44 100644 (file)
@@ -32,8 +32,8 @@ public final class FeatureFlags {
 
     // Custom flags go below this
     // As opposed to the new spring-loaded workspace.
+    public static boolean LAUNCHER3_DISABLE_ICON_NORMALIZATION = false;
     public static boolean LAUNCHER3_LEGACY_WORKSPACE_DND = false;
-    public static boolean LAUNCHER3_ICON_NORMALIZATION = true;
     public static boolean LAUNCHER3_LEGACY_FOLDER_ICON = false;
     public static boolean LAUNCHER3_LEGACY_LOGGING = false;
     public static boolean LAUNCHER3_USE_SYSTEM_DRAG_DRIVER = false;
index a411c48..76140fc 100644 (file)
@@ -470,8 +470,8 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
     @SuppressLint("InflateParams")
     static Folder fromXml(Launcher launcher) {
         return (Folder) launcher.getLayoutInflater().inflate(
-                FeatureFlags.LAUNCHER3_ICON_NORMALIZATION
-                        ? R.layout.user_folder_icon_normalized : R.layout.user_folder, null);
+                FeatureFlags.LAUNCHER3_DISABLE_ICON_NORMALIZATION
+                        ? R.layout.user_folder : R.layout.user_folder_icon_normalized, null);
     }
 
     /**