Fix backup and restore prefs title and dead code

This commit is contained in:
Bnyro 2022-12-05 18:52:52 +01:00
parent 349f353146
commit efc2f7d5e3
2 changed files with 4 additions and 15 deletions

View File

@ -8,6 +8,7 @@ import androidx.activity.result.contract.ActivityResultContracts.CreateDocument
import androidx.preference.Preference
import com.github.libretube.R
import com.github.libretube.obj.BackupFile
import com.github.libretube.ui.activities.SettingsActivity
import com.github.libretube.ui.base.BasePreferenceFragment
import com.github.libretube.ui.dialogs.BackupDialog
import com.github.libretube.util.BackupHelper
@ -76,6 +77,9 @@ class BackupRestoreSettings : BasePreferenceFragment() {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
setPreferencesFromResource(R.xml.import_export_settings, rootKey)
val settingsActivity = activity as? SettingsActivity
settingsActivity?.changeTopBarText(getString(R.string.backup_restore))
val importSubscriptions = findPreference<Preference>("import_subscriptions")
importSubscriptions?.setOnPreferenceClickListener {
getSubscriptionsFile.launch("*/*")

View File

@ -56,19 +56,4 @@
</PreferenceCategory>
<PreferenceCategory app:title="@string/restore">
<Preference
android:icon="@drawable/ic_download_filled"
android:summary="@string/import_from_yt_summary"
app:key="import_from_yt"
app:title="@string/import_from_yt" />
<Preference
android:icon="@drawable/ic_upload"
app:key="export_subs"
app:title="@string/export_subscriptions" />
</PreferenceCategory>
</PreferenceScreen>