summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorHarsh Shandilya <msfjarvis@gmail.com>2019-11-16 12:08:31 +0530
committerAditya Wasan <adityawasan55@gmail.com>2019-11-16 12:08:31 +0530
commit1d081b9054d0310e27c830b71506cfe08aad9f9a (patch)
tree163ef0c719bb0b7cf5dd1c17bfc65ebec81c8522 /app/src/main/java
parentde9a201587bfefc9fed8adba3db5a0a2e9557fde (diff)
Tweak password row layout some more (#567)
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/ui/adapters/EntryRecyclerAdapter.kt14
1 files changed, 7 insertions, 7 deletions
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 893ece62..6ddfa777 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
@@ -5,6 +5,8 @@
package com.zeapo.pwdstore.ui.adapters
import android.content.SharedPreferences
+import android.text.SpannableString
+import android.text.style.RelativeSizeSpan
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@@ -84,7 +86,6 @@ abstract class EntryRecyclerAdapter internal constructor(val values: ArrayList<P
val showHidden = settings?.getBoolean("show_hidden_folders", false) ?: false
holder.name.text = pass.toString()
if (pass.type == PasswordItem.TYPE_CATEGORY) {
- holder.type.visibility = View.GONE
holder.typeImage.setImageResource(R.drawable.ic_multiple_files_24dp)
holder.folderIndicator.visibility = View.VISIBLE
val children = pass.file.listFiles { pathname ->
@@ -97,15 +98,15 @@ abstract class EntryRecyclerAdapter internal constructor(val values: ArrayList<P
}
} else {
holder.typeImage.setImageResource(R.drawable.ic_action_secure_24dp)
- holder.name.text = pass.toString()
- holder.type.visibility = View.VISIBLE
- holder.type.text = pass.fullPathToParent.replace("(^/)|(/$)".toRegex(), "")
+ val parentPath = pass.fullPathToParent.replace("(^/)|(/$)".toRegex(), "")
+ val source = "$parentPath\n$pass"
+ val spannable = SpannableString(source)
+ spannable.setSpan(RelativeSizeSpan(0.7f), 0, parentPath.length, 0)
+ holder.name.text = spannable
holder.childCount.visibility = View.GONE
holder.folderIndicator.visibility = View.GONE
}
-
holder.view.setOnClickListener(getOnClickListener(holder, pass))
-
holder.view.setOnLongClickListener(getOnLongClickListener(holder, pass))
// after removal, everything is rebound for some reason; views are shuffled?
@@ -135,7 +136,6 @@ abstract class EntryRecyclerAdapter internal constructor(val values: ArrayList<P
*/
class ViewHolder(val view: View) : RecyclerView.ViewHolder(view) {
val name: AppCompatTextView = view.findViewById(R.id.label)
- val type: AppCompatTextView = view.findViewById(R.id.type)
val typeImage: AppCompatImageView = view.findViewById(R.id.type_image)
val childCount: AppCompatTextView = view.findViewById(R.id.child_count)
val folderIndicator: AppCompatImageView = view.findViewById(R.id.folder_indicator)