diff options
author | Chung-yih Wang <cywang@google.com> | 2011-08-26 23:23:53 +0800 |
---|---|---|
committer | Chung-yih Wang <cywang@google.com> | 2011-09-06 12:37:43 +0800 |
commit | a8b55a9628fa7c073d4f9c97c9a198275194f76a (patch) | |
tree | 0e8d8273b71a813833af74c7f4da9043a4839127 | |
parent | fc404e9a87e2f7e1fa9bc0ede998ed9cf75a047d (diff) | |
download | packages_apps_LegacyCamera-a8b55a9628fa7c073d4f9c97c9a198275194f76a.zip packages_apps_LegacyCamera-a8b55a9628fa7c073d4f9c97c9a198275194f76a.tar.gz packages_apps_LegacyCamera-a8b55a9628fa7c073d4f9c97c9a198275194f76a.tar.bz2 |
Refactor the overflow menu for new UI.
bug:5039364
+Use Switch widget for the 'Store location' preference.
Change-Id: I031cef58ab60d62d04431d7bfe742da672899deb
22 files changed, 543 insertions, 567 deletions
diff --git a/res/layout-w1024dp/basic_setting_popup.xml b/res/layout-w1024dp/basic_setting_popup.xml deleted file mode 100644 index 8eb64e3..0000000 --- a/res/layout-w1024dp/basic_setting_popup.xml +++ /dev/null @@ -1,53 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -** -** Copyright 2010, The Android Open Source Project -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ ---> - -<com.android.camera.ui.BasicSettingPopup xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentRight="true" - android:layout_centerVertical="true" - android:visibility="gone"> - - <LinearLayout android:orientation="vertical" - android:layout_width="410dp" - android:layout_height="wrap_content"> - - <FrameLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="@drawable/dialog_top_holo_dark" - android:minHeight="48dp"> - <TextView android:id="@+id/title" - style="@style/SettingTitleText" /> - </FrameLayout> - <FrameLayout android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="@drawable/dialog_bottom_holo_dark"> - <ListView android:id="@+id/settingList" - android:orientation="vertical" - android:layout_marginLeft="16dp" - android:layout_marginRight="16dp" - android:paddingBottom="3dp" - android:layout_gravity="center" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:choiceMode="singleChoice" /> - </FrameLayout> - </LinearLayout> -</com.android.camera.ui.BasicSettingPopup> diff --git a/res/layout-w1024dp/in_line_setting_picker.xml b/res/layout-w1024dp/in_line_setting_picker.xml deleted file mode 100644 index 72432a0..0000000 --- a/res/layout-w1024dp/in_line_setting_picker.xml +++ /dev/null @@ -1,69 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -** -** Copyright 2010, The Android Open Source Project -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ ---> - -<com.android.camera.ui.InLineSettingPicker xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="wrap_content" - android:layout_height="wrap_content"> - <LinearLayout android:id="@+id/setting_item" - android:orientation="horizontal" - style="@style/SettingRow"> - <TextView android:id="@+id/title" - style="@style/SettingPickerText" - android:layout_width="220dp" - android:layout_height="match_parent" /> - - <Button android:id="@+id/decrement" - android:layout_width="72dp" - android:layout_height="match_parent" - android:layout_gravity="center_vertical" - android:gravity="center" - android:text="@string/setting_decrement" - android:textColor="@drawable/btn_setting_picker" - android:textSize="20dp" - android:textStyle="bold" - android:background="@android:color/transparent" /> - - <TextView android:id="@+id/current_setting" - android:layout_width="130dp" - android:layout_height="wrap_content" - android:layout_gravity="center_vertical" - android:gravity="center" - android:singleLine="true" - android:textColor="@android:color/white" - android:textSize="21dp" /> - - <Button android:id="@+id/increment" - android:layout_width="72dp" - android:layout_height="match_parent" - android:layout_gravity="center_vertical" - android:gravity="center" - android:text="@string/setting_increment" - android:textColor="@drawable/btn_setting_picker" - android:textSize="20dp" - android:textStyle="bold" - android:background="@android:color/transparent" /> - </LinearLayout> - <!-- To have the same View(InLineSettingPicker) as the listview's components and also show the restore setting line, we have the relativelayout and control the visibilities of the restore and the setting_item component to achieve the goal. --> - <TextView android:id="@+id/restore" - android:gravity="center" - android:textSize="21dp" - android:textColor="@android:color/white" - style="@style/SettingRow"> - </TextView> -</com.android.camera.ui.InLineSettingPicker> diff --git a/res/layout-w1024dp/other_setting_popup.xml b/res/layout-w1024dp/other_setting_popup.xml deleted file mode 100644 index 4db8689..0000000 --- a/res/layout-w1024dp/other_setting_popup.xml +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -** -** Copyright 2010, The Android Open Source Project -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ ---> - -<com.android.camera.ui.OtherSettingsPopup xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:camera="http://schemas.android.com/apk/res/com.android.camera" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentRight="true" - android:layout_centerVertical="true" - android:visibility="gone"> - - <LinearLayout android:orientation="vertical" - android:layout_width="wrap_content" - android:layout_height="wrap_content"> - - <FrameLayout - android:layout_width="590dp" - android:layout_height="wrap_content" - android:background="@drawable/dialog_top_holo_dark" - android:minHeight="48dp"> - <TextView android:id="@+id/title" - android:text="@string/pref_camera_settings_category" - style="@style/SettingTitleText" /> - </FrameLayout> - - <FrameLayout - android:layout_width="590dp" - android:layout_height="wrap_content" - android:background="@drawable/dialog_bottom_holo_dark"> - <ListView android:id="@+id/settingList" - android:orientation="vertical" - android:layout_marginLeft="16dp" - android:layout_marginRight="16dp" - android:paddingBottom="3dp" - android:layout_gravity="center" - android:layout_width="match_parent" - android:layout_height="wrap_content" /> - </FrameLayout> - </LinearLayout> -</com.android.camera.ui.OtherSettingsPopup> diff --git a/res/layout-w1024dp/setting_item.xml b/res/layout-w1024dp/setting_item.xml deleted file mode 100644 index 43e6271..0000000 --- a/res/layout-w1024dp/setting_item.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -** -** Copyright 2010, The Android Open Source Project -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ ---> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - style="@style/SettingRow"> - - <TextView android:id="@+id/text" - style="@style/SettingPickerText" - android:layout_width="267dp" - android:layout_height="match_parent"/> - <ImageView android:id="@+id/image" - android:layout_width="35dp" - android:layout_height="35dp" - android:scaleType="fitCenter" - android:adjustViewBounds="true" /> -</LinearLayout> diff --git a/res/layout/basic_setting_popup.xml b/res/layout/basic_setting_popup.xml index 9f579de..c51ff31 100644 --- a/res/layout/basic_setting_popup.xml +++ b/res/layout/basic_setting_popup.xml @@ -17,37 +17,26 @@ */ --> <com.android.camera.ui.BasicSettingPopup xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:camera="http://schemas.android.com/apk/res/com.android.camera" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_toLeftOf="@+id/indicator_control" - android:visibility="gone"> + style="@style/SettingPopupWindow"> <LinearLayout android:orientation="vertical" android:layout_height="wrap_content" - android:layout_width="240dp"> + android:layout_width="@dimen/setting_popup_window_width"> <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@drawable/dialog_top_holo_dark"> + android:background="@drawable/dialog_top_holo_dark" + android:minHeight="@dimen/popup_title_frame_min_height"> <TextView android:id="@+id/title" - style="@style/SettingTitleText" - android:textSize="18dp" - android:layout_height="32dp" /> + style="@style/PopupTitleText" /> </FrameLayout> + <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/dialog_bottom_holo_dark"> <ListView android:id="@+id/settingList" - android:orientation="vertical" - android:layout_marginLeft="6dp" - android:layout_marginRight="6dp" - android:paddingBottom="3dp" - android:layout_gravity="center" - android:layout_width="match_parent" - android:layout_height="wrap_content" + style="@style/SettingItemList" android:choiceMode="singleChoice" /> </FrameLayout> </LinearLayout> diff --git a/res/layout/in_line_setting_knob.xml b/res/layout/in_line_setting_knob.xml new file mode 100644 index 0000000..b3bfc48 --- /dev/null +++ b/res/layout/in_line_setting_knob.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<com.android.camera.ui.InLineSettingKnob xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/setting_item" + style="@style/SettingRow"> + <TextView android:id="@+id/title" + style="@style/SettingItemTitle" /> + + <Button android:id="@+id/decrement" + style="@style/SettingKnob" + android:text="@string/setting_decrement" /> + + <TextView android:id="@+id/current_setting" + style="@style/SettingItemText" /> + + <Button android:id="@+id/increment" + style="@style/SettingKnob" + android:text="@string/setting_increment" /> +</com.android.camera.ui.InLineSettingKnob> + diff --git a/res/layout/in_line_setting_picker.xml b/res/layout/in_line_setting_picker.xml deleted file mode 100644 index 239dd07..0000000 --- a/res/layout/in_line_setting_picker.xml +++ /dev/null @@ -1,74 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -** -** Copyright 2011, The Android Open Source Project -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ ---> - -<com.android.camera.ui.InLineSettingPicker xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="wrap_content" - android:layout_height="wrap_content"> - <LinearLayout android:id="@+id/setting_item" - android:orientation="horizontal" - style="@style/SettingRow" - android:layout_height="42dp" - android:paddingRight="0dp"> - <TextView android:id="@+id/title" - style="@style/SettingPickerText" - android:textSize="16dp" - android:layout_weight="1" - android:layout_width="match_parent" - android:layout_height="match_parent" /> - - <Button android:id="@+id/decrement" - android:layout_width="36dp" - android:layout_height="match_parent" - android:layout_gravity="center_vertical" - android:gravity="center" - android:text="@string/setting_decrement" - android:textColor="@drawable/btn_setting_picker" - android:textSize="20dp" - android:textStyle="bold" - android:background="@android:color/transparent" /> - - <TextView android:id="@+id/current_setting" - android:layout_width="81dp" - android:layout_height="wrap_content" - android:layout_gravity="center_vertical" - android:gravity="center" - android:singleLine="true" - android:textColor="@android:color/white" - android:textSize="16dp" /> - - <Button android:id="@+id/increment" - android:layout_width="36dp" - android:layout_height="match_parent" - android:layout_gravity="center_vertical" - android:gravity="center" - android:text="@string/setting_increment" - android:textColor="@drawable/btn_setting_picker" - android:textSize="20dp" - android:textStyle="bold" - android:background="@android:color/transparent" /> - </LinearLayout> - <!-- To have the same View(InLineSettingPicker) as the listview's components and also show the restore setting line, we have the relativelayout and control the visibilities of the restore and the setting_item component to achieve the goal. --> - <TextView android:id="@+id/restore" - android:gravity="center" - android:textSize="16dp" - style="@style/SettingRow" - android:textColor="@android:color/white" - android:layout_height="42dp"> - </TextView> -</com.android.camera.ui.InLineSettingPicker> diff --git a/res/layout/in_line_setting_restore.xml b/res/layout/in_line_setting_restore.xml new file mode 100644 index 0000000..37ebb15 --- /dev/null +++ b/res/layout/in_line_setting_restore.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<com.android.camera.ui.InLineSettingRestore xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/setting_item" + style="@style/SettingRow"> + <TextView android:id="@+id/title" + style="@style/SettingItemText" + android:layout_width="match_parent" /> +</com.android.camera.ui.InLineSettingRestore> diff --git a/res/layout/in_line_setting_switch.xml b/res/layout/in_line_setting_switch.xml new file mode 100644 index 0000000..c884ece --- /dev/null +++ b/res/layout/in_line_setting_switch.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<com.android.camera.ui.InLineSettingSwitch xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/setting_item" + style="@style/SettingRow"> + <TextView android:id="@+id/title" + style="@style/SettingItemTitle" /> + + <!-- The Switch widget always aligns to the right, so we have to wrap it in a frame layout. --> + <FrameLayout android:layout_weight="1" + android:layout_width="fill_parent" + android:layout_height="match_parent"> + <Switch android:id="@+id/setting_switch" + android:layout_gravity="center" + android:layout_width="wrap_content" + android:layout_height="match_parent" /> + </FrameLayout> +</com.android.camera.ui.InLineSettingSwitch> diff --git a/res/layout/other_setting_popup.xml b/res/layout/other_setting_popup.xml index 263c938..730e00a 100644 --- a/res/layout/other_setting_popup.xml +++ b/res/layout/other_setting_popup.xml @@ -19,14 +19,10 @@ <com.android.camera.ui.OtherSettingsPopup xmlns:android="http://schemas.android.com/apk/res/android" xmlns:camera="http://schemas.android.com/apk/res/com.android.camera" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_toLeftOf="@+id/indicator_control" - android:visibility="gone"> + style="@style/SettingPopupWindow"> <LinearLayout android:orientation="vertical" - android:layout_width="320dp" + android:layout_width="@dimen/other_setting_popup_window_width" android:layout_height="wrap_content"> <FrameLayout @@ -35,9 +31,7 @@ android:background="@drawable/dialog_top_holo_dark"> <TextView android:id="@+id/title" android:text="@string/pref_camera_settings_category" - style="@style/SettingTitleText" - android:textSize="18dp" - android:layout_height="32dp"/> + style="@style/PopupTitleText" /> </FrameLayout> <FrameLayout @@ -45,13 +39,7 @@ android:layout_height="wrap_content" android:background="@drawable/dialog_bottom_holo_dark"> <ListView android:id="@+id/settingList" - android:orientation="vertical" - android:layout_marginLeft="6dp" - android:layout_marginRight="6dp" - android:paddingBottom="3dp" - android:layout_gravity="center" - android:layout_width="match_parent" - android:layout_height="wrap_content" /> + style="@style/SettingItemList" /> </FrameLayout> </LinearLayout> </com.android.camera.ui.OtherSettingsPopup> diff --git a/res/layout/setting_item.xml b/res/layout/setting_item.xml index 43d8595..5bcf3f7 100644 --- a/res/layout/setting_item.xml +++ b/res/layout/setting_item.xml @@ -17,18 +17,13 @@ */ --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - style="@style/SettingRow" - android:layout_height="42dp"> + style="@style/SettingRow"> <TextView android:id="@+id/text" - style="@style/SettingPickerText" - android:textSize="18dp" - android:layout_width="150dp" - android:paddingRight="10dp" - android:layout_height="match_parent"/> + style="@style/SettingItemTitle" /> <ImageView android:id="@+id/image" - android:layout_width="20dp" - android:layout_height="20dp" + android:layout_width="@dimen/setting_item_icon_width" + android:layout_height="@dimen/setting_item_icon_width" android:scaleType="fitCenter" android:adjustViewBounds="true" /> </LinearLayout> diff --git a/res/values-w1024dp/dimens.xml b/res/values-w1024dp/dimens.xml index 96344bc..9eaed76 100644 --- a/res/values-w1024dp/dimens.xml +++ b/res/values-w1024dp/dimens.xml @@ -38,4 +38,14 @@ <dimen name="pano_capture_too_fast_text_height">160dp</dimen> <dimen name="pano_indication_width">300dp</dimen> <dimen name="pano_indication_height">150dp</dimen> + <dimen name="setting_row_height">48dp</dimen> + <dimen name="setting_item_text_size">21dp</dimen> + <dimen name="setting_knob_width">72dp</dimen> + <dimen name="setting_item_text_width">130dp</dimen> + <dimen name="setting_popup_window_width">410dp</dimen> + <dimen name="setting_item_list_margin">16dp</dimen> + <dimen name="popup_title_text_size">22dp</dimen> + <dimen name="popup_title_frame_min_height">48dp</dimen> + <dimen name="other_setting_popup_window_width">590dp</dimen> + <dimen name="setting_item_icon_width">35dp</dimen> </resources> diff --git a/res/values-w1024dp/styles.xml b/res/values-w1024dp/styles.xml index 57188f2..00016b5 100644 --- a/res/values-w1024dp/styles.xml +++ b/res/values-w1024dp/styles.xml @@ -38,4 +38,11 @@ <item name="android:layout_marginTop">8dp</item> <item name="android:layout_marginRight">28dp</item> </style> + <style name="SettingPopupWindow"> + <item name="android:layout_width">wrap_content</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:layout_centerVertical">true</item> + <item name="android:layout_alignParentRight">true</item> + <item name="android:visibility">gone</item> + </style> </resources> diff --git a/res/values-w1280dp/dimens.xml b/res/values-w1280dp/dimens.xml index e5b8894..a707720 100644 --- a/res/values-w1280dp/dimens.xml +++ b/res/values-w1280dp/dimens.xml @@ -25,4 +25,14 @@ <dimen name="mode_switcher_inner_padding">15dp</dimen> <dimen name="camera_switcher_margin_right">30dp</dimen> <dimen name="camera_switcher_margin_bottom">56dp</dimen> + <dimen name="setting_row_height">48dp</dimen> + <dimen name="setting_item_text_size">21dp</dimen> + <dimen name="setting_knob_width">72dp</dimen> + <dimen name="setting_item_text_width">130dp</dimen> + <dimen name="setting_popup_window_width">410dp</dimen> + <dimen name="setting_item_list_margin">16dp</dimen> + <dimen name="popup_title_text_size">22dp</dimen> + <dimen name="popup_title_frame_min_height">48dp</dimen> + <dimen name="other_setting_popup_window_width">590dp</dimen> + <dimen name="setting_item_icon_width">35dp</dimen> </resources> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index cda755f..2504eb4 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -34,4 +34,15 @@ <dimen name="pano_capture_too_fast_text_height">70dp</dimen> <dimen name="pano_indication_width">150dp</dimen> <dimen name="pano_indication_height">75dp</dimen> + <dimen name="setting_row_height">42dp</dimen> + <dimen name="setting_item_text_size">16dp</dimen> + <dimen name="setting_knob_width">36dp</dimen> + <dimen name="setting_knob_text_size">20dp</dimen> + <dimen name="setting_item_text_width">81dp</dimen> + <dimen name="setting_popup_window_width">240dp</dimen> + <dimen name="setting_item_list_margin">6dp</dimen> + <dimen name="popup_title_text_size">18dp</dimen> + <dimen name="popup_title_frame_min_height">32dp</dimen> + <dimen name="other_setting_popup_window_width">320dp</dimen> + <dimen name="setting_item_icon_width">20dp</dimen> </resources> diff --git a/res/values/styles.xml b/res/values/styles.xml index 5fe9581..4c97422 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -62,32 +62,69 @@ <item name="android:textSize">16dp</item> <item name="android:textStyle">bold</item> </style> - <style name="SettingTitleText"> - <item name="android:textSize">22dp</item> - <item name="android:layout_gravity">left</item> + <style name="SettingPopupWindow"> + <item name="android:layout_width">wrap_content</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:layout_centerVertical">true</item> + <item name="android:layout_toLeftOf">@+id/indicator_control</item> + <item name="android:visibility">gone</item> + </style> + <style name="PopupTitleText"> + <item name="android:textSize">@dimen/popup_title_text_size</item> + <item name="android:layout_gravity">left|center_vertical</item> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">wrap_content</item> <item name="android:singleLine">true</item> <item name="android:textColor">@android:color/white</item> - <item name="android:layout_centerVertical">true</item> <item name="android:layout_marginLeft">10dp</item> <item name="android:paddingLeft">16dp</item> </style> - <style name="SettingPickerText"> - <item name="android:textSize">21dp</item> + <style name="SettingItemList"> + <item name="android:orientation">vertical</item> + <item name="android:layout_marginLeft">@dimen/setting_item_list_margin</item> + <item name="android:layout_marginRight">@dimen/setting_item_list_margin</item> + <item name="android:paddingBottom">3dp</item> + <item name="android:layout_gravity">center</item> + <item name="android:layout_width">match_parent</item> + <item name="android:layout_height">wrap_content</item> + </style> + <style name="SettingItemTitle"> + <item name="android:textSize">@dimen/setting_item_text_size</item> <item name="android:gravity">left|center_vertical</item> <item name="android:textColor">@android:color/white</item> <item name="android:singleLine">true</item> + <item name="android:layout_weight">1</item> + <item name="android:layout_width">fill_parent</item> + <item name="android:layout_height">match_parent</item> + </style> + <style name="SettingItemText"> + <item name="android:layout_width">@dimen/setting_item_text_width</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:layout_gravity">center_vertical</item> + <item name="android:gravity">center</item> + <item name="android:singleLine">true</item> + <item name="android:textColor">@android:color/white</item> + <item name="android:textSize">@dimen/setting_item_text_size</item> </style> <style name="SettingRow"> <item name="android:gravity">center_vertical</item> <item name="android:orientation">horizontal</item> <item name="android:layout_width">match_parent</item> - <item name="android:layout_height">48dp</item> + <item name="android:layout_height">@dimen/setting_row_height</item> <item name="android:paddingLeft">8dp</item> <item name="android:paddingRight">8dp</item> <item name="android:background">@drawable/setting_picker</item> </style> + <style name="SettingKnob"> + <item name="android:layout_width">@dimen/setting_knob_width</item> + <item name="android:layout_height">match_parent</item> + <item name="android:layout_gravity">center_vertical</item> + <item name="android:gravity">center</item> + <item name="android:textColor">@drawable/btn_setting_picker</item> + <item name="android:textSize">@dimen/setting_knob_text_size</item> + <item name="android:textStyle">bold</item> + <item name="android:background">@android:color/transparent</item> + </style> <style name="OnScreenIndicator"> <item name="android:layout_height">28dp</item> <item name="android:layout_width">wrap_content</item> diff --git a/src/com/android/camera/ui/InLineSettingItem.java b/src/com/android/camera/ui/InLineSettingItem.java new file mode 100644 index 0000000..a9b8574 --- /dev/null +++ b/src/com/android/camera/ui/InLineSettingItem.java @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.camera.ui; + +import com.android.camera.R; +import com.android.camera.ListPreference; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.TextView; + +/** + * A one-line camera setting could be one of three types: knob, switch or restore + * preference button. The setting includes a title for showing the preference + * title which is initialized in the SimpleAdapter. A knob also includes + * (ex: Picture size), a previous button, the current value (ex: 5MP), + * and a next button. A switch, i.e. the preference RecordLocationPreference, + * has only two values on and off which will be controlled in a switch button. + * Other setting popup window includes several InLineSettingItem items with + * different types if possible. + */ +public abstract class InLineSettingItem extends LinearLayout { + protected Context mContext; + private Listener mListener; + protected ListPreference mPreference; + protected int mIndex; + // Scene mode can override the original preference value. + protected String mOverrideValue; + + static public interface Listener { + public void onSettingChanged(); + } + + public InLineSettingItem(Context context, AttributeSet attrs) { + super(context, attrs); + mContext = context; + } + + protected void setTitle(ListPreference preference) { + ((TextView) findViewById(R.id.title)).setText(preference.getTitle()); + } + + public void initialize(ListPreference preference) { + setTitle(preference); + if (preference == null) return; + mPreference = preference; + reloadPreference(); + } + + protected abstract void updateView(); + + protected boolean changeIndex(int index) { + mIndex = index; + mPreference.setValueIndex(mIndex); + if (mListener != null) { + mListener.onSettingChanged(); + } + updateView(); + return true; + } + + // The value of the preference may have changed. Update the UI. + public void reloadPreference() { + mIndex = mPreference.findIndexOfValue(mPreference.getValue()); + updateView(); + } + + public void setSettingChangedListener(Listener listener) { + mListener = listener; + } + + public void overrideSettings(String value) { + mOverrideValue = value; + updateView(); + } +} diff --git a/src/com/android/camera/ui/InLineSettingKnob.java b/src/com/android/camera/ui/InLineSettingKnob.java new file mode 100644 index 0000000..9bb771c --- /dev/null +++ b/src/com/android/camera/ui/InLineSettingKnob.java @@ -0,0 +1,123 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.camera.ui; + +import com.android.camera.R; + +import android.content.Context; +import android.os.Handler; +import android.util.AttributeSet; +import android.util.Log; +import android.view.MotionEvent; +import android.view.View; +import android.view.View.OnTouchListener; +import android.widget.Button; +import android.widget.TextView; + +/* A knob setting control. */ +public class InLineSettingKnob extends InLineSettingItem { + private final String TAG = "InLineSettingKnob"; + private boolean mNext, mPrevious; + private Button mPrevButton, mNextButton; + private Handler mHandler; + // The view that shows the current selected setting. Ex: 5MP + private TextView mEntry; + + private final Runnable mRunnable = new Runnable() { + public void run() { + if (mNext) { + if (changeIndex(mIndex - 1)) { + mHandler.postDelayed(this, 100); + } + } else if (mPrevious) { + if (changeIndex(mIndex + 1)) { + mHandler.postDelayed(this, 100); + } + } + } + }; + + public InLineSettingKnob(Context context, AttributeSet attrs) { + super(context, attrs); + mHandler = new Handler(); + } + + OnTouchListener mNextTouchListener = new OnTouchListener() { + public boolean onTouch(View v, MotionEvent event) { + if (mOverrideValue != null) return true; + if (event.getAction() == MotionEvent.ACTION_DOWN) { + if (!mNext && changeIndex(mIndex - 1)) { + mNext = true; + // Give bigger delay so users can change only one step. + mHandler.postDelayed(mRunnable, 300); + } + } else if (event.getAction() == MotionEvent.ACTION_UP + || event.getAction() == MotionEvent.ACTION_CANCEL) { + mNext = false; + } + return false; + } + }; + + OnTouchListener mPreviousTouchListener = new OnTouchListener() { + public boolean onTouch(View v, MotionEvent event) { + if (mOverrideValue != null) return true; + if (event.getAction() == MotionEvent.ACTION_DOWN) { + if (!mPrevious && changeIndex(mIndex + 1)) { + mPrevious = true; + // Give bigger delay so users can change only one step. + mHandler.postDelayed(mRunnable, 300); + } + } else if (event.getAction() == MotionEvent.ACTION_UP + || event.getAction() == MotionEvent.ACTION_CANCEL) { + mPrevious = false; + } + return false; + } + }; + + @Override + protected void onFinishInflate() { + super.onFinishInflate(); + mNextButton = (Button) findViewById(R.id.increment); + mNextButton.setOnTouchListener(mNextTouchListener); + mPrevButton = (Button) findViewById(R.id.decrement); + mPrevButton.setOnTouchListener(mPreviousTouchListener); + mEntry = (TextView) findViewById(R.id.current_setting); + } + + protected void updateView() { + if (mOverrideValue == null) { + mEntry.setText(mPreference.getEntry()); + mNextButton.setVisibility(mIndex == 0 ? View.INVISIBLE : View.VISIBLE); + mPrevButton.setVisibility(mIndex == mPreference.getEntryValues().length - 1 + ? View.INVISIBLE : View.VISIBLE); + } else { + int index = mPreference.findIndexOfValue(mOverrideValue); + if (index != -1) { + mEntry.setText(mPreference.getEntries()[index]); + } else { + // Avoid the crash if camera driver has bugs. + Log.e(TAG, "Fail to find override value=" + mOverrideValue); + mPreference.print(); + } + mNextButton.setVisibility(View.INVISIBLE); + mPrevButton.setVisibility(View.INVISIBLE); + } + } + +} diff --git a/src/com/android/camera/ui/InLineSettingPicker.java b/src/com/android/camera/ui/InLineSettingPicker.java deleted file mode 100644 index 846686c..0000000 --- a/src/com/android/camera/ui/InLineSettingPicker.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.camera.ui; - -import android.content.Context; -import android.os.Handler; -import android.util.AttributeSet; -import android.util.Log; -import android.view.MotionEvent; -import android.view.View; -import android.view.View.OnTouchListener; -import android.widget.Button; -import android.widget.RelativeLayout; -import android.widget.TextView; - -import com.android.camera.R; -import com.android.camera.ListPreference; - - -/* A one-line camera setting that includes a title (ex: Picture size), a - previous button, the current value (ex: 5MP), and a next button. Other - setting popup window includes several InLineSettingPicker. */ -public class InLineSettingPicker extends RelativeLayout { - private final String TAG = "InLineSettingPicker"; - // The view that shows the name of the setting. Ex: Picture size - private TextView mTitle; - // The view that shows the current selected setting. Ex: 5MP - private TextView mEntry; - private Button mPrevButton, mNextButton; - private ListPreference mPreference; - private boolean mNext, mPrevious; - private int mIndex; - private String mKey; - private Listener mListener; - // Scene mode can override the original preference value. - private String mOverrideValue; - - static public interface Listener { - public void onSettingChanged(); - } - - private Handler mHandler; - private final Runnable mRunnable = new Runnable() { - public void run() { - if (mNext) { - if (changeIndex(mIndex - 1)) { - mHandler.postDelayed(this, 100); - } - } else if (mPrevious) { - if (changeIndex(mIndex + 1)) { - mHandler.postDelayed(this, 100); - } - } - } - }; - - public InLineSettingPicker(Context context, AttributeSet attrs) { - super(context, attrs); - mHandler = new Handler(); - } - - @Override - public void onFinishInflate() { - super.onFinishInflate(); - OnTouchListener nextTouchListener = new OnTouchListener() { - public boolean onTouch(View v, MotionEvent event) { - if (mOverrideValue != null) return true; - - if (event.getAction() == MotionEvent.ACTION_DOWN) { - if (!mNext && changeIndex(mIndex - 1)) { - mNext = true; - // Give bigger delay so users can change only one step. - mHandler.postDelayed(mRunnable, 300); - } - } else if (event.getAction() == MotionEvent.ACTION_UP - || event.getAction() == MotionEvent.ACTION_CANCEL) { - mNext = false; - } - return false; - } - }; - - OnTouchListener previousTouchListener = new OnTouchListener() { - public boolean onTouch(View v, MotionEvent event) { - if (mOverrideValue != null) return true; - - if (event.getAction() == MotionEvent.ACTION_DOWN) { - if (!mPrevious && changeIndex(mIndex + 1)) { - mPrevious = true; - // Give bigger delay so users can change only one step. - mHandler.postDelayed(mRunnable, 300); - } - } else if (event.getAction() == MotionEvent.ACTION_UP - || event.getAction() == MotionEvent.ACTION_CANCEL) { - mPrevious = false; - } - return false; - } - }; - - mNextButton = (Button) findViewById(R.id.increment); - mNextButton.setOnTouchListener(nextTouchListener); - mPrevButton = (Button) findViewById(R.id.decrement); - mPrevButton.setOnTouchListener(previousTouchListener); - mEntry = (TextView) findViewById(R.id.current_setting); - mTitle = (TextView) findViewById(R.id.title); - } - - public void initialize(ListPreference preference) { - mPreference = preference; - reloadPreference(); - } - - // The value of the preference may have changed. Update the UI. - public void reloadPreference() { - mIndex = mPreference.findIndexOfValue(mPreference.getValue()); - updateView(); - } - - private boolean changeIndex(int index) { - if (index >= mPreference.getEntryValues().length || index < 0) return false; - mIndex = index; - mPreference.setValueIndex(mIndex); - if (mListener != null) { - mListener.onSettingChanged(); - } - updateView(); - return true; - } - - private void updateView() { - if (mOverrideValue == null) { - mEntry.setText(mPreference.getEntry()); - mNextButton.setVisibility(mIndex == 0 ? View.INVISIBLE : View.VISIBLE); - mPrevButton.setVisibility(mIndex == mPreference.getEntryValues().length - 1 - ? View.INVISIBLE : View.VISIBLE); - } else { - int index = mPreference.findIndexOfValue(mOverrideValue); - if (index != -1) { - mEntry.setText(mPreference.getEntries()[index]); - } else { - // Avoid the crash if camera driver has bugs. - Log.e(TAG, "Fail to find override value=" + mOverrideValue); - mPreference.print(); - } - mNextButton.setVisibility(View.INVISIBLE); - mPrevButton.setVisibility(View.INVISIBLE); - } - } - - public void setSettingChangedListener(Listener listener) { - mListener = listener; - } - - public void overrideSettings(String value) { - mOverrideValue = value; - updateView(); - } -} diff --git a/src/com/android/camera/ui/InLineSettingRestore.java b/src/com/android/camera/ui/InLineSettingRestore.java new file mode 100644 index 0000000..daba811 --- /dev/null +++ b/src/com/android/camera/ui/InLineSettingRestore.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.camera.ui; + +import com.android.camera.R; +import com.android.camera.ListPreference; + +import android.content.Context; +import android.util.AttributeSet; +import android.widget.TextView; + +/* A restore setting is simply showing the restore title. */ +public class InLineSettingRestore extends InLineSettingItem { + + public InLineSettingRestore(Context context, AttributeSet attrs) { + super(context, attrs); + } + + @Override + protected void setTitle(ListPreference preference) { + ((TextView) findViewById(R.id.title)).setText( + mContext.getString(R.string.pref_restore_detail)); + } + + protected void updateView() { } +} diff --git a/src/com/android/camera/ui/InLineSettingSwitch.java b/src/com/android/camera/ui/InLineSettingSwitch.java new file mode 100644 index 0000000..8663a05 --- /dev/null +++ b/src/com/android/camera/ui/InLineSettingSwitch.java @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.camera.ui; + +import com.android.camera.R; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.View; +import android.widget.Button; +import android.widget.CompoundButton; +import android.widget.CompoundButton.OnCheckedChangeListener; +import android.widget.Switch; + +/* A switch setting control which turns on/off the setting. */ +public class InLineSettingSwitch extends InLineSettingItem { + private Switch mSwitch; + + OnCheckedChangeListener mCheckedChangeListener = new OnCheckedChangeListener() { + public void onCheckedChanged(CompoundButton buttonView, boolean desiredState) { + changeIndex(desiredState ? 1 : 0); + } + }; + + public InLineSettingSwitch(Context context, AttributeSet attrs) { + super(context, attrs); + } + + @Override + protected void onFinishInflate() { + super.onFinishInflate(); + mSwitch = (Switch) findViewById(R.id.setting_switch); + mSwitch.setOnCheckedChangeListener(mCheckedChangeListener); + } + + protected void updateView() { + if (mOverrideValue == null) { + mSwitch.setChecked(mIndex == 1); + } else { + int index = mPreference.findIndexOfValue(mOverrideValue); + mSwitch.setChecked(index == 1); + } + } +} diff --git a/src/com/android/camera/ui/OtherSettingsPopup.java b/src/com/android/camera/ui/OtherSettingsPopup.java index 7e4bedb..1357012 100644 --- a/src/com/android/camera/ui/OtherSettingsPopup.java +++ b/src/com/android/camera/ui/OtherSettingsPopup.java @@ -16,77 +16,72 @@ package com.android.camera.ui; +import com.android.camera.CameraSettings; import com.android.camera.ListPreference; import com.android.camera.PreferenceGroup; import com.android.camera.R; +import com.android.camera.RecordLocationPreference; import android.content.Context; import android.util.AttributeSet; import android.view.View; +import android.view.LayoutInflater; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ListView; -import android.widget.SimpleAdapter; -import android.widget.TextView; +import android.widget.ArrayAdapter; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; /* A popup window that contains several camera settings. */ public class OtherSettingsPopup extends AbstractSettingPopup - implements InLineSettingPicker.Listener, + implements InLineSettingItem.Listener, AdapterView.OnItemClickListener { private static final String TAG = "OtherSettingsPopup"; - private static final String ITEM_KEY = "key"; - private static final String ITEM_TITLE = "text"; - private static final String ITEM_VALUE = "value"; - private static final String ITEM_RESTORE = "reset"; private Context mContext; private Listener mListener; - private ArrayList<HashMap<String, Object>> mListItem = - new ArrayList<HashMap<String, Object>>(); + private ArrayList<ListPreference> mListItem = new ArrayList<ListPreference>(); static public interface Listener { public void onSettingChanged(); public void onRestorePreferencesClicked(); } - private class OtherSettingsAdapter extends SimpleAdapter { + private class OtherSettingsAdapter extends ArrayAdapter { + LayoutInflater mInflater; - OtherSettingsAdapter(Context context, - List<? extends Map<String, ?>> data, - int resource, String[] from, int[] to) { - super(context, data, resource, from, to); + OtherSettingsAdapter() { + super(mContext, 0, mListItem); + mInflater = LayoutInflater.from(mContext); + } + + private int getSettingLayoutId(ListPreference pref) { + // If the preference is null, it will be the only item , i.e. + // 'Restore setting' in the popup window. + if (pref == null) return R.layout.in_line_setting_restore; + + // Currently, the RecordLocationPreference is the only setting + // which applies the on/off switch. + if (CameraSettings.KEY_RECORD_LOCATION.equals(pref.getKey())) { + return R.layout.in_line_setting_switch; + } + return R.layout.in_line_setting_knob; } @Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView != null) return convertView; - InLineSettingPicker view = (InLineSettingPicker) - super.getView(position, convertView, parent); - TextView restoreSettings = - (TextView) view.findViewById(R.id.restore); - View settingItem = view.findViewById(R.id.setting_item); - - // We apply the same View(InLineSettingPicker) as the listview's - // components. To show the restore setting line, we control the - // visibilities of components in InLineSettingPicker. - boolean isRestoreItem = (position == mListItem.size() - 1); - settingItem.setVisibility( - isRestoreItem ? View.GONE : View.VISIBLE); - restoreSettings.setVisibility( - isRestoreItem ? View.VISIBLE : View.GONE); - - if (!isRestoreItem) { - HashMap map = (HashMap) mListItem.get(position); - ListPreference pref = (ListPreference) map.get(ITEM_KEY); - view.initialize(pref); - view.setSettingChangedListener(OtherSettingsPopup.this); - } + ListPreference pref = mListItem.get(position); + + int viewLayoutId = getSettingLayoutId(pref); + InLineSettingItem view = (InLineSettingItem) + mInflater.inflate(viewLayoutId, parent, false); + + view.initialize(pref); // no init for restore one + view.setSettingChangedListener(OtherSettingsPopup.this); return view; } } @@ -103,26 +98,14 @@ public class OtherSettingsPopup extends AbstractSettingPopup public void initialize(PreferenceGroup group, String[] keys) { // Prepare the setting items. for (int i = 0; i < keys.length; ++i) { - HashMap<String, Object> map = new HashMap<String, Object>(); ListPreference pref = group.findPreference(keys[i]); - if (pref != null) { - map.put(ITEM_KEY, pref); - map.put(ITEM_TITLE, pref.getTitle()); - map.put(ITEM_VALUE, pref.getEntry()); - mListItem.add(map); - } + if (pref != null) mListItem.add(pref); } // Prepare the restore setting line. - HashMap<String, Object> map = new HashMap<String, Object>(); - map.put(ITEM_RESTORE, mContext.getString(R.string.pref_restore_detail)); - mListItem.add(map); - - SimpleAdapter mListItemAdapter = new OtherSettingsAdapter(mContext, - mListItem, - R.layout.in_line_setting_picker, - new String[] {ITEM_TITLE, ITEM_VALUE, ITEM_RESTORE}, - new int[] {R.id.title, R.id.current_setting, R.id.restore}); + mListItem.add(null); + + ArrayAdapter mListItemAdapter = new OtherSettingsAdapter(); ((ListView) mSettingList).setAdapter(mListItemAdapter); ((ListView) mSettingList).setOnItemClickListener(this); ((ListView) mSettingList).setSelector(android.R.color.transparent); @@ -142,11 +125,11 @@ public class OtherSettingsPopup extends AbstractSettingPopup String key = keyvalues[i]; String value = keyvalues[i + 1]; for (int j = 0; j < count; j++) { - ListPreference pref = (ListPreference) mListItem.get(j).get(ITEM_KEY); + ListPreference pref = (ListPreference) mListItem.get(j); if (pref != null && key.equals(pref.getKey())) { - InLineSettingPicker picker = - (InLineSettingPicker) mSettingList.getChildAt(j); - picker.overrideSettings(value); + InLineSettingItem settingItem = + (InLineSettingItem) mSettingList.getChildAt(j); + settingItem.overrideSettings(value); } } } @@ -164,11 +147,11 @@ public class OtherSettingsPopup extends AbstractSettingPopup public void reloadPreference() { int count = mSettingList.getChildCount(); for (int i = 0; i < count; i++) { - ListPreference pref = (ListPreference) mListItem.get(i).get(ITEM_KEY); + ListPreference pref = (ListPreference) mListItem.get(i); if (pref != null) { - InLineSettingPicker picker = - (InLineSettingPicker) mSettingList.getChildAt(i); - picker.reloadPreference(); + InLineSettingItem settingItem = + (InLineSettingItem) mSettingList.getChildAt(i); + settingItem.reloadPreference(); } } } |