Merge pull request #305 from the-blank-x/ryd-runonuithread
Attempt to fix crash by RYD showing dislike info while screen is being rotated
This commit is contained in:
commit
f112058870
1 changed files with 11 additions and 4 deletions
|
@ -1528,11 +1528,18 @@ public final class VideoDetailFragment
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
info.setDislikeCount(ReturnYouTubeDislikeUtils.getDislikes(getContext(), info));
|
info.setDislikeCount(ReturnYouTubeDislikeUtils.getDislikes(getContext(), info));
|
||||||
if (info.getDislikeCount() >= 0) {
|
if (info.getDislikeCount() >= 0) {
|
||||||
|
if (activity == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
activity.runOnUiThread(() -> {
|
activity.runOnUiThread(() -> {
|
||||||
binding.detailThumbsDownCountView.setText(Localization
|
if (binding != null && binding.detailThumbsDownCountView != null) {
|
||||||
.shortCount(activity, info.getDislikeCount()));
|
binding.detailThumbsDownCountView.setText(Localization
|
||||||
binding.detailThumbsDownCountView.setVisibility(View.VISIBLE);
|
.shortCount(activity, info.getDislikeCount()));
|
||||||
binding.detailThumbsDownImgView.setVisibility(View.VISIBLE);
|
binding.detailThumbsDownCountView.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
if (binding != null && binding.detailThumbsDownImgView != null) {
|
||||||
|
binding.detailThumbsDownImgView.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
|
|
Loading…
Add table
Reference in a new issue