Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6691fcfb authored by Romain Guy's avatar Romain Guy
Browse files

Ensure Gallery does not unselect the selected item after a layout.

Bug #2573921

Change-Id: I5c39881f541835fe5515b35a9f12761a8a2c1b8b
parent 36ce643d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);
        }

    }