mirror of
https://github.com/yuliskov/SmartTube.git
synced 2026-05-13 08:20:51 -05:00
crash fixes
This commit is contained in:
+1
-1
Submodule MediaServiceCore updated: 1efbd82913...0c536d2141
+4
@@ -162,6 +162,10 @@ public class VideoStateController extends BasePlayerController {
|
||||
|
||||
@Override
|
||||
public void onEngineError(int type, int rendererIndex, Throwable error) {
|
||||
if (getPlayer() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Oops. Error happens while playing (network lost etc).
|
||||
if (getPlayer().getPositionMs() > 1_000) {
|
||||
saveState();
|
||||
|
||||
+17
-8
@@ -122,9 +122,26 @@ public class MultiVideoGridFragment extends MultiGridFragment implements VideoSe
|
||||
public void update(VideoGroup group) {
|
||||
if (group.getPosition() == 0) {
|
||||
addSearchHeader();
|
||||
freeze1(true);
|
||||
updateGroup1(group);
|
||||
freeze1(false);
|
||||
} else if (group.getPosition() == 1) {
|
||||
int action = group.getAction();
|
||||
|
||||
// Attempt to fix: IllegalStateException: Cannot call this method while RecyclerView is computing a layout or scrolling
|
||||
if (action == VideoGroup.ACTION_SYNC && getBrowseGrid2() != null && getBrowseGrid2().isComputingLayout()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Smooth remove animation
|
||||
if (action == VideoGroup.ACTION_REMOVE) {
|
||||
updateGroup2(group);
|
||||
return;
|
||||
}
|
||||
|
||||
freeze2(true);
|
||||
updateGroup2(group);
|
||||
freeze2(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,12 +257,8 @@ public class MultiVideoGridFragment extends MultiGridFragment implements VideoSe
|
||||
return;
|
||||
}
|
||||
|
||||
freeze1(true);
|
||||
|
||||
mGridAdapter1.add(group);
|
||||
|
||||
freeze1(false);
|
||||
|
||||
restorePosition1();
|
||||
}
|
||||
|
||||
@@ -271,12 +284,8 @@ public class MultiVideoGridFragment extends MultiGridFragment implements VideoSe
|
||||
return;
|
||||
}
|
||||
|
||||
freeze2(true);
|
||||
|
||||
mGridAdapter2.add(group);
|
||||
|
||||
freeze2(false);
|
||||
|
||||
// TODO: Do we need to restore position on second group?
|
||||
//restorePosition2();
|
||||
}
|
||||
|
||||
+8
@@ -204,6 +204,14 @@ public abstract class MultipleRowsFragment extends RowsSupportFragment implement
|
||||
return;
|
||||
}
|
||||
|
||||
int action = group.getAction();
|
||||
|
||||
// Smooth remove animation
|
||||
if (action == VideoGroup.ACTION_REMOVE) {
|
||||
updateInt(group);
|
||||
return;
|
||||
}
|
||||
|
||||
freeze(true);
|
||||
|
||||
updateInt(group);
|
||||
|
||||
+1
-1
@@ -141,7 +141,7 @@ public class VideoGridFragment extends GridFragment implements VideoSection {
|
||||
int action = group.getAction();
|
||||
|
||||
// Attempt to fix: IllegalStateException: Cannot call this method while RecyclerView is computing a layout or scrolling
|
||||
if (action == VideoGroup.ACTION_SYNC && getBrowseGrid() != null && getBrowseGrid().isComputingLayout()) {
|
||||
if ((action == VideoGroup.ACTION_SYNC || action == VideoGroup.ACTION_REPLACE) && getBrowseGrid() != null && getBrowseGrid().isComputingLayout()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user