mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-15 06:40:30 +05:30
add toggle
This commit is contained in:
parent
458af7d7d4
commit
e7e4cf7c07
@ -455,7 +455,10 @@ class PlayerFragment : Fragment() {
|
||||
if (!relatedStreamsEnabled) toggleComments()
|
||||
// prepare for autoplay
|
||||
initAutoPlay()
|
||||
PreferenceHelper.addToWatchHistory(requireContext(), videoId!!, response)
|
||||
val watchHistoryEnabled =
|
||||
PreferenceHelper.getBoolean(requireContext(), "Watch_history_toggle", true)
|
||||
if (watchHistoryEnabled)
|
||||
PreferenceHelper.addToWatchHistory(requireContext(), videoId!!, response)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,12 +18,20 @@ class AdvancedSettings : PreferenceFragmentCompat() {
|
||||
val settingsActivity = activity as SettingsActivity
|
||||
settingsActivity.binding.topBarTextView.text = getString(R.string.advanced)
|
||||
|
||||
// clear search history
|
||||
val clearHistory = findPreference<Preference>("clear_history")
|
||||
clearHistory?.setOnPreferenceClickListener {
|
||||
PreferenceHelper.removePreference(requireContext(), "search_history")
|
||||
true
|
||||
}
|
||||
|
||||
// clear watch history
|
||||
val clearWatchHistory = findPreference<Preference>("clear_watch_history")
|
||||
clearWatchHistory?.setOnPreferenceClickListener {
|
||||
PreferenceHelper.removePreference(requireContext(), "watch_history")
|
||||
true
|
||||
}
|
||||
|
||||
val resetSettings = findPreference<Preference>("reset_settings")
|
||||
resetSettings?.setOnPreferenceClickListener {
|
||||
showResetDialog()
|
||||
|
@ -79,7 +79,7 @@
|
||||
<string name="okay">OK</string>
|
||||
<string name="history">History</string>
|
||||
<string name="search_history">Search History</string>
|
||||
<string name="clear_history">Clear History</string>
|
||||
<string name="clear_history">Clear search history</string>
|
||||
<string name="music_songs">YT Music Songs</string>
|
||||
<string name="music_videos">YT Music Videos</string>
|
||||
<string name="music_albums">YT Music Albums</string>
|
||||
@ -207,4 +207,5 @@
|
||||
<string name="deleteAccount_summary">Delete your Piped account</string>
|
||||
<string name="account">Account</string>
|
||||
<string name="restore">Restore</string>
|
||||
<string name="watch_history">Watch history</string>
|
||||
</resources>
|
@ -46,6 +46,21 @@
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory app:title="@string/watch_history">
|
||||
|
||||
<SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:icon="@drawable/ic_history_filled"
|
||||
app:key="watch_history_toggle"
|
||||
app:title="@string/watch_history" />
|
||||
|
||||
<Preference
|
||||
android:icon="@drawable/ic_trash"
|
||||
app:key="clear_watch_history"
|
||||
app:title="@string/clear_history" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory>
|
||||
|
||||
<Preference
|
||||
|
Loading…
Reference in New Issue
Block a user