diff options
| author | Dianne Hackborn <hackbod@google.com> | 2010-09-14 18:57:14 -0700 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2010-09-15 11:00:44 -0700 |
| commit | d0fa371f276fde32d81c037006941bc93da0bb03 (patch) | |
| tree | e1b588f0cbfe23ce289ac50784aa3d9960fd7457 /core/java/android/widget/GridView.java | |
| parent | 53b34a096b6943eef75e8154f6e5b76e4685fa24 (diff) | |
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
Diffstat (limited to 'core/java/android/widget/GridView.java')
| -rw-r--r-- | core/java/android/widget/GridView.java | 3 |
1 files changed, 3 insertions, 0 deletions
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)); } } |
