From be47f13d75e4e5bae8dc4c260272dff002b35e80 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Mon, 4 Nov 2019 12:08:13 +0530 Subject: Add UI indicator for folders Signed-off-by: Harsh Shandilya --- .../main/java/com/zeapo/pwdstore/ui/adapters/EntryRecyclerAdapter.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/src/main/java') 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 9bcb96e4..211394fb 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 @@ -10,11 +10,9 @@ import android.view.ViewGroup import androidx.appcompat.widget.AppCompatImageView import androidx.appcompat.widget.AppCompatTextView import androidx.recyclerview.widget.RecyclerView - import com.zeapo.pwdstore.R import com.zeapo.pwdstore.utils.PasswordItem import com.zeapo.pwdstore.widget.MultiselectableLinearLayout - import java.util.ArrayList import java.util.TreeSet @@ -82,11 +80,13 @@ abstract class EntryRecyclerAdapter internal constructor(val values: ArrayList

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/src/main/java') 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

+ + Date: Mon, 4 Nov 2019 23:16:25 +0530 Subject: Remove useless parent layout Signed-off-by: Harsh Shandilya --- .../pwdstore/ui/adapters/EntryRecyclerAdapter.kt | 4 +- .../widget/MultiselectableConstraintLayout.kt | 41 +++++++ .../pwdstore/widget/MultiselectableLinearLayout.kt | 49 --------- app/src/main/res/layout/password_row_layout.xml | 120 ++++++++++----------- 4 files changed, 100 insertions(+), 114 deletions(-) create mode 100644 app/src/main/java/com/zeapo/pwdstore/widget/MultiselectableConstraintLayout.kt delete mode 100644 app/src/main/java/com/zeapo/pwdstore/widget/MultiselectableLinearLayout.kt (limited to 'app/src/main/java') 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 ba66ed6f..e8822929 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 @@ -12,7 +12,7 @@ import androidx.appcompat.widget.AppCompatTextView import androidx.recyclerview.widget.RecyclerView import com.zeapo.pwdstore.R import com.zeapo.pwdstore.utils.PasswordItem -import com.zeapo.pwdstore.widget.MultiselectableLinearLayout +import com.zeapo.pwdstore.widget.MultiselectableConstraintLayout import java.io.File import java.util.ArrayList import java.util.TreeSet @@ -103,7 +103,7 @@ abstract class EntryRecyclerAdapter internal constructor(val values: ArrayList

- + android:background="@drawable/password_row_background" + android:paddingTop="12dp" + android:paddingBottom="12dp"> - - - + - - - + - + - + - + - \ No newline at end of file + -- cgit v1.2.3 From 0d5672dd116b1d5c8c6b60944e682d21644cbeff Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Tue, 5 Nov 2019 02:20:34 +0530 Subject: Switch up folder icon Signed-off-by: Harsh Shandilya --- .../com/zeapo/pwdstore/ui/adapters/EntryRecyclerAdapter.kt | 2 +- app/src/main/res/drawable/ic_folder_tinted_24dp.xml | 10 ---------- app/src/main/res/drawable/ic_multiple_files_tinted_24dp.xml | 10 ++++++++++ app/src/main/res/layout/password_row_layout.xml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) delete mode 100644 app/src/main/res/drawable/ic_folder_tinted_24dp.xml create mode 100644 app/src/main/res/drawable/ic_multiple_files_tinted_24dp.xml (limited to 'app/src/main/java') 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 e8822929..176f4a82 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 @@ -80,7 +80,7 @@ abstract class EntryRecyclerAdapter internal constructor(val values: ArrayList

File(current, name).isFile } ?: emptyArray()).size if (childCount > 0) { diff --git a/app/src/main/res/drawable/ic_folder_tinted_24dp.xml b/app/src/main/res/drawable/ic_folder_tinted_24dp.xml deleted file mode 100644 index 51380a42..00000000 --- a/app/src/main/res/drawable/ic_folder_tinted_24dp.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_multiple_files_tinted_24dp.xml b/app/src/main/res/drawable/ic_multiple_files_tinted_24dp.xml new file mode 100644 index 00000000..b8c2edab --- /dev/null +++ b/app/src/main/res/drawable/ic_multiple_files_tinted_24dp.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/layout/password_row_layout.xml b/app/src/main/res/layout/password_row_layout.xml index c48349fe..bf7763ae 100644 --- a/app/src/main/res/layout/password_row_layout.xml +++ b/app/src/main/res/layout/password_row_layout.xml @@ -18,7 +18,7 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - tools:src="@drawable/ic_folder_tinted_24dp" /> + tools:src="@drawable/ic_multiple_files_tinted_24dp" />