import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
+import android.net.Uri;
import android.os.Handler;
import android.util.AttributeSet;
import android.view.GestureDetector;
private Bitmap mFiltersOnlyImage = null;
private Bitmap mFilteredImage = null;
- private final boolean USE_SLIDER_GESTURE = false; // set to true to have
- // slider gesture
- protected SliderController mSliderController = new SliderController();
-
private GestureDetector mGestureDetector = null;
private HistoryAdapter mHistoryAdapter = null;
private ImageStateAdapter mImageStateAdapter = null;
- private Rect mImageBounds = new Rect();
+ protected Rect mImageBounds = new Rect();
private boolean mTouchShowOriginal = false;
private long mTouchShowOriginalDate = 0;
if (currentFilter != null) {
onNewValue(currentFilter.getDefaultParameter());
}
- if (USE_SLIDER_GESTURE) {
- mSliderController.reset();
- }
}
public void setPanelController(PanelController controller) {
public ImageShow(Context context, AttributeSet attrs) {
super(context, attrs);
- if (USE_SLIDER_GESTURE) {
- mSliderController.setListener(this);
- }
mHistoryAdapter = new HistoryAdapter(context, R.layout.filtershow_history_operation_row,
R.id.rowTextView);
mImageStateAdapter = new ImageStateAdapter(context,
public ImageShow(Context context) {
super(context);
- if (USE_SLIDER_GESTURE) {
- mSliderController.setListener(this);
- }
mHistoryAdapter = new HistoryAdapter(context, R.layout.filtershow_history_operation_row,
R.id.rowTextView);
setupGestureDetector(context);
int parentWidth = MeasureSpec.getSize(widthMeasureSpec);
int parentHeight = MeasureSpec.getSize(heightMeasureSpec);
setMeasuredDimension(parentWidth, parentHeight);
- if (USE_SLIDER_GESTURE) {
- mSliderController.setWidth(parentWidth);
- mSliderController.setHeight(parentHeight);
- }
}
public void setSeekBar(SeekBar seekBar) {
return dst;
}
+ public Rect getImageCropBounds() {
+ return GeometryMath.roundNearest(getImagePreset().mGeoData.getPreviewCropBounds());
+ }
+
public Rect getDisplayedImageBounds() {
return mImageBounds;
}
1.5f * mTextPadding, mPaint);
}
- if (showControls()) {
- if (USE_SLIDER_GESTURE) {
- mSliderController.onDraw(canvas);
- }
- }
-
drawToast(canvas);
}
}
public void updateImage() {
+ invalidate();
if (!updateGeometryFlags()) {
return;
}
Bitmap bitmap = mImageLoader.getOriginalBitmapLarge();
if (bitmap != null) {
imageSizeChanged(bitmap);
- invalidate();
}
}
mImageLoader.saveImage(getImagePreset(), filterShowActivity, file);
}
+ public void saveToUri(Bitmap f, Uri u, String m, FilterShowActivity filterShowActivity) {
+ mImageLoader.saveToUri(f, u, m, filterShowActivity);
+ }
+
+ public void returnFilteredResult(FilterShowActivity filterShowActivity) {
+ mImageLoader.returnFilteredResult(getImagePreset(), filterShowActivity);
+ }
+
@Override
public boolean onTouchEvent(MotionEvent event) {
super.onTouchEvent(event);
- if (USE_SLIDER_GESTURE) {
- mSliderController.onTouchEvent(event);
- }
if (mGestureDetector != null) {
mGestureDetector.onTouchEvent(event);
}