Updated layouts to fit new widget that should visually represent a switch

The switch is not actually a switch, but a representation of internal state, the layouts continue to accept touch events as beforehand.
This commit is contained in:
Viktor De Pasquale
2020-02-11 19:14:48 +01:00
committed by John Wu
parent d7653e6e42
commit 9952387356
15 changed files with 146 additions and 101 deletions

View File

@@ -1,6 +1,8 @@
package com.topjohnwu.magisk.model.entity.recycler
import android.graphics.drawable.Drawable
import androidx.databinding.ViewDataBinding
import androidx.recyclerview.widget.StaggeredGridLayoutManager
import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.core.model.MagiskPolicy
import com.topjohnwu.magisk.databinding.ComparableRvItem
@@ -47,6 +49,12 @@ class PolicyItem(val item: MagiskPolicy, val icon: Drawable) : ComparableRvItem<
viewModel.updatePolicy(PolicyUpdateEvent.Log(updatedPolicy))
}
override fun onBindingBound(binding: ViewDataBinding) {
super.onBindingBound(binding)
val params = binding.root.layoutParams as? StaggeredGridLayoutManager.LayoutParams
params?.isFullSpan = true
}
override fun contentSameAs(other: PolicyItem) = itemSameAs(other)
override fun itemSameAs(other: PolicyItem) = item.uid == other.item.uid