mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 14:25:52 +00:00
Bug 1296411 - Correctly transform the adapter position to a cursor position when accessing the history cursor for getItemId. r=sebastian
Because of the smart folders and section headers, the adapter position needs to be appropriately adjusted when trying to access the corresponding cursor item. MozReview-Commit-ID: n3FvcsYJ5T --HG-- extra : rebase_source : 366dadb7abde5283a93fb1d62cff3ff4e3bba28b
This commit is contained in:
parent
bde66209f8
commit
519057383f
@ -215,7 +215,9 @@ public class CombinedHistoryAdapter extends RecyclerView.Adapter<CombinedHistory
|
||||
// We might have multiple section headers, so we try get unique IDs for them.
|
||||
return position * PRIME_SECTION_HEADERS;
|
||||
case HISTORY:
|
||||
if (!historyCursor.moveToPosition(position)) {
|
||||
final int historyPosition = transformAdapterPositionForDataStructure(
|
||||
CombinedHistoryItem.ItemType.HISTORY, position);
|
||||
if (!historyCursor.moveToPosition(historyPosition)) {
|
||||
return RecyclerView.NO_ID;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user