mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-18 06:23:56 +00:00
Revert "removed sub dub toggle(useless)"
This reverts commit 60981ba224.
This commit is contained in:
@@ -53,6 +53,7 @@ class MediaDetailsViewModel : ViewModel() {
|
||||
true -> sharedPreferences.getInt("settings_def_anime_source_s_r", 0)
|
||||
else -> sharedPreferences.getInt(("settings_def_manga_source_s_r"), 0)
|
||||
}
|
||||
it.preferDub = loadData("settings_prefer_dub") ?: false
|
||||
saveSelected(media.id, it)
|
||||
it
|
||||
}
|
||||
|
||||
@@ -436,6 +436,11 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene
|
||||
).edit().putBoolean("shared_user_id", isChecked).apply()
|
||||
}
|
||||
|
||||
binding.settingsPreferDub.isChecked = loadData("settings_prefer_dub") ?: false
|
||||
binding.settingsPreferDub.setOnCheckedChangeListener { _, isChecked ->
|
||||
saveData("settings_prefer_dub", isChecked)
|
||||
}
|
||||
|
||||
//val mangaSource = loadData<Int>("settings_def_manga_source_s")?.let { if (it >= MangaSources.names.size) 0 else it } ?: 0
|
||||
val mangaSource = getSharedPreferences(
|
||||
"Dantotsu",
|
||||
|
||||
@@ -36,6 +36,7 @@ class SubscriptionHelper {
|
||||
} else {
|
||||
sharedPreferences.getInt("settings_def_manga_source_s_r", 0)
|
||||
}
|
||||
it.preferDub = loadData("settings_prefer_dub", context) ?: false
|
||||
it
|
||||
}
|
||||
return data
|
||||
|
||||
@@ -1208,6 +1208,24 @@
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="?android:attr/listDivider" />
|
||||
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/settingsPreferDub"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:drawableStart="@drawable/ic_round_audiotrack_24"
|
||||
android:drawablePadding="16dp"
|
||||
android:elegantTextHeight="true"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:minHeight="64dp"
|
||||
android:text="@string/prefer_dub"
|
||||
android:textAlignment="viewStart"
|
||||
android:textColor="?attr/colorOnBackground"
|
||||
app:cornerRadius="0dp"
|
||||
app:drawableTint="?attr/colorPrimary"
|
||||
app:showText="false"
|
||||
app:thumbTint="@color/button_switch_track" />
|
||||
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/settingsShowYt"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
Reference in New Issue
Block a user