diff --git a/app/src/main/java/com/dazuoye/filemanager/fileSystem/adapters/Document.kt b/app/src/main/java/com/dazuoye/filemanager/fileSystem/adapters/Document.kt index 0929253..6a942db 100644 --- a/app/src/main/java/com/dazuoye/filemanager/fileSystem/adapters/Document.kt +++ b/app/src/main/java/com/dazuoye/filemanager/fileSystem/adapters/Document.kt @@ -31,10 +31,10 @@ class DocumentAdapter(context: Context, list: ArrayList) : ) val model = getItem(position) ?: throw RuntimeException() val card = listView.findViewById(R.id.iconButton) - card.text = if (hideExtension == false) { - model.name - } else { + card.text = if (hideExtension == true) { model.nameWithoutExt + } else { + model.name } return listView } diff --git a/app/src/main/java/com/dazuoye/filemanager/fileSystem/adapters/Image.kt b/app/src/main/java/com/dazuoye/filemanager/fileSystem/adapters/Image.kt index 6fe2392..c24efca 100644 --- a/app/src/main/java/com/dazuoye/filemanager/fileSystem/adapters/Image.kt +++ b/app/src/main/java/com/dazuoye/filemanager/fileSystem/adapters/Image.kt @@ -39,10 +39,11 @@ class ImageAdapter(context: Context, list: ArrayList) : ) val model = getItem(position) ?: throw RuntimeException() listView.findViewById(R.id.pictureCardImage).setImageBitmap(model.thumbnail) - listView.findViewById(R.id.pictureCardText).text = if (hideExtension == false) { - model.name - } else { + val card = listView.findViewById(R.id.pictureCardText) + card.text = if (hideExtension == true) { model.nameWithoutExt + } else { + model.name } listView.setLayoutParams(LayoutParams(GridView.AUTO_FIT, 530)) diff --git a/app/src/main/java/com/dazuoye/filemanager/fileSystem/adapters/Music.kt b/app/src/main/java/com/dazuoye/filemanager/fileSystem/adapters/Music.kt index 984c9c5..ba7eb5d 100644 --- a/app/src/main/java/com/dazuoye/filemanager/fileSystem/adapters/Music.kt +++ b/app/src/main/java/com/dazuoye/filemanager/fileSystem/adapters/Music.kt @@ -31,10 +31,10 @@ class MusicAdapter(context: Context, list: ArrayList) : ) val model = getItem(position) ?: throw RuntimeException() val card = listView.findViewById(R.id.iconButton) - card.text = if (hideExtension == false) { - model.name - } else { + card.text = if (hideExtension == true) { model.nameWithoutExt + } else { + model.name } return listView } diff --git a/app/src/main/java/com/dazuoye/filemanager/fileSystem/adapters/Video.kt b/app/src/main/java/com/dazuoye/filemanager/fileSystem/adapters/Video.kt index bf73d3e..9aa2341 100644 --- a/app/src/main/java/com/dazuoye/filemanager/fileSystem/adapters/Video.kt +++ b/app/src/main/java/com/dazuoye/filemanager/fileSystem/adapters/Video.kt @@ -42,10 +42,11 @@ class VideoAdapter(context: Context, list: ArrayList) : ) val model = getItem(position) ?: throw RuntimeException() listView.findViewById(R.id.pictureCardImage).setImageBitmap(model.thumbnail) - listView.findViewById(R.id.pictureCardText).text = if (hideExtension == false) { - model.name - } else { + val card = listView.findViewById(R.id.pictureCardText) + card.text = if (hideExtension == true) { model.nameWithoutExt + } else { + model.name } listView.setLayoutParams(LayoutParams(GridView.AUTO_FIT, 530))