From a21353cb063902dff73d5a371f17978f177910f5 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Mon, 4 Nov 2019 18:20:49 +0530 Subject: Add child count to folders Fixes #559 Signed-off-by: Harsh Shandilya --- .../com/zeapo/pwdstore/ui/adapters/EntryRecyclerAdapter.kt | 8 ++++++++ app/src/main/res/layout/password_row_layout.xml | 11 +++++++++++ 2 files changed, 19 insertions(+) (limited to 'app') 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 211394fb..ba66ed6f 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 @@ -13,6 +13,7 @@ import androidx.recyclerview.widget.RecyclerView import com.zeapo.pwdstore.R import com.zeapo.pwdstore.utils.PasswordItem import com.zeapo.pwdstore.widget.MultiselectableLinearLayout +import java.io.File import java.util.ArrayList import java.util.TreeSet @@ -81,11 +82,17 @@ abstract class EntryRecyclerAdapter internal constructor(val values: ArrayList

File(current, name).isFile } ?: emptyArray()).size + if (childCount > 0) { + holder.childCount.visibility = View.VISIBLE + holder.childCount.text = "$childCount" + } } else { holder.typeImage.setImageResource(R.drawable.ic_action_secure) holder.name.text = pass.toString() holder.type.visibility = View.VISIBLE holder.type.text = pass.fullPathToParent.replace("(^/)|(/$)".toRegex(), "") + holder.childCount.visibility = View.GONE holder.folderIndicator.visibility = View.GONE } @@ -122,6 +129,7 @@ abstract class EntryRecyclerAdapter internal constructor(val values: ArrayList

+ +