OSDN Git Service

Merge "add Grad filter" into gb-ub-photos-carlsbad
[android-x86/packages-apps-Gallery2.git] / src / com / android / gallery3d / filtershow / FilterShowActivity.java
index c03ba78..8bbdd0c 100644 (file)
@@ -58,6 +58,7 @@ import android.widget.Toast;
 import com.android.gallery3d.R;
 import com.android.gallery3d.app.PhotoPage;
 import com.android.gallery3d.data.LocalAlbum;
+import com.android.gallery3d.filtershow.editors.EditorGrad;
 import com.android.gallery3d.filtershow.pipeline.CachingPipeline;
 import com.android.gallery3d.filtershow.cache.ImageLoader;
 import com.android.gallery3d.filtershow.category.Action;
@@ -376,6 +377,7 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
     }
 
     private void fillEditors() {
+        mEditorPlaceHolder.addEditor(new EditorGrad());
         mEditorPlaceHolder.addEditor(new EditorDraw());
         mEditorPlaceHolder.addEditor(new BasicEditor());
         mEditorPlaceHolder.addEditor(new ImageOnlyEditor());
@@ -815,6 +817,14 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
                         mShowingImageStatePanel ? "ShowPanel" : "HidePanel");
                 return true;
             }
+            case R.id.exportFlattenButton: {
+                Uri sourceUri = MasterImage.getImage().getUri();
+                File dest = SaveImage.getNewFile(this, sourceUri);
+                Intent processIntent = ProcessingService.getSaveIntent(this, MasterImage.getImage()
+                        .getPreset(), dest, getSelectedImageUri(), sourceUri, true);
+                startService(processIntent);
+                return true;
+            }
             case android.R.id.home: {
                 saveImage();
                 return true;
@@ -889,6 +899,7 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
         super.onConfigurationChanged(newConfig);
         setDefaultValues();
         loadXML();
+        fillCategories();
         loadMainPanel();
 
         // mLoadBitmapTask==null implies you have looked at the intent