You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Strip out most StaggeredGridLayoutManager in code
This commit is contained in:
@@ -2,8 +2,6 @@ package com.topjohnwu.magisk.model.entity.recycler
|
||||
|
||||
import androidx.databinding.Bindable
|
||||
import androidx.databinding.Observable
|
||||
import androidx.databinding.ViewDataBinding
|
||||
import androidx.recyclerview.widget.StaggeredGridLayoutManager
|
||||
import com.topjohnwu.magisk.BR
|
||||
import com.topjohnwu.magisk.R
|
||||
import com.topjohnwu.magisk.core.model.module.Module
|
||||
@@ -16,12 +14,6 @@ import com.topjohnwu.magisk.utils.set
|
||||
object InstallModule : ComparableRvItem<InstallModule>() {
|
||||
override val layoutRes = R.layout.item_module_download
|
||||
|
||||
override fun onBindingBound(binding: ViewDataBinding) {
|
||||
super.onBindingBound(binding)
|
||||
val params = binding.root.layoutParams as? StaggeredGridLayoutManager.LayoutParams
|
||||
params?.isFullSpan = true
|
||||
}
|
||||
|
||||
override fun contentSameAs(other: InstallModule) = this == other
|
||||
override fun itemSameAs(other: InstallModule) = this === other
|
||||
}
|
||||
@@ -45,12 +37,6 @@ class SectionTitle(
|
||||
var hasButton = _button != 0 && _icon != 0
|
||||
set(value) = set(value, field, { field = it }, BR.hasButton)
|
||||
|
||||
override fun onBindingBound(binding: ViewDataBinding) {
|
||||
super.onBindingBound(binding)
|
||||
val params = binding.root.layoutParams as? StaggeredGridLayoutManager.LayoutParams
|
||||
params?.isFullSpan = true
|
||||
}
|
||||
|
||||
override fun itemSameAs(other: SectionTitle): Boolean = this === other
|
||||
override fun contentSameAs(other: SectionTitle): Boolean = this === other
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@ package com.topjohnwu.magisk.model.entity.recycler
|
||||
|
||||
import android.graphics.drawable.Drawable
|
||||
import androidx.databinding.Bindable
|
||||
import androidx.databinding.ViewDataBinding
|
||||
import androidx.recyclerview.widget.StaggeredGridLayoutManager
|
||||
import com.topjohnwu.magisk.BR
|
||||
import com.topjohnwu.magisk.R
|
||||
import com.topjohnwu.magisk.core.model.MagiskPolicy
|
||||
@@ -60,12 +58,6 @@ class PolicyItem(val item: MagiskPolicy, val icon: Drawable) : ObservableItem<Po
|
||||
viewModel.updatePolicy(updatedPolicy, isLogging = true)
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -1,19 +1,11 @@
|
||||
package com.topjohnwu.magisk.model.entity.recycler
|
||||
|
||||
import androidx.databinding.ViewDataBinding
|
||||
import androidx.recyclerview.widget.StaggeredGridLayoutManager
|
||||
import com.topjohnwu.magisk.R
|
||||
import com.topjohnwu.magisk.databinding.ComparableRvItem
|
||||
|
||||
class TextItem(val text: Int) : ComparableRvItem<TextItem>() {
|
||||
override val layoutRes = R.layout.item_text
|
||||
|
||||
override fun onBindingBound(binding: ViewDataBinding) {
|
||||
super.onBindingBound(binding)
|
||||
val params = binding.root.layoutParams as? StaggeredGridLayoutManager.LayoutParams
|
||||
params?.isFullSpan = true
|
||||
}
|
||||
|
||||
override fun contentSameAs(other: TextItem) = text == other.text
|
||||
override fun itemSameAs(other: TextItem) = contentSameAs(other)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user