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

Commit eb8d6252 authored by Dmitri Plotnikov's avatar Dmitri Plotnikov
Browse files

Making call log scroll to top in some cases

It will scroll to the top in all cases except
navigation between tabs in the contacts app.

Bug: 3066840
Change-Id: Id92e2c99880b45c27ea5964fbe45083ed6fbf02c
parent 2f55f8ef
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -135,6 +135,8 @@ public class RecentCallsListActivity extends ListActivity
    private QueryHandler mQueryHandler;
    String mVoiceMailNumber;

    private boolean mScrollToTop;

    static final class ContactInfo {
        public long personId;
        public String name;
@@ -817,6 +819,13 @@ public class RecentCallsListActivity extends ListActivity
                final RecentCallsListActivity.RecentCallsAdapter callsAdapter = activity.mAdapter;
                callsAdapter.setLoading(false);
                callsAdapter.changeCursor(cursor);
                if (activity.mScrollToTop) {
                    if (activity.mList.getFirstVisiblePosition() > 5) {
                        activity.mList.setSelection(5);
                    }
                    activity.mList.smoothScrollToPosition(0);
                    activity.mScrollToTop = false;
                }
            } else {
                cursor.close();
            }
@@ -844,6 +853,12 @@ public class RecentCallsListActivity extends ListActivity
        sFormattingType = FORMATTING_TYPE_INVALID;
    }

    @Override
    protected void onStart() {
        mScrollToTop = true;
        super.onStart();
    }

    @Override
    protected void onResume() {
        // The adapter caches looked up numbers, clear it so they will get