resize toast

This commit is contained in:
LagradOst 2021-09-16 16:01:01 +02:00
parent 5ae56a07ad
commit 4ee7623fbe
2 changed files with 12 additions and 5 deletions

View file

@ -810,9 +810,9 @@ class PlayerFragment : Fragment() {
} }
private val resizeModes = listOf( private val resizeModes = listOf(
AspectRatioFrameLayout.RESIZE_MODE_FIT, Pair(AspectRatioFrameLayout.RESIZE_MODE_FIT, R.string.resize_fit),
AspectRatioFrameLayout.RESIZE_MODE_FILL, Pair(AspectRatioFrameLayout.RESIZE_MODE_FILL, R.string.resize_fill),
AspectRatioFrameLayout.RESIZE_MODE_ZOOM, Pair(AspectRatioFrameLayout.RESIZE_MODE_ZOOM, R.string.resize_zoom),
) )
private var localData: LoadResponse? = null 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) { if (playerResizeEnabled) {
resize_player.visibility = VISIBLE resize_player.visibility = VISIBLE
resize_player.setOnClickListener { resize_player.setOnClickListener {
resizeMode = (resizeMode + 1) % resizeModes.size resizeMode = (resizeMode + 1) % resizeModes.size
requireContext().setKey(RESIZE_MODE_KEY, resizeMode) 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 //exoPlayer.videoScalingMode = C.VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING
} }
} else { } else {

View file

@ -257,6 +257,10 @@
<string name="watch_quality_pref">Preferred watch quality</string> <string name="watch_quality_pref">Preferred watch quality</string>
<string name="display_subbed_dubbed_settings">Display Dubbed/Subbed Anime</string> <string name="display_subbed_dubbed_settings">Display Dubbed/Subbed Anime</string>
<string name="resize_fit">Fit to screen</string>
<string name="resize_fill">Stretch</string>
<string name="resize_zoom">Zoom</string>
<string name="legal_notice" translatable="false">Disclaimer</string> <string name="legal_notice" translatable="false">Disclaimer</string>
<string name="legal_notice_key" translatable="false">legal_notice_key</string> <string name="legal_notice_key" translatable="false">legal_notice_key</string>
<string name="legal_notice_text" translatable="false">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. <string name="legal_notice_text" translatable="false">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.