diff options
author | Wu-cheng Li <wuchengli@google.com> | 2011-01-25 19:29:28 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-01-25 19:29:28 -0800 |
commit | 14afb74921954d8d54d07be05b0abc7105f5bc8f (patch) | |
tree | 2853b295fd00d88ae3507b1b84e5a82d5000f41d | |
parent | 5ef59c58e2a6b1e426a54f37d9d798989d85f96d (diff) | |
parent | 89042609715b696e8ed6bbc7e6ed8f582d480fbe (diff) | |
download | LegacyCamera-14afb74921954d8d54d07be05b0abc7105f5bc8f.zip LegacyCamera-14afb74921954d8d54d07be05b0abc7105f5bc8f.tar.gz LegacyCamera-14afb74921954d8d54d07be05b0abc7105f5bc8f.tar.bz2 |
am 89042609: am de0d58c0: Merge "Fix NPE in BasicSettingPopup." into honeycomb
* commit '89042609715b696e8ed6bbc7e6ed8f582d480fbe':
Fix NPE in BasicSettingPopup.
-rw-r--r-- | AndroidManifest.xml | 6 | ||||
-rw-r--r-- | res/layout-xlarge/basic_setting_popup.xml | 3 | ||||
-rw-r--r-- | src/com/android/camera/Camera.java | 2 | ||||
-rw-r--r-- | src/com/android/camera/ui/BasicSettingPopup.java | 15 |
4 files changed, 13 insertions, 13 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 6cba728..23ede92 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -30,7 +30,8 @@ android:theme="@style/ThemeCamera" android:screenOrientation="landscape" android:clearTaskOnLaunch="true" - android:taskAffinity="android.task.camera"> + android:taskAffinity="android.task.camera" + android:windowSoftInputMode="stateAlwaysHidden|adjustPan"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> @@ -52,7 +53,8 @@ android:theme="@style/ThemeCamera" android:screenOrientation="landscape" android:clearTaskOnLaunch="true" - android:taskAffinity="android.task.camcorder"> + android:taskAffinity="android.task.camcorder" + android:windowSoftInputMode="stateAlwaysHidden|adjustPan"> <intent-filter> <action android:name="android.media.action.VIDEO_CAMERA" /> <category android:name="android.intent.category.DEFAULT" /> diff --git a/res/layout-xlarge/basic_setting_popup.xml b/res/layout-xlarge/basic_setting_popup.xml index d18dae2..9be5ada 100644 --- a/res/layout-xlarge/basic_setting_popup.xml +++ b/res/layout-xlarge/basic_setting_popup.xml @@ -43,6 +43,7 @@ android:paddingBottom="3dp" android:layout_gravity="center" android:layout_width="match_parent" - android:layout_height="wrap_content" /> + android:layout_height="wrap_content" + android:choiceMode="singleChoice" /> </FrameLayout> </com.android.camera.ui.BasicSettingPopup> diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java index 5fdf8a5..84456e3 100644 --- a/src/com/android/camera/Camera.java +++ b/src/com/android/camera/Camera.java @@ -1630,6 +1630,8 @@ public class Camera extends NoSearchActivity implements View.OnClickListener, return; } + Log.v(TAG, "surfaceChanged. w=" + w + ". h=" + h); + // We need to save the holder for later use, even when the mCameraDevice // is null. This could happen if onResume() is invoked after this // function. diff --git a/src/com/android/camera/ui/BasicSettingPopup.java b/src/com/android/camera/ui/BasicSettingPopup.java index b3dfb77..83c5f95 100644 --- a/src/com/android/camera/ui/BasicSettingPopup.java +++ b/src/com/android/camera/ui/BasicSettingPopup.java @@ -76,6 +76,11 @@ public class BasicSettingPopup extends AbstractSettingPopup implements ((ListView) mSettingList).setAdapter(listItemAdapter); ((ListView) mSettingList).setOnItemClickListener(this); ((ListView) mSettingList).setSelector(android.R.color.transparent); + int index = mPreference.findIndexOfValue(mPreference.getValue()); + if (index != -1) { + ((ListView) mSettingList).setItemChecked(index, true); + } + } public void setSettingChangedListener(Listener listener) { @@ -83,14 +88,6 @@ public class BasicSettingPopup extends AbstractSettingPopup implements } @Override - public void onLayout(boolean changed, int l, int t, int r, int b) { - super.onLayout(changed, l, t, r, b); - int index = mPreference.findIndexOfValue(mPreference.getValue()); - View selected = ((ListView) mSettingList).getChildAt(index); - if (selected != null) selected.setActivated(true); - } - - @Override public void onItemClick(AdapterView<?> parent, View view, int index, long id) { // If popup window is dismissed, ignore the event. This may happen when @@ -99,10 +96,8 @@ public class BasicSettingPopup extends AbstractSettingPopup implements int oldIndex = mPreference.findIndexOfValue(mPreference.getValue()); if (oldIndex != index) { - ((LinearLayout) parent.getChildAt(oldIndex)).setActivated(false); mPreference.setValueIndex(index); if (mListener != null) mListener.onSettingChanged(); } - view.setActivated(true); } } |