|
|
@ -4,6 +4,9 @@ import android.content.Intent |
|
|
|
import android.content.SharedPreferences |
|
|
|
import android.content.SharedPreferences |
|
|
|
import android.os.Bundle |
|
|
|
import android.os.Bundle |
|
|
|
import android.text.InputType |
|
|
|
import android.text.InputType |
|
|
|
|
|
|
|
import android.view.Menu |
|
|
|
|
|
|
|
import android.view.MenuInflater |
|
|
|
|
|
|
|
import android.view.MenuItem |
|
|
|
import android.view.View |
|
|
|
import android.view.View |
|
|
|
import androidx.preference.EditTextPreference |
|
|
|
import androidx.preference.EditTextPreference |
|
|
|
import androidx.preference.ListPreference |
|
|
|
import androidx.preference.ListPreference |
|
|
@ -57,13 +60,30 @@ class BackupConfigFragment : BasePreferenceFragment(), |
|
|
|
super.onViewCreated(view, savedInstanceState) |
|
|
|
super.onViewCreated(view, savedInstanceState) |
|
|
|
preferenceManager.sharedPreferences.registerOnSharedPreferenceChangeListener(this) |
|
|
|
preferenceManager.sharedPreferences.registerOnSharedPreferenceChangeListener(this) |
|
|
|
ATH.applyEdgeEffectColor(listView) |
|
|
|
ATH.applyEdgeEffectColor(listView) |
|
|
|
|
|
|
|
setHasOptionsMenu(true) |
|
|
|
if (LocalConfig.isFirstOpenBackup) { |
|
|
|
if (LocalConfig.isFirstOpenBackup) { |
|
|
|
val text = String(requireContext().assets.open("help/webDavHelp.md").readBytes()) |
|
|
|
showHelp() |
|
|
|
TextDialog.show(childFragmentManager, text, TextDialog.MD) |
|
|
|
|
|
|
|
LocalConfig.isFirstOpen = false |
|
|
|
LocalConfig.isFirstOpen = false |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { |
|
|
|
|
|
|
|
super.onCreateOptionsMenu(menu, inflater) |
|
|
|
|
|
|
|
inflater.inflate(R.menu.backup_restore, menu) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onOptionsItemSelected(item: MenuItem): Boolean { |
|
|
|
|
|
|
|
when (item.itemId) { |
|
|
|
|
|
|
|
R.id.menu_help -> showHelp() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return super.onOptionsItemSelected(item) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun showHelp() { |
|
|
|
|
|
|
|
val text = String(requireContext().assets.open("help/webDavHelp.md").readBytes()) |
|
|
|
|
|
|
|
TextDialog.show(childFragmentManager, text, TextDialog.MD) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onDestroy() { |
|
|
|
override fun onDestroy() { |
|
|
|
super.onDestroy() |
|
|
|
super.onDestroy() |
|
|
|
preferenceManager.sharedPreferences.unregisterOnSharedPreferenceChangeListener(this) |
|
|
|
preferenceManager.sharedPreferences.unregisterOnSharedPreferenceChangeListener(this) |
|
|
|