Long press the preview ImageView in video autoplay ViewHolder in PostRecyclerViewAdapter and CommentAndPostRecyclerViewAdapter to open videos in fullscreen.

This commit is contained in:
Alex Ning 2020-09-13 22:24:50 +08:00
parent aa673436ab
commit df1476692d
2 changed files with 12 additions and 2 deletions

View File

@ -2411,10 +2411,15 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
intent.putExtra(ViewVideoActivity.EXTRA_ID, mPost.getId()); intent.putExtra(ViewVideoActivity.EXTRA_ID, mPost.getId());
} }
intent.putExtra(ViewVideoActivity.EXTRA_POST_TITLE, mPost.getTitle()); 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()); intent.putExtra(ViewVideoActivity.EXTRA_IS_NSFW, mPost.isNSFW());
mActivity.startActivity(intent); mActivity.startActivity(intent);
}); });
previewImageView.setOnLongClickListener(view -> fullscreenButton.performClick());
playerView.setOnLongClickListener(view -> fullscreenButton.performClick());
} }
void bindVideoUri(Uri videoUri) { void bindVideoUri(Uri videoUri) {

View File

@ -1892,11 +1892,16 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
intent.putExtra(ViewVideoActivity.EXTRA_ID, post.getId()); intent.putExtra(ViewVideoActivity.EXTRA_ID, post.getId());
} }
intent.putExtra(ViewVideoActivity.EXTRA_POST_TITLE, post.getTitle()); 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()); intent.putExtra(ViewVideoActivity.EXTRA_IS_NSFW, post.isNSFW());
mActivity.startActivity(intent); mActivity.startActivity(intent);
} }
}); });
previewImageView.setOnLongClickListener(view -> fullscreenButton.performClick());
videoPlayer.setOnLongClickListener(view -> fullscreenButton.performClick());
} }
void bindVideoUri(Uri videoUri) { void bindVideoUri(Uri videoUri) {