fixed android 12 issue

This commit is contained in:
LagradOst 2021-10-28 13:05:23 +02:00
parent 2dabc111cd
commit 2f71fa5664
2 changed files with 11 additions and 10 deletions

View file

@ -868,28 +868,28 @@ class PlayerFragment : Fragment() {
} }
private fun updateLock() { private fun updateLock() {
video_locked_img.setImageResource(if (isLocked) R.drawable.video_locked else R.drawable.video_unlocked) video_locked_img?.setImageResource(if (isLocked) R.drawable.video_locked else R.drawable.video_unlocked)
val color = if (isLocked) ContextCompat.getColor(requireContext(), R.color.videoColorPrimary) val color = if (isLocked) ContextCompat.getColor(requireContext(), R.color.videoColorPrimary)
else Color.WHITE else Color.WHITE
video_locked_text.setTextColor(color) video_locked_text?.setTextColor(color)
video_locked_img.setColorFilter(color) video_locked_img?.setColorFilter(color)
val isClick = !isLocked val isClick = !isLocked
exo_play.isClickable = isClick exo_play?.isClickable = isClick
exo_pause.isClickable = isClick exo_pause?.isClickable = isClick
exo_ffwd?.isClickable = isClick exo_ffwd?.isClickable = isClick
exo_rew?.isClickable = isClick exo_rew?.isClickable = isClick
exo_prev.isClickable = isClick exo_prev?.isClickable = isClick
video_go_back.isClickable = isClick video_go_back?.isClickable = isClick
exo_progress.isClickable = isClick exo_progress?.isClickable = isClick
//next_episode_btt.isClickable = isClick //next_episode_btt.isClickable = isClick
playback_speed_btt?.isClickable = isClick playback_speed_btt?.isClickable = isClick
skip_op?.isClickable = isClick skip_op?.isClickable = isClick
skip_episode?.isClickable = isClick skip_episode?.isClickable = isClick
resize_player?.isClickable = isClick resize_player?.isClickable = isClick
exo_progress.isEnabled = isClick exo_progress?.isEnabled = isClick
player_media_route_button?.isEnabled = isClick player_media_route_button?.isEnabled = isClick
if (isClick && isShowing) { if (isClick && isShowing) {
player_pause_holder?.alpha = 1f player_pause_holder?.alpha = 1f
@ -1215,6 +1215,7 @@ class PlayerFragment : Fragment() {
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
updateLock()
context?.let { ctx -> context?.let { ctx ->
setPreferredSubLanguage(ctx.getAutoSelectLanguageISO639_1()) setPreferredSubLanguage(ctx.getAutoSelectLanguageISO639_1())
} }

View file

@ -348,7 +348,7 @@ object VideoDownloadManager {
// BECAUSE episodes lying near will have the same id +1, index will give the same requested as the previous episode, *100000 fixes this // BECAUSE episodes lying near will have the same id +1, index will give the same requested as the previous episode, *100000 fixes this
context, (4337 + index * 100000 + ep.id), context, (4337 + index * 100000 + ep.id),
actionResultIntent, actionResultIntent,
PendingIntent.FLAG_UPDATE_CURRENT PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
) )
builder.addAction( builder.addAction(