mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2024-11-26 04:52:29 +01:00
commit
f4f4f062cf
@ -131,16 +131,15 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I>
|
||||
}
|
||||
|
||||
private int getFocusedPosition() {
|
||||
View focusedItem = itemsList.getFocusedChild();
|
||||
if (focusedItem != null) {
|
||||
RecyclerView.ViewHolder itemHolder = itemsList.findContainingViewHolder(focusedItem);
|
||||
if (itemHolder != null) {
|
||||
try {
|
||||
final View focusedItem = itemsList.getFocusedChild();
|
||||
final RecyclerView.ViewHolder itemHolder =
|
||||
itemsList.findContainingViewHolder(focusedItem);
|
||||
return itemHolder.getAdapterPosition();
|
||||
}
|
||||
}
|
||||
|
||||
} catch (NullPointerException e) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(final Queue<Object> objectsToSave) {
|
||||
|
Loading…
Reference in New Issue
Block a user