summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorOwen Lin <owenlin@google.com>2009-11-19 13:24:55 +0800
committerOwen Lin <owenlin@google.com>2009-11-20 11:00:22 +0800
commit503560f0dc42d6185c61be06f8060dfd50d30d69 (patch)
tree8c6a10f96c8a3d5b455cb8b86e94a7709aca4630 /src/com
parent3e44f8076a16792bb295589ca4b467ba27ea2a6f (diff)
downloadLegacyCamera-503560f0dc42d6185c61be06f8060dfd50d30d69.zip
LegacyCamera-503560f0dc42d6185c61be06f8060dfd50d30d69.tar.gz
LegacyCamera-503560f0dc42d6185c61be06f8060dfd50d30d69.tar.bz2
Keep space for those empty icons but hide them if the feature is not
supported. fix bug: http://b/2250438 Change-Id: I79eb9d575cf275c25decc6236b80f61ecfdf3042
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/camera/Camera.java22
-rw-r--r--src/com/android/camera/IconIndicator.java9
-rw-r--r--src/com/android/camera/VideoCamera.java7
3 files changed, 30 insertions, 8 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index 7e2d69b..3de6bae 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -981,6 +981,25 @@ public class Camera extends Activity implements View.OnClickListener,
} catch (InterruptedException ex) {
// ignore
}
+ removeUnsupportedIndicators();
+ }
+
+ private void removeUnsupportedIndicators() {
+ if (mParameters.getSupportedFocusModes() == null) {
+ mFocusIndicator.setVisibility(View.GONE);
+ }
+
+ if (mParameters.getSupportedWhiteBalance() == null) {
+ mWhitebalanceIndicator.setVisibility(View.GONE);
+ }
+
+ if (mParameters.getSupportedFlashModes() == null) {
+ mFlashIndicator.setVisibility(View.GONE);
+ }
+
+ if (mParameters.getSupportedSceneModes() == null) {
+ mSceneModeIndicator.setVisibility(View.GONE);
+ }
}
private class GripperTouchListener implements View.OnTouchListener {
@@ -1825,7 +1844,8 @@ public class Camera extends Activity implements View.OnClickListener,
} else {
flashMode = mParameters.getFlashMode();
if (flashMode == null) {
- flashMode = Parameters.FLASH_MODE_OFF;
+ flashMode = getString(
+ R.string.pref_camera_flashmode_no_flash);
}
}
diff --git a/src/com/android/camera/IconIndicator.java b/src/com/android/camera/IconIndicator.java
index e4500e4..f21269e 100644
--- a/src/com/android/camera/IconIndicator.java
+++ b/src/com/android/camera/IconIndicator.java
@@ -40,7 +40,7 @@ public class IconIndicator extends ImageView {
a.recycle();
setModesAndIcons(modes, icons);
- setImageDrawable(mIcons.length > 0 ? mIcons[0]: null);
+ setImageDrawable(mIcons.length > 0 ? mIcons[0] : null);
}
public IconIndicator(Context context, AttributeSet attrs) {
@@ -70,12 +70,7 @@ public class IconIndicator extends ImageView {
public void setMode(String mode) {
for (int i = 0, n = mModes.length; i < n; ++i) {
if (mModes[i].equals(mode)) {
- if (mIcons[i] != null) {
- setVisibility(View.VISIBLE);
- setImageDrawable(mIcons[i]);
- } else {
- setVisibility(View.GONE);
- }
+ setImageDrawable(mIcons[i]);
return;
}
}
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java
index f065f90..8effd3c 100644
--- a/src/com/android/camera/VideoCamera.java
+++ b/src/com/android/camera/VideoCamera.java
@@ -325,6 +325,13 @@ public class VideoCamera extends Activity implements View.OnClickListener,
} catch (InterruptedException ex) {
// ignore
}
+ removeUnsupportedIndicators();
+ }
+
+ private void removeUnsupportedIndicators() {
+ if (mParameters.getSupportedWhiteBalance() == null) {
+ mWhitebalanceIndicator.setVisibility(View.GONE);
+ }
}
@Override