Loading build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '3.2.1' propVersionName = '3.2.2' kotlin_version = '1.2.0' support_libs = '27.0.2' } Loading commons/src/main/kotlin/com/simplemobiletools/commons/models/FileDirItem.kt +12 −3 Original line number Diff line number Diff line package com.simplemobiletools.commons.models import com.simplemobiletools.commons.extensions.formatDate import com.simplemobiletools.commons.extensions.formatSize import com.simplemobiletools.commons.helpers.SORT_BY_DATE_MODIFIED import com.simplemobiletools.commons.helpers.SORT_BY_NAME import com.simplemobiletools.commons.helpers.SORT_BY_SIZE Loading Loading @@ -36,9 +38,7 @@ data class FileDirItem(val path: String, val name: String, val isDirectory: Bool } } else -> { val extension = if (isDirectory) name else path.substringAfterLast('.', "") val otherExtension = if (other.isDirectory) other.name else other.path.substringAfterLast('.', "") result = extension.toLowerCase().compareTo(otherExtension.toLowerCase()) result = getExtension().toLowerCase().compareTo(other.getExtension().toLowerCase()) } } Loading @@ -48,4 +48,13 @@ data class FileDirItem(val path: String, val name: String, val isDirectory: Bool result } } fun getExtension() = if (isDirectory) name else path.substringAfterLast('.', "") fun getBubbleText() = when { sorting and SORT_BY_NAME != 0 -> name sorting and SORT_BY_SIZE != 0 -> size.formatSize() sorting and SORT_BY_DATE_MODIFIED != 0 -> File(path).lastModified().formatDate() else -> getExtension().toLowerCase() } } Loading
build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '3.2.1' propVersionName = '3.2.2' kotlin_version = '1.2.0' support_libs = '27.0.2' } Loading
commons/src/main/kotlin/com/simplemobiletools/commons/models/FileDirItem.kt +12 −3 Original line number Diff line number Diff line package com.simplemobiletools.commons.models import com.simplemobiletools.commons.extensions.formatDate import com.simplemobiletools.commons.extensions.formatSize import com.simplemobiletools.commons.helpers.SORT_BY_DATE_MODIFIED import com.simplemobiletools.commons.helpers.SORT_BY_NAME import com.simplemobiletools.commons.helpers.SORT_BY_SIZE Loading Loading @@ -36,9 +38,7 @@ data class FileDirItem(val path: String, val name: String, val isDirectory: Bool } } else -> { val extension = if (isDirectory) name else path.substringAfterLast('.', "") val otherExtension = if (other.isDirectory) other.name else other.path.substringAfterLast('.', "") result = extension.toLowerCase().compareTo(otherExtension.toLowerCase()) result = getExtension().toLowerCase().compareTo(other.getExtension().toLowerCase()) } } Loading @@ -48,4 +48,13 @@ data class FileDirItem(val path: String, val name: String, val isDirectory: Bool result } } fun getExtension() = if (isDirectory) name else path.substringAfterLast('.', "") fun getBubbleText() = when { sorting and SORT_BY_NAME != 0 -> name sorting and SORT_BY_SIZE != 0 -> size.formatSize() sorting and SORT_BY_DATE_MODIFIED != 0 -> File(path).lastModified().formatDate() else -> getExtension().toLowerCase() } }