mirror of
https://github.com/yuliskov/SmartTube.git
synced 2026-02-20 05:50:44 -06:00
crash fixes
This commit is contained in:
@@ -2282,9 +2282,10 @@ final class GridLayoutManager extends RecyclerView.LayoutManager {
|
||||
// MOD: fix RecycleView crash on Ugoos
|
||||
try {
|
||||
fastRelayout();
|
||||
} catch (IllegalArgumentException | IllegalStateException e) {
|
||||
} catch (IllegalArgumentException | IllegalStateException | NullPointerException e) {
|
||||
// IllegalArgumentException: Called attach on a child which is not detached: ViewHolder{434061b0 position=10 id=-1, oldPos=-1, pLpos:-1 no parent}
|
||||
// IllegalStateException: Layout state should be one of 100 but it is 10
|
||||
// NullPointerException: Attempt to read from field 'int androidx.recyclerview.widget.ViewInfoStore$InfoRecord.flags' on a null object reference
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -123,7 +123,12 @@ public class VideoGroupObjectAdapter extends ObjectAdapter {
|
||||
int begin = mVideoItems.size();
|
||||
|
||||
if (mVideoGroups.contains(group)) {
|
||||
mVideoItems.addAll(group.getVideos().subList(begin, group.getVideos().size()));
|
||||
int end = group.getVideos().size();
|
||||
if (begin > end) {
|
||||
mVideoItems.addAll(group.getVideos());
|
||||
} else {
|
||||
mVideoItems.addAll(group.getVideos().subList(begin, end));
|
||||
}
|
||||
} else {
|
||||
mVideoItems.addAll(group.getVideos());
|
||||
mVideoGroups.add(group);
|
||||
|
||||
Reference in New Issue
Block a user