fix crash at status details adapter
This commit is contained in:
parent
b1557f17be
commit
9d9a98d47b
|
@ -124,22 +124,27 @@ class StatusDetailsAdapter(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getStatus(position: Int, raw: Boolean): ParcelableStatus {
|
override fun getStatus(position: Int, raw: Boolean): ParcelableStatus {
|
||||||
|
data?.let { data ->
|
||||||
when (getItemCountIndex(position, raw)) {
|
when (getItemCountIndex(position, raw)) {
|
||||||
ITEM_IDX_CONVERSATION -> {
|
ITEM_IDX_CONVERSATION -> {
|
||||||
var idx = position - getIndexStart(ITEM_IDX_CONVERSATION)
|
var idx = position - getIndexStart(ITEM_IDX_CONVERSATION)
|
||||||
if (data!![idx].is_filtered) idx++
|
if (data.getOrNull(idx)?.is_filtered == true) idx++
|
||||||
return data!![idx]
|
return data[idx]
|
||||||
}
|
}
|
||||||
ITEM_IDX_REPLY -> {
|
ITEM_IDX_REPLY -> {
|
||||||
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 (data.getOrNull(idx)?.is_filtered == true) idx++
|
||||||
return data!![idx]
|
return data[idx]
|
||||||
}
|
}
|
||||||
ITEM_IDX_STATUS -> {
|
ITEM_IDX_STATUS -> {
|
||||||
return status!!
|
return status!!
|
||||||
}
|
}
|
||||||
|
else -> {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
throw IndexOutOfBoundsException("index: $position")
|
throw IndexOutOfBoundsException("index: $position")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue