From 8fa00f4ca902683430d1f12f128edb645a09e78d Mon Sep 17 00:00:00 2001 From: reduplicated <110570621+reduplicated@users.noreply.github.com> Date: Sat, 5 Nov 2022 22:15:34 +0100 Subject: [PATCH] added setting for skip op and changed key for player seek amount --- .../cloudstream3/ui/player/GeneratorPlayer.kt | 11 +- app/src/main/res/values/strings.xml | 5 +- app/src/main/res/xml/settings_player.xml | 190 +++++++++--------- 3 files changed, 112 insertions(+), 94 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/player/GeneratorPlayer.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/player/GeneratorPlayer.kt index f4d2cd2f..95a9393f 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/player/GeneratorPlayer.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/player/GeneratorPlayer.kt @@ -187,6 +187,7 @@ class GeneratorPlayer : FullScreenPlayer() { ), ) } + if (!sameEpisode) player.addTimeStamps(listOf()) // clear stamps } @@ -874,7 +875,15 @@ class GeneratorPlayer : FullScreenPlayer() { if (duration <= 0L) return // idk how you achieved this, but div by zero crash if (!hasRequestedStamps) { hasRequestedStamps = true - viewModel.loadStamps(duration) + val fetchStamps = context?.let { ctx -> + val settingsManager = PreferenceManager.getDefaultSharedPreferences(ctx) + settingsManager.getBoolean( + ctx.getString(R.string.enable_skip_op_from_database), + true + ) + } ?: true + if (fetchStamps) + viewModel.loadStamps(duration) } viewModel.getId()?.let { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e3ef9f6b..e2ebf0ab 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -28,7 +28,7 @@ pip_enabled_key double_tap_enabled_key double_tap_pause_enabled_key - double_tap_seek_time_key + double_tap_seek_time_key2 swipe_vertical_enabled_key autoplay_next_key display_sub_key @@ -57,6 +57,7 @@ filter_sub_lang_key pref_filter_search_quality_key enable_nsfw_on_providers_key + enable_skip_op_from_database %d %s | %s @@ -650,4 +651,6 @@ Clear history History + Show skip popups for opening/ending + diff --git a/app/src/main/res/xml/settings_player.xml b/app/src/main/res/xml/settings_player.xml index 6946a5c9..0be6313f 100644 --- a/app/src/main/res/xml/settings_player.xml +++ b/app/src/main/res/xml/settings_player.xml @@ -1,126 +1,132 @@ + xmlns:app="http://schemas.android.com/apk/res-auto"> + android:icon="@drawable/ic_outline_subtitles_24" + android:key="@string/subtitle_settings_key" + android:title="@string/player_subtitles_settings" + app:summary="@string/player_subtitles_settings_des" /> + android:icon="@drawable/ic_outline_subtitles_24" + android:key="@string/subtitle_settings_chromecast_key" + android:title="@string/chromecast_subtitles_settings" + app:summary="@string/chromecast_subtitles_settings_des" /> + android:icon="@drawable/ic_baseline_hd_24" + android:key="@string/quality_pref_key" + android:title="@string/watch_quality_pref" /> + android:icon="@drawable/netflix_play" + android:key="@string/player_pref_key" + android:title="@string/player_pref" /> + android:icon="@drawable/ic_baseline_text_format_24" + android:key="@string/prefer_limit_title_key" + android:title="@string/limit_title" /> + android:icon="@drawable/ic_baseline_text_format_24" + android:key="@string/prefer_limit_title_rez_key" + android:title="@string/limit_title_rez" /> + android:icon="@drawable/ic_baseline_picture_in_picture_alt_24" + android:summary="@string/picture_in_picture_des" + android:title="@string/picture_in_picture" + app:defaultValue="true" + app:key="@string/pip_enabled_key" /> + android:icon="@drawable/ic_baseline_aspect_ratio_24" + android:summary="@string/player_size_settings_des" + android:title="@string/player_size_settings" + app:defaultValue="true" + app:key="@string/player_resize_enabled_key" /> + android:icon="@drawable/ic_baseline_speed_24" + android:summary="@string/eigengraumode_settings_des" + android:title="@string/eigengraumode_settings" + app:defaultValue="false" + app:key="@string/playback_speed_enabled_key" /> + android:icon="@drawable/ic_baseline_ondemand_video_24" + android:summary="@string/swipe_to_seek_settings_des" + android:title="@string/swipe_to_seek_settings" + app:defaultValue="true" + app:key="@string/swipe_enabled_key" /> - + android:icon="@drawable/ic_baseline_ondemand_video_24" + android:summary="@string/swipe_to_change_settings_des" + android:title="@string/swipe_to_change_settings" + app:defaultValue="true" + app:key="@string/swipe_vertical_enabled_key" /> + android:icon="@drawable/ic_baseline_skip_next_24" + android:summary="@string/autoplay_next_settings_des" + android:title="@string/autoplay_next_settings" + app:defaultValue="true" + app:key="@string/autoplay_next_key" /> + android:icon="@drawable/ic_baseline_skip_next_24" + android:title="@string/video_skip_op" + app:defaultValue="true" + android:summary="@string/enable_skip_op_from_database_des" + app:key="@string/enable_skip_op_from_database" /> + + + android:defaultValue="10" + android:max="60" + android:title="@string/double_tap_to_seek_amount_settings" + app:adjustable="true" + app:defaultValue="10" + app:icon="@drawable/go_forward_30" + app:key="@string/double_tap_seek_time_key" + app:min="5" + app:seekBarIncrement="5" + app:showSeekBarValue="true" /> + android:icon="@drawable/baseline_sync_24" + android:summary="@string/episode_sync_settings_des" + android:title="@string/episode_sync_settings" + app:defaultValue="true" + app:key="@string/episode_sync_enabled_key" /> + android:icon="@drawable/ic_baseline_storage_24" + android:key="@string/video_buffer_disk_key" + android:summary="@string/video_disk_description" + android:title="@string/video_buffer_disk_settings" /> + android:icon="@drawable/ic_baseline_storage_24" + android:key="@string/video_buffer_size_key" + android:summary="@string/video_ram_description" + android:title="@string/video_buffer_size_settings" /> + android:icon="@drawable/ic_baseline_storage_24" + android:key="@string/video_buffer_length_key" + android:summary="@string/video_ram_description" + android:title="@string/video_buffer_length_settings" /> + android:icon="@drawable/ic_baseline_delete_outline_24" + android:key="@string/video_buffer_clear_key" + android:title="@string/video_buffer_clear_settings" /> \ No newline at end of file