From 5048bc53681a6f7062226e63a8cd7197c38b0aae Mon Sep 17 00:00:00 2001 From: LagradOst Date: Sun, 10 Oct 2021 23:46:51 +0200 Subject: [PATCH] small fixes --- app/build.gradle | 4 ++-- .../cloudstream3/ui/player/PlayerFragment.kt | 17 +++++++++++++++-- .../main/res/layout/download_child_episode.xml | 1 + .../main/res/layout/download_header_episode.xml | 1 + app/src/main/res/layout/result_episode.xml | 1 + 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e41c48e0..91c3d989 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -34,8 +34,8 @@ android { applicationId "com.lagradost.cloudstream3" minSdkVersion 21 targetSdkVersion 31 - versionCode 27 - versionName "1.9.12" + versionCode 28 + versionName "2.0.0" resValue "string", "app_version", "${defaultConfig.versionName}${versionNameSuffix ?: ""}" 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 6efdf50f..20c26c69 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 @@ -1392,6 +1392,7 @@ class PlayerFragment : Fragment() { val subsSettings = sourceDialog.findViewById(R.id.subs_settings)!! subsSettings.setOnClickListener { + saveArguments() SubtitlesFragment.push(activity) sourceDialog.dismiss() } @@ -1564,7 +1565,6 @@ class PlayerFragment : Fragment() { private var isCurrentlySkippingEp = false - fun tryNextMirror() { val urls = getUrls() val current = getCurrentUrl() @@ -1637,7 +1637,6 @@ class PlayerFragment : Fragment() { } override fun onDestroy() { - /* val lp = activity?.window?.attributes @@ -1689,6 +1688,20 @@ class PlayerFragment : Fragment() { } } + private fun saveArguments() { + if (this::exoPlayer.isInitialized) { + arguments?.putInt(STATE_RESUME_WINDOW, exoPlayer.currentWindowIndex) + arguments?.putLong(STATE_RESUME_POSITION, exoPlayer.currentPosition) + } + arguments?.putBoolean(STATE_PLAYER_FULLSCREEN, isFullscreen) + arguments?.putBoolean(STATE_PLAYER_PLAYING, isPlayerPlaying) + arguments?.putInt(RESIZE_MODE_KEY, resizeMode) + arguments?.putFloat(PLAYBACK_SPEED, playbackSpeed) + if (!isDownloadedFile) { + arguments?.putString("data", mapper.writeValueAsString(playerData)) + } + } + override fun onSaveInstanceState(outState: Bundle) { savePos() diff --git a/app/src/main/res/layout/download_child_episode.xml b/app/src/main/res/layout/download_child_episode.xml index b251642d..d474d38b 100644 --- a/app/src/main/res/layout/download_child_episode.xml +++ b/app/src/main/res/layout/download_child_episode.xml @@ -29,6 +29,7 @@ android:layout_height="5dp"> diff --git a/app/src/main/res/layout/result_episode.xml b/app/src/main/res/layout/result_episode.xml index a8dc0f5b..526dcb5d 100644 --- a/app/src/main/res/layout/result_episode.xml +++ b/app/src/main/res/layout/result_episode.xml @@ -51,6 +51,7 @@ android:layout_height="5dp">