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(() -> {
|
||||
info.setDislikeCount(ReturnYouTubeDislikeUtils.getDislikes(getContext(), info));
|
||||
if (info.getDislikeCount() >= 0) {
|
||||
if (activity == null) {
|
||||
return;
|
||||
}
|
||||
activity.runOnUiThread(() -> {
|
||||
binding.detailThumbsDownCountView.setText(Localization
|
||||
.shortCount(activity, info.getDislikeCount()));
|
||||
binding.detailThumbsDownCountView.setVisibility(View.VISIBLE);
|
||||
binding.detailThumbsDownImgView.setVisibility(View.VISIBLE);
|
||||
if (binding != null && binding.detailThumbsDownCountView != null) {
|
||||
binding.detailThumbsDownCountView.setText(Localization
|
||||
.shortCount(activity, info.getDislikeCount()));
|
||||
binding.detailThumbsDownCountView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (binding != null && binding.detailThumbsDownImgView != null) {
|
||||
binding.detailThumbsDownImgView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
|
|
Loading…
Add table
Reference in a new issue