From b1eeb6ca05d1b1e59e64680b14c8d5b341e22582 Mon Sep 17 00:00:00 2001 From: nicolasroard Date: Wed, 24 Oct 2012 11:31:57 -0700 Subject: Save the image when applying tiny planet bug:7403622 Change-Id: Ic199b163d6418b6d45c2da10b915f2088dd52e16 --- src/com/android/gallery3d/filtershow/FilterShowActivity.java | 4 +++- src/com/android/gallery3d/filtershow/PanelController.java | 12 ++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src/com/android') diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java index efcb2c3c3..0d197afee 100644 --- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java +++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java @@ -39,8 +39,8 @@ import android.view.Display; import android.view.Menu; import android.view.MenuItem; import android.view.View; -import android.view.WindowManager; import android.view.View.OnClickListener; +import android.view.WindowManager; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ImageButton; @@ -234,6 +234,8 @@ public class FilterShowActivity extends Activity implements OnItemClickListener, mImageFlip.setImageLoader(mImageLoader); mImageFlip.setMaster(mImageShow); + mPanelController.setActivity(this); + mPanelController.addImageView(findViewById(R.id.imageShow)); mPanelController.addImageView(findViewById(R.id.imageCurves)); mPanelController.addImageView(findViewById(R.id.imageBorder)); diff --git a/src/com/android/gallery3d/filtershow/PanelController.java b/src/com/android/gallery3d/filtershow/PanelController.java index 8f1bdb416..9f5f2656a 100644 --- a/src/com/android/gallery3d/filtershow/PanelController.java +++ b/src/com/android/gallery3d/filtershow/PanelController.java @@ -44,7 +44,6 @@ import com.android.gallery3d.filtershow.imageshow.ImageCrop; import com.android.gallery3d.filtershow.imageshow.ImageShow; import com.android.gallery3d.filtershow.presets.ImagePreset; import com.android.gallery3d.filtershow.ui.FramedTextButton; -import com.android.gallery3d.filtershow.ui.ImageButtonTitle; import com.android.gallery3d.filtershow.ui.ImageCurves; import java.util.HashMap; @@ -288,6 +287,11 @@ public class PanelController implements OnClickListener { private UtilityPanel mUtilityPanel = null; private ImageShow mMasterImage = null; private ImageShow mCurrentImage = null; + private FilterShowActivity mActivity = null; + + public void setActivity(FilterShowActivity activity) { + mActivity = activity; + } public void addView(View view) { view.setOnClickListener(this); @@ -696,7 +700,11 @@ public class PanelController implements OnClickListener { break; } case R.id.applyEffect: { - showPanel(mCurrentPanel); + if (mMasterImage.getCurrentFilter() instanceof ImageFilterTinyPlanet) { + mActivity.saveImage(); + } else { + showPanel(mCurrentPanel); + } break; } } -- cgit v1.2.3