From d0fa371f276fde32d81c037006941bc93da0bb03 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Tue, 14 Sep 2010 18:57:14 -0700 Subject: Add a new "activated" state to View. Use this in ListView and GridView if the top view is not checkable. This allows PreferenceActivity to now highlight the current heading that is being shown. Change-Id: I0d28aded9a61a42962b4aece420ae4058712d963 --- core/java/android/widget/GridView.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core/java/android/widget/GridView.java') diff --git a/core/java/android/widget/GridView.java b/core/java/android/widget/GridView.java index dffe68589fec..46c7d33e9ca4 100644 --- a/core/java/android/widget/GridView.java +++ b/core/java/android/widget/GridView.java @@ -1341,6 +1341,9 @@ public class GridView extends AbsListView { if (mChoiceMode != CHOICE_MODE_NONE && mCheckStates != null) { if (child instanceof Checkable) { ((Checkable) child).setChecked(mCheckStates.get(position)); + } else if (getContext().getApplicationInfo().targetSdkVersion + >= android.os.Build.VERSION_CODES.HONEYCOMB) { + child.setActivated(mCheckStates.get(position)); } } -- cgit v1.2.3