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

Commit 32b307e3 authored by Danesh M's avatar Danesh M Committed by Abhisek Devkota
Browse files

Settings : Fix profile action offset when changing orientation

If a listview has headers/footers, getItemAtPosition takes that into account
given a position. When we restore state, we fetch it from the adapter which has
no concept of header/footer.

Fix this by storing the position in the adapter itself.

Repro:

1) Create new profile
2) Skip triggers
3) Click one of the preferences
4) Rotate phone
5) Notice the title change

Change-Id: Ifaecf99615d922140e8cd531ab164320de729439
issue-id: CYNGNOS-1168
(cherry picked from commit 90fff8f0)
parent e0e4ee8a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1045,7 +1045,7 @@ public class SetupActionsFragment extends SettingsPreferenceFragment
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        final Item itemAtPosition = (Item) parent.getItemAtPosition(position);
        mSelectedItem = itemAtPosition;
        mLastSelectedPosition = position;
        mLastSelectedPosition = mAdapter.getPosition(itemAtPosition);

        if (itemAtPosition instanceof AirplaneModeItem) {
            showDialog(DIALOG_AIRPLANE_MODE);