fix: do not hide extension if is hidden file

This commit is contained in:
Kagura 2024-10-11 21:14:25 +08:00
parent be15a90b82
commit 56216de51b
3 changed files with 11 additions and 11 deletions

View file

@ -93,7 +93,7 @@ class FileColumn(val context: Context) {
isOkay = false isOkay = false
fileList.clear() fileList.clear()
val wfList = cwd.listFiles()?.map { WrappedFile(it) } val wfList = cwd.listFiles()?.map { WrappedFile(it) }
if (wfList!=null) { if (wfList != null) {
if (sortByTime) { if (sortByTime) {
fileList.addAll(wfList.sortedBy { it.lastModifiedTime }) fileList.addAll(wfList.sortedBy { it.lastModifiedTime })
} else { } else {
@ -170,7 +170,6 @@ class FileColumn(val context: Context) {
) )
} }
} }
if (!isOkay) { if (!isOkay) {
Column( Column(
@ -529,9 +528,10 @@ class FileColumn(val context: Context) {
.fillMaxWidth(0.8f) .fillMaxWidth(0.8f)
) { ) {
Text( Text(
text = forceName ?: if (settingStorage.get(settingStorage.showExtension) == false || file.type == Type.DIRECTORY){ text = forceName
?: if (settingStorage.get(settingStorage.showExtension) == false && !file.name.startsWith('.')) {
file.nameWithoutExt file.nameWithoutExt
}else{ } else {
file.name file.name
}, },
fontSize = 24.sp, fontSize = 24.sp,
@ -539,9 +539,9 @@ class FileColumn(val context: Context) {
overflow = TextOverflow.Ellipsis overflow = TextOverflow.Ellipsis
) )
Text( Text(
text = forceParent ?: if (file.type == Type.FILE){ text = forceParent ?: if (file.type == Type.FILE) {
"${file.getModifiedTimeString(context)} ${file.getSizeString()}" "${file.getModifiedTimeString(context)} ${file.getSizeString()}"
}else{ } else {
file.getModifiedTimeString(context) file.getModifiedTimeString(context)
}, },
fontSize = 15.sp, fontSize = 15.sp,

View file

@ -14,7 +14,7 @@ class DocumentLister : Lister {
val regex = "\\.((xls|doc|ppt)(x|)|txt|htm(l|)|pdf)".toRegex() val regex = "\\.((xls|doc|ppt)(x|)|txt|htm(l|)|pdf)".toRegex()
} }
val documentList = mutableListOf<String>() private val documentList = mutableListOf<String>()
fun initialize(onFinished: (() -> Unit)? = null) { fun initialize(onFinished: (() -> Unit)? = null) {
documentList.clear() documentList.clear()

View file

@ -14,7 +14,7 @@ class VideoLister : Lister {
val regex = "\\.(mp4|avi|video|webm)$".toRegex() val regex = "\\.(mp4|avi|video|webm)$".toRegex()
} }
val videoList = mutableListOf<String>() private val videoList = mutableListOf<String>()
fun initialize(onFinished: (() -> Unit)? = null) { fun initialize(onFinished: (() -> Unit)? = null) {
videoList.clear() videoList.clear()