OSDN Git Service

Added serialization IDs for frames, adds frames to analytics.
authorRuben Brunk <rubenbrunk@google.com>
Mon, 17 Jun 2013 21:32:37 +0000 (14:32 -0700)
committerRuben Brunk <rubenbrunk@google.com>
Mon, 17 Jun 2013 21:41:32 +0000 (14:41 -0700)
Bug: 9467671
Change-Id: I6f21e7bc9ca7255a290ba7cd1a94e9b07e7b06cb

src/com/android/gallery3d/filtershow/imageshow/MasterImage.java
src/com/android/gallery3d/filtershow/presets/ImagePreset.java
src_pd/com/android/gallery3d/filtershow/filters/FiltersManager.java

index 8f490ca..4ea944b 100644 (file)
@@ -140,7 +140,9 @@ public class MasterImage implements RenderingRequestCaller {
     }
 
     public synchronized void setPreset(ImagePreset preset, boolean addToHistory) {
-        preset.showFilters();
+        if (DEBUG) {
+            preset.showFilters();
+        }
         mPreset = preset;
         mPreset.setImageLoader(mLoader);
         setGeometry();
index 5eddc91..00effa8 100644 (file)
@@ -471,7 +471,7 @@ public class ImagePreset {
             bitmap = environment.applyRepresentation(mBorder, bitmap);
             if (environment.getQuality() == FilterEnvironment.QUALITY_FINAL) {
                 UsageStatistics.onEvent(UsageStatistics.COMPONENT_EDITOR,
-                        "SaveBorder", mBorder.getName(), 1);
+                        "SaveBorder", mBorder.getSerializationName(), 1);
             }
         }
         return bitmap;
index 97588db..c5a6435 100644 (file)
@@ -50,25 +50,71 @@ public class FiltersManager extends BaseFiltersManager {
 
     @Override
     public void addBorders(Context context, Vector<FilterRepresentation> representations) {
+
+        // Do not localize
+        String[] serializationNames = {
+                "FRAME_4X5",
+                "FRAME_BRUSH",
+                "FRAME_GRUNGE",
+                "FRAME_SUMI_E",
+                "FRAME_TAPE",
+                "FRAME_BLACK",
+                "FRAME_BLACK_ROUNDED",
+                "FRAME_WHITE",
+                "FRAME_WHITE_ROUNDED",
+                "FRAME_CREAM",
+                "FRAME_CREAM_ROUNDED"
+        };
+
+        int i = 0;
         // Regular borders
-        representations.add(new FilterImageBorderRepresentation(R.drawable.filtershow_border_4x5));
-        representations.add(
-                new FilterImageBorderRepresentation(R.drawable.filtershow_border_brush));
-        representations.add(
-                new FilterImageBorderRepresentation(R.drawable.filtershow_border_grunge));
-        representations.add(
-                new FilterImageBorderRepresentation(R.drawable.filtershow_border_sumi_e));
-        representations.add(new FilterImageBorderRepresentation(R.drawable.filtershow_border_tape));
-        representations.add(new FilterColorBorderRepresentation(Color.BLACK, mImageBorderSize, 0));
-        representations.add(new FilterColorBorderRepresentation(Color.BLACK, mImageBorderSize,
-                mImageBorderSize));
-        representations.add(new FilterColorBorderRepresentation(Color.WHITE, mImageBorderSize, 0));
-        representations.add(new FilterColorBorderRepresentation(Color.WHITE, mImageBorderSize,
-                mImageBorderSize));
+        FilterRepresentation rep = new FilterImageBorderRepresentation(R.drawable.filtershow_border_4x5);
+        rep.setSerializationName(serializationNames[i++]);
+        representations.add(rep);
+
+        rep = new FilterImageBorderRepresentation(R.drawable.filtershow_border_brush);
+        rep.setSerializationName(serializationNames[i++]);
+        representations.add(rep);
+
+        rep = new FilterImageBorderRepresentation(R.drawable.filtershow_border_grunge);
+        rep.setSerializationName(serializationNames[i++]);
+        representations.add(rep);
+
+        rep = new FilterImageBorderRepresentation(R.drawable.filtershow_border_sumi_e);
+        rep.setSerializationName(serializationNames[i++]);
+        representations.add(rep);
+
+        rep = new FilterImageBorderRepresentation(R.drawable.filtershow_border_tape);
+        rep.setSerializationName(serializationNames[i++]);
+        representations.add(rep);
+
+        rep = new FilterColorBorderRepresentation(Color.BLACK, mImageBorderSize, 0);
+        rep.setSerializationName(serializationNames[i++]);
+        representations.add(rep);
+
+        rep = new FilterColorBorderRepresentation(Color.BLACK, mImageBorderSize,
+                mImageBorderSize);
+        rep.setSerializationName(serializationNames[i++]);
+        representations.add(rep);
+
+        rep = new FilterColorBorderRepresentation(Color.WHITE, mImageBorderSize, 0);
+        rep.setSerializationName(serializationNames[i++]);
+        representations.add(rep);
+
+        rep = new FilterColorBorderRepresentation(Color.WHITE, mImageBorderSize,
+                mImageBorderSize);
+        rep.setSerializationName(serializationNames[i++]);
+        representations.add(rep);
+
         int creamColor = Color.argb(255, 237, 237, 227);
-        representations.add(new FilterColorBorderRepresentation(creamColor, mImageBorderSize, 0));
-        representations.add(new FilterColorBorderRepresentation(creamColor, mImageBorderSize,
-                mImageBorderSize));
+        rep = new FilterColorBorderRepresentation(creamColor, mImageBorderSize, 0);
+        rep.setSerializationName(serializationNames[i++]);
+        representations.add(rep);
+
+        rep = new FilterColorBorderRepresentation(creamColor, mImageBorderSize,
+                mImageBorderSize);
+        rep.setSerializationName(serializationNames[i++]);
+        representations.add(rep);
     }
 
     public static FiltersManager getHighresManager() {