Fix: Set childCount correctly on recycled rows (#675)
The childCount is not set explicitly for empty directories, which means that the childCount of the entry from which the current row was recycled is preserved. This results in empty directories being shown with seemingly random child counts. The fix is to always set text and visibility for the childCount view. Co-authored-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
parent
0153d3215e
commit
791868f3d6
1 changed files with 2 additions and 4 deletions
|
@ -99,10 +99,8 @@ abstract class EntryRecyclerAdapter internal constructor(val values: ArrayList<P
|
||||||
!(!showHidden && (pathname.isDirectory && pathname.isHidden))
|
!(!showHidden && (pathname.isDirectory && pathname.isHidden))
|
||||||
} ?: emptyArray<File>()
|
} ?: emptyArray<File>()
|
||||||
val childCount = children.size
|
val childCount = children.size
|
||||||
if (childCount > 0) {
|
holder.childCount.visibility = if (childCount > 0) View.VISIBLE else View.GONE
|
||||||
holder.childCount.visibility = View.VISIBLE
|
|
||||||
holder.childCount.text = "$childCount"
|
holder.childCount.text = "$childCount"
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
holder.typeImage.setImageResource(R.drawable.ic_action_secure_24dp)
|
holder.typeImage.setImageResource(R.drawable.ic_action_secure_24dp)
|
||||||
val parentPath = pass.fullPathToParent.replace("(^/)|(/$)".toRegex(), "")
|
val parentPath = pass.fullPathToParent.replace("(^/)|(/$)".toRegex(), "")
|
||||||
|
|
Loading…
Reference in a new issue