ensure idx is in data indices
This commit is contained in:
parent
205424735b
commit
94a73bf4b9
|
@ -128,8 +128,12 @@ class StatusDetailsAdapter(
|
||||||
ITEM_IDX_CONVERSATION -> {
|
ITEM_IDX_CONVERSATION -> {
|
||||||
data?.let { data ->
|
data?.let { data ->
|
||||||
var idx = position - getIndexStart(ITEM_IDX_CONVERSATION)
|
var idx = position - getIndexStart(ITEM_IDX_CONVERSATION)
|
||||||
if (data[idx].is_filtered) idx++
|
if (idx !in data.indices) {
|
||||||
return data[idx]
|
if (data[idx].is_filtered) {
|
||||||
|
idx++
|
||||||
|
}
|
||||||
|
return data[idx]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ITEM_IDX_REPLY -> {
|
ITEM_IDX_REPLY -> {
|
||||||
|
@ -137,8 +141,12 @@ class StatusDetailsAdapter(
|
||||||
var idx = position - getIndexStart(ITEM_IDX_CONVERSATION) -
|
var idx = position - getIndexStart(ITEM_IDX_CONVERSATION) -
|
||||||
getTypeCount(ITEM_IDX_CONVERSATION) - getTypeCount(ITEM_IDX_STATUS) +
|
getTypeCount(ITEM_IDX_CONVERSATION) - getTypeCount(ITEM_IDX_STATUS) +
|
||||||
replyStart
|
replyStart
|
||||||
if (data[idx].is_filtered) idx++
|
if (idx !in data.indices) {
|
||||||
return data[idx]
|
if (data[idx].is_filtered) {
|
||||||
|
idx++
|
||||||
|
}
|
||||||
|
return data[idx]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ITEM_IDX_STATUS -> {
|
ITEM_IDX_STATUS -> {
|
||||||
|
|
Loading…
Reference in New Issue