summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorByunghun Jeon <bjeon@codeaurora.org>2016-01-19 16:48:49 -0800
committerMichael Bestas <mikeioannina@cyanogenmod.org>2016-02-16 15:44:54 +0200
commit7c89a6d6ad841ddad0f017a02941388c7af8711e (patch)
tree6eb28d243caa98155477e459e5c5181507495bc5
parente5d80904c60a105a034d0b0df3304ed6f001001a (diff)
downloadandroid_packages_apps_Snap-7c89a6d6ad841ddad0f017a02941388c7af8711e.zip
android_packages_apps_Snap-7c89a6d6ad841ddad0f017a02941388c7af8711e.tar.gz
android_packages_apps_Snap-7c89a6d6ad841ddad0f017a02941388c7af8711e.tar.bz2
SnapdragonCamera: Fix highlight after rotating device
Fix highlight disappear after rotating device in settings Change-Id: Ic51d95cd07dfb33d846c24cbc265177330542b7a CRs-Fixed: 956111
-rw-r--r--src/com/android/camera/ui/ListMenu.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/camera/ui/ListMenu.java b/src/com/android/camera/ui/ListMenu.java
index 2de32b2..a1e1457 100644
--- a/src/com/android/camera/ui/ListMenu.java
+++ b/src/com/android/camera/ui/ListMenu.java
@@ -42,6 +42,7 @@ public class ListMenu extends ListView
AdapterView.OnItemClickListener {
@SuppressWarnings("unused")
private static final String TAG = "ListMenu";
+ private int mHighlighted = -1;
private Listener mListener;
private ArrayList<ListPreference> mListItem = new ArrayList<ListPreference>();
@@ -93,6 +94,9 @@ public class ListMenu extends ListView
Log.w(TAG, "Invalid input: enabled list length, " + mEnabled.length
+ " position " + position);
}
+ if (position == mHighlighted) {
+ view.setActivated(true);
+ }
return view;
}
@@ -185,6 +189,7 @@ public class ListMenu extends ListView
for (int i = 0; i < count; i++) {
getChildAt(i).setActivated(false);
}
+ mHighlighted = -1;
}
@Override
@@ -202,6 +207,7 @@ public class ListMenu extends ListView
if (mListener != null) {
resetHighlight();
ListPreference pref = mListItem.get(position);
+ mHighlighted = position;
view.setActivated(true);
mListener.onPreferenceClicked(pref, (int) view.getY());
}