diff options
author | Alex Ning <chineseperson5@gmail.com> | 2020-09-13 14:24:50 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2020-09-13 14:24:50 +0000 |
commit | df1476692dc3cf4bc93ac8a02a58aecf046e532c (patch) | |
tree | 6561a3cf0ce355c7e11f47aff33f1369d647982d | |
parent | aa673436ab4fb13a810b6cdc4624f830c529d704 (diff) | |
download | infinity-for-reddit-df1476692dc3cf4bc93ac8a02a58aecf046e532c.tar infinity-for-reddit-df1476692dc3cf4bc93ac8a02a58aecf046e532c.tar.gz infinity-for-reddit-df1476692dc3cf4bc93ac8a02a58aecf046e532c.tar.bz2 infinity-for-reddit-df1476692dc3cf4bc93ac8a02a58aecf046e532c.tar.lz infinity-for-reddit-df1476692dc3cf4bc93ac8a02a58aecf046e532c.tar.xz infinity-for-reddit-df1476692dc3cf4bc93ac8a02a58aecf046e532c.tar.zst infinity-for-reddit-df1476692dc3cf4bc93ac8a02a58aecf046e532c.zip |
Long press the preview ImageView in video autoplay ViewHolder in PostRecyclerViewAdapter and CommentAndPostRecyclerViewAdapter to open videos in fullscreen.
Diffstat (limited to '')
2 files changed, 12 insertions, 2 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java index 0faf9c78..05e1d0c5 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java @@ -2411,10 +2411,15 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy intent.putExtra(ViewVideoActivity.EXTRA_ID, mPost.getId()); } intent.putExtra(ViewVideoActivity.EXTRA_POST_TITLE, mPost.getTitle()); - intent.putExtra(ViewVideoActivity.EXTRA_PROGRESS_SECONDS, helper.getLatestPlaybackInfo().getResumePosition()); + if (helper != null) { + intent.putExtra(ViewVideoActivity.EXTRA_PROGRESS_SECONDS, helper.getLatestPlaybackInfo().getResumePosition()); + } intent.putExtra(ViewVideoActivity.EXTRA_IS_NSFW, mPost.isNSFW()); mActivity.startActivity(intent); }); + + previewImageView.setOnLongClickListener(view -> fullscreenButton.performClick()); + playerView.setOnLongClickListener(view -> fullscreenButton.performClick()); } void bindVideoUri(Uri videoUri) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java index 869442b8..d9e9c0de 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java @@ -1892,11 +1892,16 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView intent.putExtra(ViewVideoActivity.EXTRA_ID, post.getId()); } intent.putExtra(ViewVideoActivity.EXTRA_POST_TITLE, post.getTitle()); - intent.putExtra(ViewVideoActivity.EXTRA_PROGRESS_SECONDS, helper.getLatestPlaybackInfo().getResumePosition()); + if (helper != null) { + intent.putExtra(ViewVideoActivity.EXTRA_PROGRESS_SECONDS, helper.getLatestPlaybackInfo().getResumePosition()); + } intent.putExtra(ViewVideoActivity.EXTRA_IS_NSFW, post.isNSFW()); mActivity.startActivity(intent); } }); + + previewImageView.setOnLongClickListener(view -> fullscreenButton.performClick()); + videoPlayer.setOnLongClickListener(view -> fullscreenButton.performClick()); } void bindVideoUri(Uri videoUri) { |