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

Commit 4799a30d authored by Wenyi Wang's avatar Wenyi Wang Committed by Android (Google) Code Review
Browse files

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

Merge "Don't restore selection of all contacts list after a partition is loaded." into ub-contactsdialer-b-dev
parents aff6939a 72198662
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);
        }
    }