Remove "Detail Page" open action from share dialog under certain circumstances
With the new application workflow and unified player, video detail page and video player are the same activity. So show only one of these options based on whether autoplay is enabled or not, and show both if using external player
This commit is contained in:
parent
6f9b03ac11
commit
0949453cb5
4 changed files with 75 additions and 35 deletions
|
|
@ -1236,7 +1236,7 @@ public class VideoDetailFragment
|
|||
}
|
||||
|
||||
private boolean isExternalPlayerEnabled() {
|
||||
return PreferenceManager.getDefaultSharedPreferences(getContext())
|
||||
return PreferenceManager.getDefaultSharedPreferences(requireContext())
|
||||
.getBoolean(getString(R.string.use_external_video_player_key), false);
|
||||
}
|
||||
|
||||
|
|
@ -1247,23 +1247,7 @@ public class VideoDetailFragment
|
|||
&& !isExternalPlayerEnabled()
|
||||
&& (player == null || player.videoPlayerSelected())
|
||||
&& bottomSheetState != BottomSheetBehavior.STATE_HIDDEN
|
||||
&& isAutoplayAllowedByUser();
|
||||
}
|
||||
|
||||
private boolean isAutoplayAllowedByUser() {
|
||||
if (activity == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (PlayerHelper.getAutoplayType(activity)) {
|
||||
case PlayerHelper.AutoplayType.AUTOPLAY_TYPE_NEVER:
|
||||
return false;
|
||||
case PlayerHelper.AutoplayType.AUTOPLAY_TYPE_WIFI:
|
||||
return !ListHelper.isMeteredNetwork(activity);
|
||||
case PlayerHelper.AutoplayType.AUTOPLAY_TYPE_ALWAYS:
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
&& PlayerHelper.isAutoplayAllowedByUser(requireContext());
|
||||
}
|
||||
|
||||
private void addVideoPlayerView() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue