@Override void onItemClick(View view, int position, Content.Media media, PlaybackInfo info) { String content = getString(contents[position % contents.length]); Point viewSize = new Point(view.getWidth(), view.getHeight()); Point videoSize = new Point(view.getWidth(), view.getHeight()); if (view instanceof PlayerView && ((PlayerView) view).getPlayer() != null) { Player player = ((PlayerView) view).getPlayer(); Format videoFormat = player instanceof SimpleExoPlayer ? // ((SimpleExoPlayer) player).getVideoFormat() : null; if (videoFormat != null && videoFormat.width != Format.NO_VALUE && videoFormat.height != Format.NO_VALUE) { videoSize.set(videoFormat.width, videoFormat.height); } } Intent intent = createIntent(requireContext(), position, media.mediaUri, // content, info, viewSize, videoSize, true); ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation( // requireActivity(), view, ViewCompat.getTransitionName(view)); startActivityForResult(intent, RQ_PLAYBACK_INFO, options.toBundle()); } });
@Override void onItemClick(View view, int position, Content.Media media, PlaybackInfo info) { String content = getString(contents[position % contents.length]); Point viewSize = new Point(view.getWidth(), view.getHeight()); Point videoSize = new Point(view.getWidth(), view.getHeight()); if (view instanceof PlayerView && ((PlayerView) view).getPlayer() != null) { Player player = ((PlayerView) view).getPlayer(); Format videoFormat = // player instanceof SimpleExoPlayer ? ((SimpleExoPlayer) player).getVideoFormat() : null; if (videoFormat != null && videoFormat.width != Format.NO_VALUE && videoFormat.height != Format.NO_VALUE) { videoSize.set(videoFormat.width, videoFormat.height); } } Intent intent = SinglePlayerActivity.createIntent(getContext(), position, media.mediaUri, // content, info, viewSize, videoSize, false); //noinspection ConstantConditions ActivityOptionsCompat options = ActivityOptionsCompat. makeSceneTransitionAnimation(getActivity(), view, ViewCompat.getTransitionName(view)); startActivityForResult(intent, RQ_PLAYBACK_INFO, options.toBundle()); } });