UI changes: changed "randomise entry order" to "shuffle order" to clear ambiguity; added buttons for import and export of entries (function to be implemented)

This commit is contained in:
denizk0461
2023-11-08 09:46:47 +01:00
parent 62bbba447f
commit c9698e5f93
4 changed files with 67 additions and 3 deletions
@@ -141,7 +141,7 @@ class QuoteStorage private constructor(context: Context) {
prefs.edit().putBoolean(SettingsPreference.NEEDS_MIGRATION.key, false).apply() prefs.edit().putBoolean(SettingsPreference.NEEDS_MIGRATION.key, false).apply()
} }
fun exportEntriesAsJson(): String = Gson().toJson(dao.getAllEntriesSync().map { e -> e.text }) fun exportEntriesAsJson(): String = ""//Gson().toJson(dao.getAllEntriesSync().map { e -> e.text })
fun importEntriesFromJson(json: String) { fun importEntriesFromJson(json: String) {
// TODO // TODO
@@ -779,6 +779,62 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp" /> android:layout_marginHorizontal="16dp" />
<!-- Import -->
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/button_import"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/selectable_item_background"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/mono_semibold_italic"
android:text="@string/settings_import_title"
android:textSize="16sp" />
<TextView
android:id="@+id/import_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/settings_import_subtitle"
android:textSize="16sp" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- Export -->
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/button_export"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/selectable_item_background"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/mono_semibold_italic"
android:text="@string/settings_export_title"
android:textSize="16sp" />
<TextView
android:id="@+id/export_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/settings_export_subtitle"
android:textSize="16sp" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- Licences --> <!-- Licences -->
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/button_licences" android:id="@+id/button_licences"
+4
View File
@@ -63,6 +63,10 @@
<string name="settings_misc_header">Sonstiges</string> <string name="settings_misc_header">Sonstiges</string>
<string name="settings_import_title">Einträge von Datei importieren</string>
<string name="settings_import_subtitle">Öffnet den Dateiexplorer</string>
<string name="settings_export_title">Einträge als Datei exportieren</string>
<string name="settings_export_subtitle">Export wird als JSON-Datei abgespeichert</string>
<string name="settings_licences_title">Siehe Lizenzen</string> <string name="settings_licences_title">Siehe Lizenzen</string>
<string name="settings_licences_subtitle">Ressourcen, die diese App möglich gemacht haben</string> <string name="settings_licences_subtitle">Ressourcen, die diese App möglich gemacht haben</string>
<string name="sheet_licences_header">Lizenzen</string> <string name="sheet_licences_header">Lizenzen</string>
+6 -2
View File
@@ -9,7 +9,7 @@
<string name="thickness">thickness</string> <string name="thickness">thickness</string>
<string name="intensity">intensity</string> <string name="intensity">intensity</string>
<string name="invert">Invert colours</string> <string name="invert">Invert colours</string>
<string name="random">Randomise order</string> <string name="random">Shuffle</string>
<string name="contrast">Increase the contrast</string> <string name="contrast">Increase the contrast</string>
<string name="info_add_text">add some text!</string> <string name="info_add_text">add some text!</string>
<string name="snack_backup_download">Restoring your data…</string> <string name="snack_backup_download">Restoring your data…</string>
@@ -54,7 +54,7 @@
<string name="settings_highlight_transparency_header">Opacity</string> <string name="settings_highlight_transparency_header">Opacity</string>
<string name="settings_widget_header">Widget</string> <string name="settings_widget_header">Widget</string>
<string name="settings_widget_order_title">Randomise entry order</string> <string name="settings_widget_order_title">Shuffle entries</string>
<string name="settings_widget_order_subtitle">Order from the list is preserved otherwise; change by drag-and-drop</string> <string name="settings_widget_order_subtitle">Order from the list is preserved otherwise; change by drag-and-drop</string>
<string name="settings_widget_order_default">Default</string> <string name="settings_widget_order_default">Default</string>
<string name="settings_widget_order_random">Random</string> <string name="settings_widget_order_random">Random</string>
@@ -62,6 +62,10 @@
<string name="settings_misc_header">Miscellaneous</string> <string name="settings_misc_header">Miscellaneous</string>
<string name="settings_import_title">Import entries from file</string>
<string name="settings_import_subtitle">Opens your file explorer</string>
<string name="settings_export_title">Export entries to file</string>
<string name="settings_export_subtitle">Export will be saved to a JSON file</string>
<string name="settings_licences_title">View licences</string> <string name="settings_licences_title">View licences</string>
<string name="settings_licences_subtitle">Resources that made this app possible</string> <string name="settings_licences_subtitle">Resources that made this app possible</string>
<string name="sheet_licences_header">Licences</string> <string name="sheet_licences_header">Licences</string>