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

Commit ad39eb2a authored by Ta-wei Yen's avatar Ta-wei Yen Committed by android-build-merger
Browse files

Prevent incorrect call log item from expanding when new item arrives

am: fa15094f

* commit 'fa15094f':
  Prevent incorrect call log item from expanding when new item arrives
parents 400229b4 fa15094f
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -595,9 +595,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;
            views.showActions(true);
        } else {
            views.showActions(false);
        }

        views.showActions(mCurrentlyExpandedPosition == position);
        views.updatePhoto();

        mCallLogListItemHelper.setPhoneCallDetails(views, details);
@@ -683,6 +684,14 @@ public class CallLogAdapter extends GroupingListAdapter
        mCurrentlyExpandedPosition = RecyclerView.NO_POSITION;
    }

    /**
     * When the list is changing all stored position is no longer valid.
     */
    public void invalidatePositions() {
        mCurrentlyExpandedPosition = RecyclerView.NO_POSITION;
        mHiddenPosition = RecyclerView.NO_POSITION;
    }

    /**
     * When the user clicks "undo", the hidden item is unhidden.
     */
+1 −0
Original line number Diff line number Diff line
@@ -217,6 +217,7 @@ public class CallLogFragment extends Fragment implements CallLogQueryHandler.Lis
            // Return false; we did not take ownership of the cursor
            return false;
        }
        mAdapter.invalidatePositions();
        mAdapter.setLoading(false);
        mAdapter.changeCursor(cursor);
        // This will update the state of the "Clear call log" menu item.