From 791868f3d6a871379b766e44fb41755d794eb36e Mon Sep 17 00:00:00 2001 From: Fabian Henneke Date: Fri, 27 Mar 2020 09:58:41 +0100 Subject: 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 --- .../java/com/zeapo/pwdstore/ui/adapters/EntryRecyclerAdapter.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'app/src') diff --git a/app/src/main/java/com/zeapo/pwdstore/ui/adapters/EntryRecyclerAdapter.kt b/app/src/main/java/com/zeapo/pwdstore/ui/adapters/EntryRecyclerAdapter.kt index fc9c84bc..9cf477e2 100644 --- a/app/src/main/java/com/zeapo/pwdstore/ui/adapters/EntryRecyclerAdapter.kt +++ b/app/src/main/java/com/zeapo/pwdstore/ui/adapters/EntryRecyclerAdapter.kt @@ -99,10 +99,8 @@ abstract class EntryRecyclerAdapter internal constructor(val values: ArrayList

() val childCount = children.size - if (childCount > 0) { - holder.childCount.visibility = View.VISIBLE - holder.childCount.text = "$childCount" - } + holder.childCount.visibility = if (childCount > 0) View.VISIBLE else View.GONE + holder.childCount.text = "$childCount" } else { holder.typeImage.setImageResource(R.drawable.ic_action_secure_24dp) val parentPath = pass.fullPathToParent.replace("(^/)|(/$)".toRegex(), "") -- cgit v1.2.3