fix IndexOutOfBoundException caused by ListStatusAccessibilityDelegate (#1178)
This commit is contained in:
parent
4ed65ac4a0
commit
dd02af9911
4 changed files with 13 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
package com.keylesspalace.tusky.util;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.arch.core.util.Function;
|
||||
|
||||
import java.util.AbstractList;
|
||||
|
@ -44,6 +45,15 @@ public final class PairedList<T, V> extends AbstractList<T> {
|
|||
return synced.get(index);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public V getPairedItemOrNull(int index) {
|
||||
if (index >= 0 && index < synced.size()) {
|
||||
return synced.get(index);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setPairedItem(int index, V element) {
|
||||
synced.set(index, element);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue