fix: default should show ext

This commit is contained in:
Kagura 2024-10-17 21:33:27 +08:00
parent 23b7b6c6eb
commit 2e3a85ff38
4 changed files with 14 additions and 12 deletions

View file

@ -31,10 +31,10 @@ class DocumentAdapter(context: Context, list: ArrayList<DocumentModel>) :
) )
val model = getItem(position) ?: throw RuntimeException() val model = getItem(position) ?: throw RuntimeException()
val card = listView.findViewById<TextView>(R.id.iconButton) val card = listView.findViewById<TextView>(R.id.iconButton)
card.text = if (hideExtension == false) { card.text = if (hideExtension == true) {
model.name
} else {
model.nameWithoutExt model.nameWithoutExt
} else {
model.name
} }
return listView return listView
} }

View file

@ -39,10 +39,11 @@ class ImageAdapter(context: Context, list: ArrayList<ImageModel>) :
) )
val model = getItem(position) ?: throw RuntimeException() val model = getItem(position) ?: throw RuntimeException()
listView.findViewById<ImageView>(R.id.pictureCardImage).setImageBitmap(model.thumbnail) listView.findViewById<ImageView>(R.id.pictureCardImage).setImageBitmap(model.thumbnail)
listView.findViewById<TextView>(R.id.pictureCardText).text = if (hideExtension == false) { val card = listView.findViewById<TextView>(R.id.pictureCardText)
model.name card.text = if (hideExtension == true) {
} else {
model.nameWithoutExt model.nameWithoutExt
} else {
model.name
} }
listView.setLayoutParams(LayoutParams(GridView.AUTO_FIT, 530)) listView.setLayoutParams(LayoutParams(GridView.AUTO_FIT, 530))

View file

@ -31,10 +31,10 @@ class MusicAdapter(context: Context, list: ArrayList<MusicModel>) :
) )
val model = getItem(position) ?: throw RuntimeException() val model = getItem(position) ?: throw RuntimeException()
val card = listView.findViewById<TextView>(R.id.iconButton) val card = listView.findViewById<TextView>(R.id.iconButton)
card.text = if (hideExtension == false) { card.text = if (hideExtension == true) {
model.name
} else {
model.nameWithoutExt model.nameWithoutExt
} else {
model.name
} }
return listView return listView
} }

View file

@ -42,10 +42,11 @@ class VideoAdapter(context: Context, list: ArrayList<VideoModel>) :
) )
val model = getItem(position) ?: throw RuntimeException() val model = getItem(position) ?: throw RuntimeException()
listView.findViewById<ImageView>(R.id.pictureCardImage).setImageBitmap(model.thumbnail) listView.findViewById<ImageView>(R.id.pictureCardImage).setImageBitmap(model.thumbnail)
listView.findViewById<TextView>(R.id.pictureCardText).text = if (hideExtension == false) { val card = listView.findViewById<TextView>(R.id.pictureCardText)
model.name card.text = if (hideExtension == true) {
} else {
model.nameWithoutExt model.nameWithoutExt
} else {
model.name
} }
listView.setLayoutParams(LayoutParams(GridView.AUTO_FIT, 530)) listView.setLayoutParams(LayoutParams(GridView.AUTO_FIT, 530))