Fix crash on video autoplay

This commit fixes the issue where the app crashes if autoplay is enabled and the user clicks on a post with a video.

Closes #281
This commit is contained in:
Bazsalanszky 2024-08-29 13:51:30 +02:00
parent e8b199a74a
commit 468bae4019

View File

@ -1802,7 +1802,9 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
public PostDetailBaseVideoAutoplayViewHolder(@NonNull View itemView, public PostDetailBaseVideoAutoplayViewHolder(@NonNull View itemView,
AspectRatioGifImageView iconGifImageView, AspectRatioGifImageView iconGifImageView,
TextView subredditTextView, TextView subredditTextView,
TextView communityInstance,
TextView userTextView, TextView userTextView,
TextView userInstanceTextView,
TextView authorFlairTextView, TextView authorFlairTextView,
TextView postTimeTextView, TextView postTimeTextView,
TextView titleTextView, TextView titleTextView,
@ -1828,6 +1830,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
ConstraintLayout bottomConstraintLayout, ConstraintLayout bottomConstraintLayout,
MaterialButton upvoteButton, MaterialButton upvoteButton,
TextView scoreTextView, TextView scoreTextView,
TextView downvoteTextView,
MaterialButton downvoteButton, MaterialButton downvoteButton,
MaterialButton commentsCountButton, MaterialButton commentsCountButton,
MaterialButton saveButton, MaterialButton saveButton,
@ -1835,9 +1838,9 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
super(itemView); super(itemView);
setBaseView(iconGifImageView, setBaseView(iconGifImageView,
subredditTextView, subredditTextView,
mCommunityInstanceTextView, communityInstance,
userTextView, userTextView,
mUserInstanceTextView, userInstanceTextView,
authorFlairTextView, authorFlairTextView,
postTimeTextView, postTimeTextView,
titleTextView, titleTextView,
@ -1854,7 +1857,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
bottomConstraintLayout, bottomConstraintLayout,
upvoteButton, upvoteButton,
scoreTextView, scoreTextView,
mDownvoteTextView, downvoteTextView,
downvoteButton, downvoteButton,
commentsCountButton, commentsCountButton,
saveButton, saveButton,
@ -2075,7 +2078,9 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
super(binding.getRoot(), super(binding.getRoot(),
binding.iconGifImageViewItemPostDetailVideoAutoplay, binding.iconGifImageViewItemPostDetailVideoAutoplay,
binding.subredditTextViewItemPostDetailVideoAutoplay, binding.subredditTextViewItemPostDetailVideoAutoplay,
binding.communityInstanceTextViewItemPostDetailVideoAutoplay,
binding.userTextViewItemPostDetailVideoAutoplay, binding.userTextViewItemPostDetailVideoAutoplay,
binding.userInstanceTextViewItemPostDetailVideoAutoplay,
binding.authorFlairTextViewItemPostDetailVideoAutoplay, binding.authorFlairTextViewItemPostDetailVideoAutoplay,
binding.postTimeTextViewItemPostDetailVideoAutoplay, binding.postTimeTextViewItemPostDetailVideoAutoplay,
binding.titleTextViewItemPostDetailVideoAutoplay, binding.titleTextViewItemPostDetailVideoAutoplay,
@ -2101,6 +2106,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
binding.bottomConstraintLayoutItemPostDetailVideoAutoplay, binding.bottomConstraintLayoutItemPostDetailVideoAutoplay,
binding.upvoteButtonItemPostDetailVideoAutoplay, binding.upvoteButtonItemPostDetailVideoAutoplay,
binding.scoreTextViewItemPostDetailVideoAutoplay, binding.scoreTextViewItemPostDetailVideoAutoplay,
binding.downvoteTextViewItemPostDetailVideoAutoplay,
binding.downvoteButtonItemPostDetailVideoAutoplay, binding.downvoteButtonItemPostDetailVideoAutoplay,
binding.commentsCountButtonItemPostDetailVideoAutoplay, binding.commentsCountButtonItemPostDetailVideoAutoplay,
binding.saveButtonItemPostDetailVideoAutoplay, binding.saveButtonItemPostDetailVideoAutoplay,
@ -2113,7 +2119,9 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
super(binding.getRoot(), super(binding.getRoot(),
binding.iconGifImageViewItemPostDetailVideoAutoplay, binding.iconGifImageViewItemPostDetailVideoAutoplay,
binding.subredditTextViewItemPostDetailVideoAutoplay, binding.subredditTextViewItemPostDetailVideoAutoplay,
binding.communityInstanceTextViewItemPostDetailVideoAutoplay,
binding.userTextViewItemPostDetailVideoAutoplay, binding.userTextViewItemPostDetailVideoAutoplay,
binding.userInstanceTextViewItemPostDetailVideoAutoplay,
binding.authorFlairTextViewItemPostDetailVideoAutoplay, binding.authorFlairTextViewItemPostDetailVideoAutoplay,
binding.postTimeTextViewItemPostDetailVideoAutoplay, binding.postTimeTextViewItemPostDetailVideoAutoplay,
binding.titleTextViewItemPostDetailVideoAutoplay, binding.titleTextViewItemPostDetailVideoAutoplay,
@ -2139,6 +2147,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
binding.bottomConstraintLayoutItemPostDetailVideoAutoplay, binding.bottomConstraintLayoutItemPostDetailVideoAutoplay,
binding.upvoteButtonItemPostDetailVideoAutoplay, binding.upvoteButtonItemPostDetailVideoAutoplay,
binding.scoreTextViewItemPostDetailVideoAutoplay, binding.scoreTextViewItemPostDetailVideoAutoplay,
binding.downvoteTextViewItemPostDetailVideoAutoplay,
binding.downvoteButtonItemPostDetailVideoAutoplay, binding.downvoteButtonItemPostDetailVideoAutoplay,
binding.commentsCountButtonItemPostDetailVideoAutoplay, binding.commentsCountButtonItemPostDetailVideoAutoplay,
binding.saveButtonItemPostDetailVideoAutoplay, binding.saveButtonItemPostDetailVideoAutoplay,