Updated the logic that refreshes the modules

Also added empty states for installed and made updatable modules visible all the time to avoid unnecessary transitions
This commit is contained in:
Viktor De Pasquale
2020-01-06 17:46:08 +01:00
parent 13262fdb18
commit ed837ba26f
4 changed files with 89 additions and 47 deletions
@@ -0,0 +1,19 @@
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)
}