mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Disable subs toggle
This commit is contained in:
parent
06c2cf86ec
commit
1dcdfbaca7
3 changed files with 36 additions and 3 deletions
|
@ -44,6 +44,7 @@ import java.io.File
|
|||
const val SUBTITLE_KEY = "subtitle_settings"
|
||||
const val SUBTITLE_AUTO_SELECT_KEY = "subs_auto_select"
|
||||
const val SUBTITLE_DOWNLOAD_KEY = "subs_auto_download"
|
||||
const val PRIOR_SUB_LANGUAGE = "prior_sub_language"
|
||||
|
||||
data class SaveCaptionStyle(
|
||||
@JsonProperty("foregroundColor") var foregroundColor: Int,
|
||||
|
@ -60,6 +61,7 @@ data class SaveCaptionStyle(
|
|||
@JsonProperty("fixedTextSize") var fixedTextSize: Float?,
|
||||
@JsonProperty("removeCaptions") var removeCaptions: Boolean = false,
|
||||
@JsonProperty("removeBloat") var removeBloat: Boolean = true,
|
||||
@JsonProperty("removeSubs") var removeSubs: Boolean = false,
|
||||
/** Apply caps lock to the text **/
|
||||
@JsonProperty("upperCase") var upperCase: Boolean = false,
|
||||
)
|
||||
|
@ -415,6 +417,23 @@ class SubtitlesFragment : Fragment() {
|
|||
}
|
||||
}
|
||||
|
||||
subtitles_disable_subs?.isChecked = state.removeSubs
|
||||
subtitles_disable_subs?.setOnCheckedChangeListener { _, b ->
|
||||
state.removeSubs = b
|
||||
if (b) {
|
||||
setKey(
|
||||
PRIOR_SUB_LANGUAGE,
|
||||
getKey(SUBTITLE_AUTO_SELECT_KEY) ?: "en"
|
||||
)
|
||||
setKey(SUBTITLE_AUTO_SELECT_KEY, "")
|
||||
} else {
|
||||
setKey(
|
||||
SUBTITLE_AUTO_SELECT_KEY,
|
||||
getKey(PRIOR_SUB_LANGUAGE) ?: "en"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
subtitles_remove_bloat?.isChecked = state.removeBloat
|
||||
subtitles_remove_bloat?.setOnCheckedChangeListener { _, b ->
|
||||
state.removeBloat = b
|
||||
|
|
|
@ -140,9 +140,22 @@
|
|||
android:nextFocusRight="@id/cancel_btt"
|
||||
|
||||
android:nextFocusUp="@id/subs_auto_select_language"
|
||||
android:nextFocusDown="@id/subtitles_remove_bloat"
|
||||
android:nextFocusDown="@id/subtitles_disable_subs"
|
||||
android:text="@string/subs_download_languages" />
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/subtitles_disable_subs"
|
||||
style="@style/SettingsItem"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fontFamily="@font/google_sans"
|
||||
android:nextFocusLeft="@id/apply_btt"
|
||||
android:nextFocusRight="@id/cancel_btt"
|
||||
android:nextFocusUp="@id/subs_download_languages"
|
||||
android:nextFocusDown="@id/subtitles_remove_bloat"
|
||||
android:text="@string/subtitles_disable_subs"
|
||||
app:drawableEndCompat="@null" />
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/subtitles_remove_bloat"
|
||||
style="@style/SettingsItem"
|
||||
|
@ -151,7 +164,7 @@
|
|||
android:fontFamily="@font/google_sans"
|
||||
android:nextFocusLeft="@id/apply_btt"
|
||||
android:nextFocusRight="@id/cancel_btt"
|
||||
android:nextFocusUp="@id/subs_download_languages"
|
||||
android:nextFocusUp="@id/subtitles_disable_subs"
|
||||
android:nextFocusDown="@id/subtitles_remove_captions"
|
||||
android:text="@string/subtitles_remove_bloat"
|
||||
app:drawableEndCompat="@null" />
|
||||
|
|
|
@ -521,6 +521,7 @@
|
|||
<string name="error_invalid_url">Invalid URL</string>
|
||||
<string name="error">Error</string>
|
||||
<string name="subtitles_remove_captions">Remove closed captions from subtitles</string>
|
||||
<string name="subtitles_disable_subs">Disable subtitles</string>
|
||||
<string name="subtitles_remove_bloat">Remove bloat from subtitles</string>
|
||||
<string name="subtitles_filter_lang">Filter by preferred media language</string>
|
||||
<string name="extras">Extras</string>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue