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

Commit e3189a4a authored by Yorke Lee's avatar Yorke Lee
Browse files

Don't auto-expand first voicemail card

Bug: 22127956
Change-Id: Ia1a62e799bf7b535da2390bc0e8fa62201b8a684
parent 82d30284
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -361,10 +361,13 @@ public class CallLogAdapter extends GroupingListAdapter

    @Override
    public void changeCursor(Cursor cursor) {
        // Data has changed; reset so that the first call log list item will be expanded.
        // Don't auto-expand the first item for the voicemail list fragment since that will
        // trigger an unwanted voicemail download and playback.
        if (mVoicemailPlaybackPresenter == null) {
            mHasBoundFirstView = false;
            mCurrentlyExpandedPosition = RecyclerView.NO_POSITION;
            mCurrentlyExpandedRowId = NO_EXPANDED_LIST_ITEM;
        }

        super.changeCursor(cursor);
    }
@@ -578,8 +581,10 @@ public class CallLogAdapter extends GroupingListAdapter
            // In case ViewHolders were added/removed, update the expanded position if the rowIds
            // match so that we can restore the correct expanded state on rebind.
            mCurrentlyExpandedPosition = position;
        } else if (!mHasBoundFirstView) {
        } else if (!mHasBoundFirstView && mVoicemailPlaybackPresenter == null) {
            // Expand the first view when loading the call log to expose the actions.
            // Don't auto-expand the first item for the voicemail list fragment since that will
            // trigger an unwanted voicemail download and playback.
            mCurrentlyExpandedRowId = views.rowId;
            mCurrentlyExpandedPosition = position;
            mHasBoundFirstView = true;