From 4ee7623fbed8602a372f08ae95e81cad3c6d5e48 Mon Sep 17 00:00:00 2001 From: LagradOst Date: Thu, 16 Sep 2021 16:01:01 +0200 Subject: [PATCH] resize toast --- .../cloudstream3/ui/player/PlayerFragment.kt | 13 ++++++++----- app/src/main/res/values/strings.xml | 4 ++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/player/PlayerFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/player/PlayerFragment.kt index 27011db2..bff99554 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/player/PlayerFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/player/PlayerFragment.kt @@ -810,9 +810,9 @@ class PlayerFragment : Fragment() { } private val resizeModes = listOf( - AspectRatioFrameLayout.RESIZE_MODE_FIT, - AspectRatioFrameLayout.RESIZE_MODE_FILL, - AspectRatioFrameLayout.RESIZE_MODE_ZOOM, + Pair(AspectRatioFrameLayout.RESIZE_MODE_FIT, R.string.resize_fit), + Pair(AspectRatioFrameLayout.RESIZE_MODE_FILL, R.string.resize_fill), + Pair(AspectRatioFrameLayout.RESIZE_MODE_ZOOM, R.string.resize_zoom), ) private var localData: LoadResponse? = null @@ -1470,14 +1470,17 @@ class PlayerFragment : Fragment() { } } - player_view.resizeMode = resizeModes[resizeMode] + player_view.resizeMode = resizeModes[resizeMode].first if (playerResizeEnabled) { resize_player.visibility = VISIBLE resize_player.setOnClickListener { resizeMode = (resizeMode + 1) % resizeModes.size requireContext().setKey(RESIZE_MODE_KEY, resizeMode) - player_view.resizeMode = resizeModes[resizeMode] + player_view.resizeMode = resizeModes[resizeMode].first + activity?.let { act -> + showToast(act, resizeModes[resizeMode].second, Toast.LENGTH_SHORT); + } //exoPlayer.videoScalingMode = C.VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING } } else { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 462eb9f3..bf0b3906 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -257,6 +257,10 @@ Preferred watch quality Display Dubbed/Subbed Anime + Fit to screen + Stretch + Zoom + Disclaimer legal_notice_key Any legal issues regarding the content on this application should be taken up with the actual file hosts and providers themselves as we are not affiliated with them.