From 5e211707312de953cf46c19bf4ed29bfd5c67d99 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 5 Dec 2017 23:38:08 +0100 Subject: [PATCH] rename the Long formatting extension function --- build.gradle | 2 +- .../com/simplemobiletools/commons/dialogs/PropertiesDialog.kt | 4 ++-- .../kotlin/com/simplemobiletools/commons/extensions/Long.kt | 2 +- .../kotlin/com/simplemobiletools/commons/extensions/String.kt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 6689999cc..dd33d3a50 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 - propVersionName = '3.1.3' + propVersionName = '3.1.4' kotlin_version = '1.2.0' support_libs = '27.0.2' } diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/PropertiesDialog.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/PropertiesDialog.kt index c929ebfb2..20009c6e6 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/PropertiesDialog.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/PropertiesDialog.kt @@ -63,7 +63,7 @@ class PropertiesDialog() { if (cursor.moveToFirst()) { val dateModified = cursor.getIntValue(MediaStore.Images.Media.DATE_MODIFIED) activity.runOnUiThread { - view.findViewById(R.id.properties_last_modified).property_value.text = (dateModified * 1000L).formatLastModified() + view.findViewById(R.id.properties_last_modified).property_value.text = (dateModified * 1000L).formatDate() } } } @@ -90,7 +90,7 @@ class PropertiesDialog() { } if (file.isDirectory) { - addProperty(R.string.last_modified, file.lastModified().formatLastModified()) + addProperty(R.string.last_modified, file.lastModified().formatDate()) } else { addProperty(R.string.last_modified, "...", R.id.properties_last_modified) addExifProperties(path) diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Long.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Long.kt index d79db9a51..993ad70e1 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Long.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Long.kt @@ -13,7 +13,7 @@ fun Long.formatSize(): String { return "${DecimalFormat("#,##0.#").format(this / Math.pow(1024.0, digitGroups.toDouble()))} ${units[digitGroups]}" } -fun Long.formatLastModified(): String { +fun Long.formatDate(): String { val cal = Calendar.getInstance(Locale.ENGLISH) cal.timeInMillis = this return DateFormat.format("dd.MM.yyyy kk:mm", cal).toString() diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/String.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/String.kt index 16a03e60e..fe50b6f4d 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/String.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/String.kt @@ -85,7 +85,7 @@ fun String.getExifDateTaken(exif: ExifInterface): String { if (it?.isNotEmpty() == true) { try { val simpleDateFormat = SimpleDateFormat("yyyy:MM:dd kk:mm:ss", Locale.ENGLISH) - return simpleDateFormat.parse(it).time.formatLastModified().trim() + return simpleDateFormat.parse(it).time.formatDate().trim() } catch (ignored: Exception) { } }