Click autoplaying videos to open them in fullscreen.

This commit is contained in:
Docile-Alligator 2022-04-10 09:40:16 +08:00
parent e7da8c1f69
commit bbd212ff2c
2 changed files with 20 additions and 5 deletions

View File

@ -1722,8 +1722,12 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
} }
}); });
previewImageView.setOnLongClickListener(view -> fullscreenButton.performClick()); previewImageView.setOnClickListener(view -> fullscreenButton.performClick());
playerView.setOnLongClickListener(view -> fullscreenButton.performClick()); playerView.setOnClickListener(view -> {
if (playerView.isControllerVisible()) {
fullscreenButton.performClick();
}
});
} }
void bindVideoUri(Uri videoUri) { void bindVideoUri(Uri videoUri) {

View File

@ -2694,7 +2694,6 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
private Uri mediaUri; private Uri mediaUri;
private float volume; private float volume;
public Call<String> fetchGfycatOrStreamableVideoCall; public Call<String> fetchGfycatOrStreamableVideoCall;
//public FetchGfycatOrRedgifsVideoLinks fetchGfycatOrRedgifsVideoLinks;
PostVideoAutoplayViewHolder(View itemView) { PostVideoAutoplayViewHolder(View itemView) {
super(itemView); super(itemView);
@ -2787,7 +2786,13 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
} }
}); });
previewImageView.setOnLongClickListener(view -> fullscreenButton.performClick()); previewImageView.setOnClickListener(view -> fullscreenButton.performClick());
videoPlayer.setOnClickListener(view -> {
if (videoPlayer.isControllerVisible()) {
fullscreenButton.performClick();
}
});
} }
void bindVideoUri(Uri videoUri) { void bindVideoUri(Uri videoUri) {
@ -4096,7 +4101,13 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
} }
}); });
previewImageView.setOnLongClickListener(view -> fullscreenButton.performClick()); previewImageView.setOnClickListener(view -> fullscreenButton.performClick());
videoPlayer.setOnClickListener(view -> {
if (videoPlayer.isControllerVisible()) {
fullscreenButton.performClick();
}
});
} }
void bindVideoUri(Uri videoUri) { void bindVideoUri(Uri videoUri) {