1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-25 01:20:34 +00:00

Merge pull request #3495 from Stypox/fix-rotation

Fix rotation
This commit is contained in:
Tobias Groza 2020-04-27 09:18:08 +02:00 committed by GitHub
commit f4f4f062cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {