diff options
author | Romain Guy <romainguy@android.com> | 2010-04-14 14:43:18 -0700 |
---|---|---|
committer | Romain Guy <romainguy@android.com> | 2010-04-14 14:43:18 -0700 |
commit | 6691fcfbc806ecfd884ab2e5ff75994d7ee3ddd5 (patch) | |
tree | 43982121df4cf925dfe0ef4011b4850748514dad /core/java/android/widget/Gallery.java | |
parent | 36ce643dbe3ae09d6b94dbd6e3cfbf27442f593e (diff) | |
download | frameworks_base-6691fcfbc806ecfd884ab2e5ff75994d7ee3ddd5.zip frameworks_base-6691fcfbc806ecfd884ab2e5ff75994d7ee3ddd5.tar.gz frameworks_base-6691fcfbc806ecfd884ab2e5ff75994d7ee3ddd5.tar.bz2 |
Ensure Gallery does not unselect the selected item after a layout.
Bug #2573921
Change-Id: I5c39881f541835fe5515b35a9f12761a8a2c1b8b
Diffstat (limited to 'core/java/android/widget/Gallery.java')
-rw-r--r-- | core/java/android/widget/Gallery.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/java/android/widget/Gallery.java b/core/java/android/widget/Gallery.java index f34823c..6775a94 100644 --- a/core/java/android/widget/Gallery.java +++ b/core/java/android/widget/Gallery.java @@ -1207,7 +1207,7 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList // We unfocus the old child down here so the above hasFocus check // returns true - if (oldSelectedChild != null) { + if (oldSelectedChild != null && oldSelectedChild != child) { // Make sure its drawable state doesn't contain 'selected' oldSelectedChild.setSelected(false); @@ -1263,6 +1263,7 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList */ if (gainFocus && mSelectedChild != null) { mSelectedChild.requestFocus(direction); + mSelectedChild.setSelected(true); } } |