summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authornicolasroard <nicolasroard@google.com>2013-09-13 17:24:11 -0700
committernicolasroard <nicolasroard@google.com>2013-09-13 20:22:10 -0700
commite30a1cc28e6724d54ba5b20e73d303e734c05559 (patch)
tree32a59b77c316a11c23e90cd555804c86db6efb58 /src
parentedf4b095a1d904df6c02d49e3ec575c5c3c9c749 (diff)
downloadandroid_packages_apps_Gallery2-e30a1cc28e6724d54ba5b20e73d303e734c05559.tar.gz
android_packages_apps_Gallery2-e30a1cc28e6724d54ba5b20e73d303e734c05559.tar.bz2
android_packages_apps_Gallery2-e30a1cc28e6724d54ba5b20e73d303e734c05559.zip
Fix show original
Change-Id: Ie3ed508c6a60a06f3bc33fb1b017be219a4c2044
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/filtershow/state/StateView.java33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/com/android/gallery3d/filtershow/state/StateView.java b/src/com/android/gallery3d/filtershow/state/StateView.java
index 7d209ba89..56c97ab62 100644
--- a/src/com/android/gallery3d/filtershow/state/StateView.java
+++ b/src/com/android/gallery3d/filtershow/state/StateView.java
@@ -19,11 +19,8 @@ package com.android.gallery3d.filtershow.state;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.*;
-import android.util.AttributeSet;
-import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
-import android.view.ViewParent;
import android.widget.LinearLayout;
import com.android.gallery3d.R;
import com.android.gallery3d.filtershow.FilterShowActivity;
@@ -293,9 +290,6 @@ public class StateView extends View implements SwipableView {
if (event.getActionMasked() == MotionEvent.ACTION_UP) {
activity.startTouchAnimation(this, event.getX(), event.getY());
}
- if (mType == BEGIN) {
- return ret;
- }
if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
mStartTouchY = event.getY();
mStartTouchX = event.getX();
@@ -303,23 +297,26 @@ public class StateView extends View implements SwipableView {
MasterImage.getImage().setShowsOriginal(true);
}
}
- if (event.getActionMasked() == MotionEvent.ACTION_UP) {
+ if (event.getActionMasked() == MotionEvent.ACTION_UP
+ || event.getActionMasked() == MotionEvent.ACTION_CANCEL) {
setTranslationX(0);
setTranslationY(0);
MasterImage.getImage().setShowsOriginal(false);
- setSelected(true);
- FilterRepresentation representation = getState().getFilterRepresentation();
- MasterImage image = MasterImage.getImage();
- ImagePreset preset = image != null ? image.getCurrentPreset() : null;
- if (getTranslationY() == 0
- && image != null && preset != null
- && representation != image.getCurrentFilterRepresentation()
- && preset.getRepresentation(representation) != null) {
- activity.showRepresentation(representation);
- setSelected(false);
+ if (mType != BEGIN && event.getActionMasked() == MotionEvent.ACTION_UP) {
+ setSelected(true);
+ FilterRepresentation representation = getState().getFilterRepresentation();
+ MasterImage image = MasterImage.getImage();
+ ImagePreset preset = image != null ? image.getCurrentPreset() : null;
+ if (getTranslationY() == 0
+ && image != null && preset != null
+ && representation != image.getCurrentFilterRepresentation()
+ && preset.getRepresentation(representation) != null) {
+ activity.showRepresentation(representation);
+ setSelected(false);
+ }
}
}
- if (event.getActionMasked() == MotionEvent.ACTION_MOVE) {
+ if (mType != BEGIN && event.getActionMasked() == MotionEvent.ACTION_MOVE) {
float delta = event.getY() - mStartTouchY;
if (Math.abs(delta) > mDeleteSlope) {
activity.setHandlesSwipeForView(this, mStartTouchX, mStartTouchY);