Skip to content

Commit

Permalink
move export and import settings under separate dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Razeeman committed Aug 20, 2023
1 parent 92951dc commit 7c1732c
Show file tree
Hide file tree
Showing 26 changed files with 298 additions and 194 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,7 @@ class SettingsTest : BaseUiTest() {
@Test
fun csvExportSettings() {
NavUtils.openSettingsScreen()
NavUtils.openSettingsBackup()
NavUtils.openSettingsExportImport()
onView(withId(settingsR.id.layoutSettingsExportCsv)).perform(nestedScrollTo(), click())

// View is set up
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ object NavUtils {
onView(withText(coreR.string.settings_backup_title)).perform(nestedScrollTo(), click())
}

fun openSettingsExportImport() {
onView(withText(coreR.string.settings_export_title)).perform(nestedScrollTo(), click())
}

fun openCategoriesScreen() {
onView(withText(coreR.string.settings_edit_categories)).perform(nestedScrollTo(), click())
}
Expand Down
1 change: 1 addition & 0 deletions core/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<string name="settings_additional_title">إعدادات إضافية</string>
<string name="settings_notification_title">إعدادات الإشعار</string>
<string name="settings_backup_title">إعدادات النسخ الاحتياطي</string>
<string name="settings_export_title">التصدير والاستيراد</string>
<string name="settings_sort_order">فرز الأنشطة</string>
<string name="settings_sort_by_name">الاسم</string>
<string name="settings_sort_by_color">اللون</string>
Expand Down
1 change: 1 addition & 0 deletions core/src/main/res/values-ca/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<string name="settings_additional_title">Configuració addicional</string>
<string name="settings_notification_title">Configuració de notificacions</string>
<string name="settings_backup_title">Configuració de còpia de seguretat</string>
<string name="settings_export_title">Exportació i importació</string>
<string name="settings_sort_order">Endreçar activitats</string>
<string name="settings_sort_by_name">Nom</string>
<string name="settings_sort_by_color">Color</string>
Expand Down
1 change: 1 addition & 0 deletions core/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<string name="settings_additional_title">Zusätzliche Einstellungen</string>
<string name="settings_notification_title">Benachrichtigungseinstellungen</string>
<string name="settings_backup_title">Backup-Einstellungen</string>
<string name="settings_export_title">Export und Import</string>
<string name="settings_sort_order">Aktivitäten sortieren</string>
<string name="settings_sort_by_name">Name</string>
<string name="settings_sort_by_color">Farbe</string>
Expand Down
1 change: 1 addition & 0 deletions core/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<string name="settings_additional_title">Ajustes adicionales</string>
<string name="settings_notification_title">Configuración de las notificaciones</string>
<string name="settings_backup_title">Configuración de copia de seguridad</string>
<string name="settings_export_title">Exportar e importar</string>
<string name="settings_sort_order">Ordenar actividades</string>
<string name="settings_sort_by_name">Nombre</string>
<string name="settings_sort_by_color">Color</string>
Expand Down
1 change: 1 addition & 0 deletions core/src/main/res/values-fa/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<string name="settings_additional_title">تنظیمت اضافه</string>
<string name="settings_notification_title">تنظیمات اعلان</string>
<string name="settings_backup_title">تنظیمات پشتیبان گیری</string>
<string name="settings_export_title">صادرات و واردات</string>
<string name="settings_sort_order">مرتب سازی فعالیت ها</string>
<string name="settings_sort_by_name">نام</string>
<string name="settings_sort_by_color">رنگ</string>
Expand Down
1 change: 1 addition & 0 deletions core/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<string name="settings_additional_title">Paramètres additionnels</string>
<string name="settings_notification_title">Paramètres de notification</string>
<string name="settings_backup_title">Paramètres de sauvegarde</string>
<string name="settings_export_title">Exporter et importer</string>
<string name="settings_sort_order">Trier les activités</string>
<string name="settings_sort_by_name">Par nom</string>
<string name="settings_sort_by_color">Par couleur</string>
Expand Down
1 change: 1 addition & 0 deletions core/src/main/res/values-hi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<string name="settings_additional_title">अतिरिक्त सेटिंग्स</string>
<string name="settings_notification_title">अधिसूचना सेटिंग्स</string>
<string name="settings_backup_title">बैकअप सेटिंग्स</string>
<string name="settings_export_title">निर्यात और आयात</string>
<string name="settings_sort_order">क्रमबद्ध गतिविधियाँ</string>
<string name="settings_sort_by_name">नाम</string>
<string name="settings_sort_by_color">रंग</string>
Expand Down
1 change: 1 addition & 0 deletions core/src/main/res/values-in/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<string name="settings_additional_title">Pengaturan tambahan</string>
<string name="settings_notification_title">Pengaturan pemberitahuan</string>
<string name="settings_backup_title">Pengaturan cadangan</string>
<string name="settings_export_title">Ekspor dan impor</string>
<string name="settings_sort_order">Urutkan kegiatan</string>
<string name="settings_sort_by_name">Nama</string>
<string name="settings_sort_by_color">Warna</string>
Expand Down
1 change: 1 addition & 0 deletions core/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<string name="settings_additional_title">Altre impostazioni</string>
<string name="settings_notification_title">Impostazioni di notifica</string>
<string name="settings_backup_title">Impostazioni di backup</string>
<string name="settings_export_title">Esportare e importare</string>
<string name="settings_sort_order">Ordina attività</string>
<string name="settings_sort_by_name">Nome</string>
<string name="settings_sort_by_color">Colore</string>
Expand Down
1 change: 1 addition & 0 deletions core/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<string name="settings_additional_title">追加設定</string>
<string name="settings_notification_title">通知設定</string>
<string name="settings_backup_title">バックアップ設定</string>
<string name="settings_export_title">エクスポートとインポート</string>
<string name="settings_sort_order">アクティビティをソート</string>
<string name="settings_sort_by_name">名前</string>
<string name="settings_sort_by_color">色</string>
Expand Down
1 change: 1 addition & 0 deletions core/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<string name="settings_additional_title">Extra instellingen</string>
<string name="settings_notification_title">Notificatie instellingen</string>
<string name="settings_backup_title">Back-up instellingen</string>
<string name="settings_export_title">Export en import</string>
<string name="settings_sort_order">Activiteiten sorteren</string>
<string name="settings_sort_by_name">Naam</string>
<string name="settings_sort_by_color">Kleur</string>
Expand Down
1 change: 1 addition & 0 deletions core/src/main/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<string name="settings_additional_title">Configurações adicionais</string>
<string name="settings_notification_title">Configurações de notificação</string>
<string name="settings_backup_title">Configurações de backup</string>
<string name="settings_export_title">Exportar e importar</string>
<string name="settings_sort_order">Ordenar atividades</string>
<string name="settings_sort_by_name">Nome</string>
<string name="settings_sort_by_color">Cor</string>
Expand Down
1 change: 1 addition & 0 deletions core/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<string name="settings_additional_title">Дополнительные настройки</string>
<string name="settings_notification_title">Настройки уведомлений</string>
<string name="settings_backup_title">Настройки резервного копирования</string>
<string name="settings_export_title">Экспорт и импорт</string>
<string name="settings_sort_order">Сортировать активности</string>
<string name="settings_sort_by_name">Имя</string>
<string name="settings_sort_by_color">Цвет</string>
Expand Down
1 change: 1 addition & 0 deletions core/src/main/res/values-sv/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<string name="settings_additional_title">Ytterligare inställningar</string>
<string name="settings_notification_title">Aviseringsinställningar</string>
<string name="settings_backup_title">Säkerhetskopieringsinställningar</string>
<string name="settings_export_title">Exportera och importera</string>
<string name="settings_sort_order">Sortera aktiviteter efter</string>
<string name="settings_sort_by_name">Namn</string>
<string name="settings_sort_by_color">Färg</string>
Expand Down
1 change: 1 addition & 0 deletions core/src/main/res/values-tr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<string name="settings_additional_title">Ek ayarlar</string>
<string name="settings_notification_title">Bildirim ayarları</string>
<string name="settings_backup_title">Yedekleme ayarları</string>
<string name="settings_export_title">Ihracat ve ithalat</string>
<string name="settings_sort_order">Aktiviteleri sırala</string>
<string name="settings_sort_by_name">İsim</string>
<string name="settings_sort_by_color">Renk</string>
Expand Down
1 change: 1 addition & 0 deletions core/src/main/res/values-uk/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<string name="settings_additional_title">Додаткові налаштування</string>
<string name="settings_notification_title">Налаштування сповіщень</string>
<string name="settings_backup_title">Налаштування резервного копіювання</string>
<string name="settings_export_title">Експорт та імпорт</string>
<string name="settings_sort_order">Сортувати активності</string>
<string name="settings_sort_by_name">Ім\'я</string>
<string name="settings_sort_by_color">Колір</string>
Expand Down
1 change: 1 addition & 0 deletions core/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<string name="settings_additional_title">附加設定</string>
<string name="settings_notification_title">通知設置</string>
<string name="settings_backup_title">備份設置</string>
<string name="settings_export_title">導出和導入</string>
<string name="settings_sort_order">排序活動</string>
<string name="settings_sort_by_name">名稱</string>
<string name="settings_sort_by_color">顏色</string>
Expand Down
1 change: 1 addition & 0 deletions core/src/main/res/values-zh/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<string name="settings_additional_title">其他设置</string>
<string name="settings_notification_title">通知设置</string>
<string name="settings_backup_title">备份设置</string>
<string name="settings_export_title">导出和导入</string>
<string name="settings_sort_order">活动排序</string>
<string name="settings_sort_by_name">名称</string>
<string name="settings_sort_by_color">颜色</string>
Expand Down
1 change: 1 addition & 0 deletions core/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<string name="settings_additional_title">Additional settings</string>
<string name="settings_notification_title">Notification settings</string>
<string name="settings_backup_title">Backup settings</string>
<string name="settings_export_title">Export and import</string>
<string name="settings_sort_order">Sort activities</string>
<string name="settings_sort_by_name">Name</string>
<string name="settings_sort_by_color">Color</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,15 @@ class SettingsFragment :
layoutSettingsBackupTitle.setOnClick(viewModel::onSettingsBackupClick)
layoutSettingsSaveBackup.setOnClick(backupViewModel::onSaveClick)
layoutSettingsRestoreBackup.setOnClick(backupViewModel::onRestoreClick)
checkboxSettingsAutomaticBackup.setOnClick(backupViewModel::onAutomaticBackupClick)
}

with(layoutSettingsExportImport) {
layoutSettingsExportImportTitle.setOnClick(viewModel::onSettingsExportImportClick)
layoutSettingsExportCsv.setOnClick(backupViewModel::onExportCsvClick)
layoutSettingsImportCsv.setOnClick(backupViewModel::onImportCsvClick)
btnSettingsImportCsvHelp.setOnClick(backupViewModel::onImportCsvHelpClick)
layoutSettingsExportIcs.setOnClick(backupViewModel::onExportIcsClick)
checkboxSettingsAutomaticBackup.setOnClick(backupViewModel::onAutomaticBackupClick)
checkboxSettingsAutomaticExport.setOnClick(backupViewModel::onAutomaticExportClick)
}
}
Expand All @@ -183,6 +187,11 @@ class SettingsFragment :
layoutSettingsBackup.arrowSettingsBackup
.apply { if (opened) rotateDown() else rotateUp() }
}
viewModel.settingsExportImportVisibility.observe { opened ->
layoutSettingsExportImport.layoutSettingsExportImportContent.visible = opened
layoutSettingsExportImport.arrowSettingsExportImport
.apply { if (opened) rotateDown() else rotateUp() }
}
resetScreen.observe {
containerSettings.smoothScrollTo(0, 0)
mainTabsViewModel.onHandled()
Expand Down Expand Up @@ -268,6 +277,8 @@ class SettingsFragment :
tvSettingsAutomaticBackupLastSaveTime.visible = it.isNotEmpty()
tvSettingsAutomaticBackupLastSaveTime.text = it
}
}
with(layoutSettingsExportImport) {
automaticExportCheckbox.observe(checkboxSettingsAutomaticExport::setChecked)
automaticExportLastSaveTime.observe {
tvSettingsAutomaticExportLastSaveTime.visible = it.isNotEmpty()
Expand Down Expand Up @@ -321,6 +332,8 @@ class SettingsFragment :
}
with(layoutSettingsBackup) {
checkboxSettingsAutomaticBackup.jumpDrawablesToCurrentState()
}
with(layoutSettingsExportImport) {
checkboxSettingsAutomaticExport.jumpDrawablesToCurrentState()
}
viewModel.onVisible()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class SettingsViewModel @Inject constructor(
val settingsDisplayVisibility: LiveData<Boolean> = MutableLiveData(false)
val settingsAdditionalVisibility: LiveData<Boolean> = MutableLiveData(false)
val settingsBackupVisibility: LiveData<Boolean> = MutableLiveData(false)
val settingsExportImportVisibility: LiveData<Boolean> = MutableLiveData(false)
val resetScreen: SingleLiveEvent<Unit> = SingleLiveEvent()

init {
Expand Down Expand Up @@ -89,6 +90,11 @@ class SettingsViewModel @Inject constructor(
settingsBackupVisibility.set(newValue)
}

fun onSettingsExportImportClick() {
val newValue = settingsExportImportVisibility.value?.flip().orFalse()
settingsExportImportVisibility.set(newValue)
}

fun onDurationSet(tag: String?, duration: Long) {
when (tag) {
INACTIVITY_DURATION_DIALOG_TAG,
Expand Down
Loading

0 comments on commit 7c1732c

Please sign in to comment.