mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 00:10:32 +05:30
Merge pull request #2008 from Bnyro/remember-share-with-time-code
Remember last user choice on sharing with time code
This commit is contained in:
commit
5bf62e12b5
@ -83,6 +83,7 @@ class ShareDialog(
|
||||
)
|
||||
binding!!.timeCodeSwitch.setOnCheckedChangeListener { _, isChecked ->
|
||||
binding!!.timeStampLayout.visibility = if (isChecked) View.VISIBLE else View.GONE
|
||||
PreferenceHelper.putBoolean(PreferenceKeys.SHARE_WITH_TIME_CODE, isChecked)
|
||||
}
|
||||
binding!!.timeStamp.setText((shareData.currentPosition ?: 0L).toString())
|
||||
if (binding!!.timeCodeSwitch.isChecked) binding!!.timeStampLayout.visibility = View.VISIBLE
|
||||
|
@ -29,10 +29,14 @@ object PreferenceHelper {
|
||||
authEditor = authSettings.edit()
|
||||
}
|
||||
|
||||
fun putString(key: String?, value: String) {
|
||||
fun putString(key: String, value: String) {
|
||||
editor.putString(key, value).commit()
|
||||
}
|
||||
|
||||
fun putBoolean(key: String, value: Boolean) {
|
||||
editor.putBoolean(key, value).commit()
|
||||
}
|
||||
|
||||
fun getString(key: String?, defValue: String): String {
|
||||
return settings.getString(key, defValue) ?: defValue
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user