diff options
| author | nicolasroard <nicolasroard@google.com> | 2013-08-14 16:43:07 -0700 |
|---|---|---|
| committer | nicolasroard <nicolasroard@google.com> | 2013-08-14 16:44:25 -0700 |
| commit | 20667d21eac2074b0e265d8839539bd9cfec9f92 (patch) | |
| tree | 52bdef393d5356d0ecee9aadc852394196b41688 /src | |
| parent | e19cb8725655869092a73bed24a66395dd89013c (diff) | |
| download | android_packages_apps_Gallery2-20667d21eac2074b0e265d8839539bd9cfec9f92.tar.gz android_packages_apps_Gallery2-20667d21eac2074b0e265d8839539bd9cfec9f92.tar.bz2 android_packages_apps_Gallery2-20667d21eac2074b0e265d8839539bd9cfec9f92.zip | |
Fix problem with state panel navigation
Change-Id: Ia117bb087ca27cfe439bd39b1cd40ab33f4def4e
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/gallery3d/filtershow/FilterShowActivity.java | 8 | ||||
| -rw-r--r-- | src/com/android/gallery3d/filtershow/state/StatePanelTrack.java | 7 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java index 523b00e6e..d90dd61a3 100644 --- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java +++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java @@ -605,8 +605,12 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL // Don't just update the filter representation. Centralize the // logic in the addFilter(), such that we can keep "None" as // null. - copy.removeFilter(representation); - copy.addFilter(filterRepresentation); + if (!representation.equals(filterRepresentation)) { + // Only do this if the filter isn't the same + // (state panel clicks can lead us here) + copy.removeFilter(representation); + copy.addFilter(filterRepresentation); + } } } MasterImage.getImage().setPreset(copy, filterRepresentation, true); diff --git a/src/com/android/gallery3d/filtershow/state/StatePanelTrack.java b/src/com/android/gallery3d/filtershow/state/StatePanelTrack.java index fff7e7f5f..4ddb363db 100644 --- a/src/com/android/gallery3d/filtershow/state/StatePanelTrack.java +++ b/src/com/android/gallery3d/filtershow/state/StatePanelTrack.java @@ -58,6 +58,7 @@ public class StatePanelTrack extends LinearLayout implements PanelTrack { private long mTouchTime; private int mMaxTouchDelay = 300; // 300ms delay for touch private static final boolean ALLOWS_DRAG = false; + private static final boolean ALLOWS_DUPLICATES = false; private DataSetObserver mObserver = new DataSetObserver() { @Override public void onChanged() { @@ -104,6 +105,9 @@ public class StatePanelTrack extends LinearLayout implements PanelTrack { } private void addDuplicate(MotionEvent e) { + if (!ALLOWS_DUPLICATES) { + return; + } if (mCurrentSelectedView == null) { return; } @@ -115,6 +119,9 @@ public class StatePanelTrack extends LinearLayout implements PanelTrack { } private void longPress(MotionEvent e) { + if (!ALLOWS_DUPLICATES) { + return; + } View view = findChildAt((int) e.getX(), (int) e.getY()); if (view == null) { return; |
