diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefs.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefs.kt
index 74abd439f8..842421b324 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefs.kt
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefs.kt
@@ -167,7 +167,7 @@ class ImportExportPrefs @Inject constructor(
if (!prefsEncryptionIsDisabled() && !assureMasterPasswordSet(activity, R.string.nav_export)) return
TwoMessagesAlertDialog.showAlert(activity, resourceHelper.gs(R.string.nav_export),
- resourceHelper.gs(R.string.export_to) + " " + fileToExport + " ?",
+ resourceHelper.gs(R.string.export_to) + " " + fileToExport.name + " ?",
resourceHelper.gs(R.string.password_preferences_encrypt_prompt), {
askForMasterPassIfNeeded(activity, R.string.preferences_export_canceled, then)
}, null, R.drawable.ic_header_export)
@@ -177,9 +177,8 @@ class ImportExportPrefs @Inject constructor(
if (fileToImport.handler == PrefsFormatsHandler.ENCRYPTED) {
if (!assureMasterPasswordSet(activity, R.string.nav_import)) return
-
TwoMessagesAlertDialog.showAlert(activity, resourceHelper.gs(R.string.nav_import),
- resourceHelper.gs(R.string.import_from) + " " + fileToImport.file + " ?",
+ resourceHelper.gs(R.string.import_from) + " " + fileToImport.name + " ?",
resourceHelper.gs(R.string.password_preferences_decrypt_prompt), {
askForMasterPass(activity, R.string.preferences_import_canceled, then)
}, null, R.drawable.ic_header_import)
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt
index 52910dfff1..d7e0d25115 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt
@@ -34,6 +34,7 @@ enum class PrefsImportDir {
@Parcelize
data class PrefsFile(
+ val name: String,
val file: File,
val baseDir: File,
val dirKind: PrefsImportDir,
@@ -96,7 +97,7 @@ class PrefFileListProvider @Inject constructor(
val detectedOld = !detectedNew && classicPrefsFormat.isPreferencesFile(it, contents)
if (detectedNew || detectedOld) {
val formatHandler = if (detectedNew) PrefsFormatsHandler.ENCRYPTED else PrefsFormatsHandler.CLASSIC
- prefFiles.add(PrefsFile(it, path, PrefsImportDir.ROOT_DIR, formatHandler, metadataFor(loadMetadata, formatHandler, contents)))
+ prefFiles.add(PrefsFile(it.name , it, path, PrefsImportDir.ROOT_DIR, formatHandler, metadataFor(loadMetadata, formatHandler, contents)))
}
}
@@ -104,7 +105,7 @@ class PrefFileListProvider @Inject constructor(
aapsPath.walk().filter { it.isFile && it.name.endsWith(".json") }.forEach {
val contents = storage.getFileContents(it)
if (encryptedPrefsFormat.isPreferencesFile(it, contents)) {
- prefFiles.add(PrefsFile(it, aapsPath, PrefsImportDir.AAPS_DIR, PrefsFormatsHandler.ENCRYPTED, metadataFor(loadMetadata, PrefsFormatsHandler.ENCRYPTED, contents)))
+ prefFiles.add(PrefsFile(it.name, it, aapsPath, PrefsImportDir.AAPS_DIR, PrefsFormatsHandler.ENCRYPTED, metadataFor(loadMetadata, PrefsFormatsHandler.ENCRYPTED, contents)))
}
}
diff --git a/app/src/main/res/layout/dialog_alert_import_summary.xml b/app/src/main/res/layout/dialog_alert_import_summary.xml
index fb6e5a0708..7871d47f59 100644
--- a/app/src/main/res/layout/dialog_alert_import_summary.xml
+++ b/app/src/main/res/layout/dialog_alert_import_summary.xml
@@ -1,30 +1,45 @@
-
+ xmlns:app="http://schemas.android.com/apk/res-auto">
-
+
-
+
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/dialog_alert_two_messages.xml b/app/src/main/res/layout/dialog_alert_two_messages.xml
index e155b6f215..0a8f2232db 100644
--- a/app/src/main/res/layout/dialog_alert_two_messages.xml
+++ b/app/src/main/res/layout/dialog_alert_two_messages.xml
@@ -3,7 +3,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
- android:padding="20dp">
+ android:padding="10dp">
(R.id.alertdialog_title) as TextView).text = title
(titleLayout.findViewById(R.id.alertdialog_icon) as ImageView).setImageResource(iconResource)
+ titleLayout.findViewById(R.id.alertdialog_title).setSelected(true)
return titleLayout
}
diff --git a/core/src/main/res/layout/dialog_alert_custom.xml b/core/src/main/res/layout/dialog_alert_custom.xml
index 312be67ac7..4eb4cd6eb1 100644
--- a/core/src/main/res/layout/dialog_alert_custom.xml
+++ b/core/src/main/res/layout/dialog_alert_custom.xml
@@ -32,6 +32,12 @@
android:layout_marginEnd="50dp"
android:layout_toEndOf="@id/alertdialog_icon"
android:textAlignment="center"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:marqueeRepeatLimit="marquee_forever"
+ android:scrollHorizontally="true"
+ android:focusable="true"
+ android:focusableInTouchMode="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="?dialogTitleColor" />