summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/ui/adapters/EntryRecyclerAdapter.kt4
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/widget/MultiselectableConstraintLayout.kt (renamed from app/src/main/java/com/zeapo/pwdstore/widget/MultiselectableLinearLayout.kt)14
2 files changed, 5 insertions, 13 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 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<P
// after removal, everything is rebound for some reason; views are shuffled?
val selected = selectedItems.contains(position)
holder.view.isSelected = selected
- (holder.itemView as MultiselectableLinearLayout).setMultiSelected(selected)
+ (holder.itemView as MultiselectableConstraintLayout).setMultiSelected(selected)
}
protected abstract fun getOnClickListener(holder: ViewHolder, pass: PasswordItem): View.OnClickListener
diff --git a/app/src/main/java/com/zeapo/pwdstore/widget/MultiselectableLinearLayout.kt b/app/src/main/java/com/zeapo/pwdstore/widget/MultiselectableConstraintLayout.kt
index c857c4d4..3cd88eb4 100644
--- a/app/src/main/java/com/zeapo/pwdstore/widget/MultiselectableLinearLayout.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/widget/MultiselectableConstraintLayout.kt
@@ -7,15 +7,15 @@ package com.zeapo.pwdstore.widget
import android.content.Context
import android.util.AttributeSet
import android.view.View
-import android.widget.LinearLayout
+import androidx.constraintlayout.widget.ConstraintLayout
import com.zeapo.pwdstore.R
-class MultiselectableLinearLayout @JvmOverloads constructor(
+class MultiselectableConstraintLayout @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0,
defStyleRes: Int = 0
-) : LinearLayout(context, attrs, defStyleAttr, defStyleRes) {
+) : ConstraintLayout(context, attrs, defStyleAttr, defStyleRes) {
private var multiselected: Boolean = false
override fun onCreateDrawableState(extraSpace: Int): IntArray {
@@ -35,14 +35,6 @@ class MultiselectableLinearLayout @JvmOverloads constructor(
isActivated = on
}
- fun setSingleSelected(on: Boolean) {
- if (multiselected) {
- multiselected = false
- refreshDrawableState()
- }
- isActivated = on
- }
-
companion object {
private val STATE_MULTISELECTED = intArrayOf(R.attr.state_multiselected)
}