diff options
author | Harsh Shandilya <msfjarvis@gmail.com> | 2019-11-04 23:16:25 +0530 |
---|---|---|
committer | Harsh Shandilya <msfjarvis@gmail.com> | 2019-11-04 23:16:25 +0530 |
commit | a47af477b6615f68cdb656039ea68c5cc5aa978a (patch) | |
tree | 79acfcb23a7a2e7b55739b413f7bb05efcedafa6 /app/src/main/java | |
parent | 13abcdeb806f00237b34e21de4ed61e426b66867 (diff) |
Remove useless parent layout
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.kt | 4 | ||||
-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) } |