diff options
| author | Chung-yih Wang <cywang@google.com> | 2010-12-01 12:02:09 +0800 |
|---|---|---|
| committer | Chung-yih Wang <cywang@google.com> | 2010-12-03 16:08:23 +0800 |
| commit | 1d12db9c16f57894aee41d004b4e21d684cc269d (patch) | |
| tree | 438d2c5ce82465c2772033df95397f718b53de27 /src | |
| parent | 742593ed71ebff889a0a23eeba6d7309def6c4fb (diff) | |
| download | LegacyCamera-1d12db9c16f57894aee41d004b4e21d684cc269d.zip LegacyCamera-1d12db9c16f57894aee41d004b4e21d684cc269d.tar.gz LegacyCamera-1d12db9c16f57894aee41d004b4e21d684cc269d.tar.bz2 | |
Highlight the selected setting in popup windows.
bug:3242797
Change-Id: Iba2c93a2213723a16137a2083de10f3300feee2f
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/camera/ui/AbstractSettingPopup.java | 19 | ||||
| -rw-r--r-- | src/com/android/camera/ui/BasicSettingPopup.java | 6 |
2 files changed, 3 insertions, 22 deletions
diff --git a/src/com/android/camera/ui/AbstractSettingPopup.java b/src/com/android/camera/ui/AbstractSettingPopup.java index 314dcab..f82e98b 100644 --- a/src/com/android/camera/ui/AbstractSettingPopup.java +++ b/src/com/android/camera/ui/AbstractSettingPopup.java @@ -42,25 +42,6 @@ abstract public class AbstractSettingPopup extends LinearLayout { super.onFinishInflate(); mTitle = (TextView) findViewById(R.id.title); - View topPanel = findViewById(R.id.topPanel); mContentPanel = (ViewGroup) findViewById(R.id.contentPanel); - - // Use system holo background for now. - // TODO: We need to add alpha to the background. - Context context = getContext(); - Theme dialogTheme = context.getResources().newTheme(); - dialogTheme.applyStyle(android.R.style.Theme_Holo, true); - TypedArray ta = dialogTheme.obtainStyledAttributes(new int[] { - android.R.attr.alertDialogStyle }); - int resourceId = ta.getResourceId(0, 0); - TypedArray ta2 = context.obtainStyledAttributes(resourceId, new int[] { - android.R.attr.topDark, - android.R.attr.bottomDark}); - - topPanel.setBackgroundDrawable(ta2.getDrawable(0)); - mContentPanel.setBackgroundDrawable(ta2.getDrawable(1)); - - ta.recycle(); - ta2.recycle(); } } diff --git a/src/com/android/camera/ui/BasicSettingPopup.java b/src/com/android/camera/ui/BasicSettingPopup.java index f0636a1..2f84caa 100644 --- a/src/com/android/camera/ui/BasicSettingPopup.java +++ b/src/com/android/camera/ui/BasicSettingPopup.java @@ -76,7 +76,7 @@ public class BasicSettingPopup extends AbstractSettingPopup implements TextView text = (TextView) row.findViewById(R.id.text); text.setText(entries[i].toString()); text.setClickable(false); - if (index == i) text.setPressed(true); + row.setPressed(index == i); // Initialize the icon. if (iconIds != null) { @@ -113,8 +113,8 @@ public class BasicSettingPopup extends AbstractSettingPopup implements int oldIndex = mPreference.findIndexOfValue(mPreference.getValue()); if (oldIndex != i) { View oldRow = group.getChildAt(oldIndex); - oldRow.findViewById(R.id.text).setPressed(false); - child.findViewById(R.id.text).setPressed(true); + oldRow.setPressed(false); + child.setPressed(true); mPreference.setValueIndex(i); if (mListener != null) { mListener.onSettingChanged(); |
