summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/Camera.java3
-rw-r--r--src/com/android/camera/VideoCamera.java2
-rw-r--r--src/com/android/camera/ui/ControlPanel.java13
-rw-r--r--src/com/android/camera/ui/OtherSettingsPopup.java10
4 files changed, 24 insertions, 4 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index c776225..f99407c 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -1111,6 +1111,8 @@ public class Camera extends NoSearchActivity implements View.OnClickListener,
// ignore
}
+ // Do this after starting preview because it depends on camera
+ // parameters.
initializeControlPanel();
}
@@ -2285,6 +2287,7 @@ public class Camera extends NoSearchActivity implements View.OnClickListener,
if (mFirstTimeInitialized) {
initializeHeadUpDisplay();
}
+ initializeControlPanel();
}
private boolean switchToVideoMode() {
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java
index e2732e3..6ce1641 100644
--- a/src/com/android/camera/VideoCamera.java
+++ b/src/com/android/camera/VideoCamera.java
@@ -1224,6 +1224,7 @@ public class VideoCamera extends NoSearchActivity
// Reload the UI.
initializeHeadUpDisplay();
+ initializeControlPanel();
if (mSurfaceHolder != null) {
mHandler.sendEmptyMessage(INIT_RECORDER);
@@ -1251,6 +1252,7 @@ public class VideoCamera extends NoSearchActivity
// Reload the UI.
initializeHeadUpDisplay();
+ initializeControlPanel();
if (mSurfaceHolder != null) {
mHandler.sendEmptyMessage(INIT_RECORDER);
diff --git a/src/com/android/camera/ui/ControlPanel.java b/src/com/android/camera/ui/ControlPanel.java
index b280de7..cdd00d9 100644
--- a/src/com/android/camera/ui/ControlPanel.java
+++ b/src/com/android/camera/ui/ControlPanel.java
@@ -83,9 +83,19 @@ public class ControlPanel extends RelativeLayout
public void initialize(Context context, PreferenceGroup group,
String[] keys, boolean enableOtherSettings) {
+ // Reset the variables and states.
+ hideSettingPicker();
+ if (mIndicatorWheel != null) {
+ // The first view is the shutter button.
+ mIndicatorWheel.removeViews(1, mIndicatorWheel.getChildCount() - 1);
+ }
+ mOtherSettingsPopup = null;
+ mSettingPickers = null;
+ mActiveIndicator = -1;
+
+ // Initialize all variables and icons.
mPreferenceGroup = group;
mPreferenceKeys = keys;
- // Add one more for other settings.
mSettingPickers = new BasicSettingPicker[mPreferenceKeys.length];
mIndicatorWheel = (IndicatorWheel) findViewById(R.id.indicator_wheel);
mThumbnailList = (ListView) findViewById(R.id.thumbnail_list);
@@ -122,6 +132,7 @@ public class ControlPanel extends RelativeLayout
break;
}
}
+
public void onIndicatorClicked(int index) {
if (!mEnabled) return;
if (index < mSettingPickers.length) {
diff --git a/src/com/android/camera/ui/OtherSettingsPopup.java b/src/com/android/camera/ui/OtherSettingsPopup.java
index f5a83ef..feacb6b 100644
--- a/src/com/android/camera/ui/OtherSettingsPopup.java
+++ b/src/com/android/camera/ui/OtherSettingsPopup.java
@@ -47,12 +47,16 @@ public class OtherSettingsPopup extends PopupWindow
public void initialize(PreferenceGroup group) {
TableLayout table = (TableLayout) getContentView();
// Initialize each camera setting.
- for (int i = 0; i < table.getChildCount(); i++) {
+ for (int i = table.getChildCount() - 1; i >= 0 ; i--) {
TableRow row = (TableRow) table.getChildAt(i);
InLineSettingPicker picker = (InLineSettingPicker) row.getChildAt(1);
ListPreference pref = group.findPreference(picker.getKey());
- picker.setSettingChangedListener(this);
- picker.initialize(pref);
+ if (pref != null) {
+ picker.setSettingChangedListener(this);
+ picker.initialize(pref);
+ } else { // remove the row if the preference is not supported
+ table.removeViewAt(i);
+ }
}
}