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

Commit 72198662 authored by Wenyi Wang's avatar Wenyi Wang
Browse files

Don't restore selection of all contacts list after a partition is loaded.

And restore selection of the list in onResume() instead.

Bug: 19982820
Bug: 26113201
Change-Id: I77e99bd7a83c7793bd134d94d08bcdfc46eb2af2
parent 78fe7a12
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -888,6 +888,15 @@ public abstract class ContactEntryListFragment<T extends ContactEntryListAdapter
        removePendingDirectorySearchRequests();
    }

    @Override
    public void onResume() {
        super.onResume();
        // Restore the selection of the list view. See b/19982820.
        // This has to be done manually because if the list view has its emptyView set,
        // the scrolling state will be reset when clearPartitions() is called on the adapter.
        mListView.setSelectionFromTop(mListViewTopIndex, mListViewTopOffset);
    }

    /**
     * Restore the list state after the adapter is populated.
     */
@@ -895,11 +904,6 @@ public abstract class ContactEntryListFragment<T extends ContactEntryListAdapter
        if (mListState != null) {
            mListView.onRestoreInstanceState(mListState);
            mListState = null;
        } else {
            // Restore the scrolling state of the list view.
            // This has to be done manually be cause if the list view have its' emptyView set,
            // the scrolling state will be reset when clearPartitions() is called on the adapter.
            mListView.setSelectionFromTop(mListViewTopIndex, mListViewTopOffset);
        }
    }