summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriele M <moto.falcon.git@gmail.com>2017-04-05 22:40:46 +0200
committerDaniel Hillenbrand <daniel.hillenbrand@codeworkx.de>2017-04-10 17:07:12 +0000
commit2ecc334e45ba916670433acf762a73b798491dbf (patch)
tree41a995a4cf0c5f01632716467c00082329407d8b
parent7e10f005f68bda44fbaaa9120ae7cd6e8442844c (diff)
downloadandroid_packages_apps_Snap-2ecc334e45ba916670433acf762a73b798491dbf.zip
android_packages_apps_Snap-2ecc334e45ba916670433acf762a73b798491dbf.tar.gz
android_packages_apps_Snap-2ecc334e45ba916670433acf762a73b798491dbf.tar.bz2
CameraControls: Toggle the status of disabled views
If we toggle the status of all the visible views, we might enable views that were disabled for some specific reason. Save the list of views that we disabled and re-enable only those views. Change-Id: I50fad8e93f89fd9e872ab2fb4f1cb6cd6c9c3f9f
-rw-r--r--src/com/android/camera/ui/CameraControls.java18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/com/android/camera/ui/CameraControls.java b/src/com/android/camera/ui/CameraControls.java
index 763abe9..c5a6d9b 100644
--- a/src/com/android/camera/ui/CameraControls.java
+++ b/src/com/android/camera/ui/CameraControls.java
@@ -80,6 +80,7 @@ public class CameraControls extends RotatableLayout {
private View mReviewRetakeButton;
private final List<View> mViews = new ArrayList<>();
+ private final List<View> mViewsDisabled = new ArrayList<>();
private static final int WIDTH_GRID = 5;
private static final int HEIGHT_GRID = 7;
@@ -146,10 +147,18 @@ public class CameraControls extends RotatableLayout {
public void enableTouch(boolean enable) {
synchronized (mViews) {
- for (View v : mViews) {
- if (v.getVisibility() != View.GONE) {
- v.setEnabled(enable);
+ if (!enable) {
+ for (View v : mViews) {
+ if (v.getVisibility() != View.GONE && v.isEnabled()) {
+ mViewsDisabled.add(v);
+ v.setEnabled(false);
+ }
}
+ } else {
+ for (View v : mViewsDisabled) {
+ v.setEnabled(true);
+ }
+ mViewsDisabled.clear();
}
}
@@ -165,6 +174,9 @@ public class CameraControls extends RotatableLayout {
public void removeFromViewList(View view) {
synchronized (mViews) {
+ if (mViewsDisabled.contains(view)) {
+ mViewsDisabled.remove(view);
+ }
if (view == null || !mViews.contains(view)) {
return;
}