Silence kotlin warnings
This commit is contained in:
parent
eb261c8026
commit
5833aadef5
@ -9,18 +9,18 @@ import me.tatarka.bindingcollectionadapter2.BindingRecyclerViewAdapter
|
||||
import me.tatarka.bindingcollectionadapter2.ItemBinding
|
||||
import me.tatarka.bindingcollectionadapter2.OnItemBind
|
||||
|
||||
inline fun <T : ComparableRvItem<*>> diffListOf(
|
||||
fun <T : ComparableRvItem<*>> diffListOf(
|
||||
vararg newItems: T
|
||||
) = diffListOf(newItems.toList())
|
||||
|
||||
inline fun <T : ComparableRvItem<*>> diffListOf(
|
||||
fun <T : ComparableRvItem<*>> diffListOf(
|
||||
newItems: List<T>
|
||||
) = DiffObservableList(object : DiffObservableList.Callback<T> {
|
||||
override fun areItemsTheSame(oldItem: T, newItem: T) = oldItem.genericItemSameAs(newItem)
|
||||
override fun areContentsTheSame(oldItem: T, newItem: T) = oldItem.genericContentSameAs(newItem)
|
||||
}).also { it.update(newItems) }
|
||||
|
||||
inline fun <T : ComparableRvItem<*>> filterableListOf(
|
||||
fun <T : ComparableRvItem<*>> filterableListOf(
|
||||
vararg newItems: T
|
||||
) = FilterableDiffObservableList(object : DiffObservableList.Callback<T> {
|
||||
override fun areItemsTheSame(oldItem: T, newItem: T) = oldItem.genericItemSameAs(newItem)
|
||||
|
@ -290,7 +290,7 @@ abstract class MagiskInstallImpl : KoinComponent {
|
||||
srcBoot = File(installDir, "boot.img").path
|
||||
}
|
||||
|
||||
var isSigned = false
|
||||
var isSigned: Boolean
|
||||
try {
|
||||
SuFileInputStream(srcBoot).use {
|
||||
isSigned = SignBoot.verifySignature(it, null)
|
||||
|
@ -35,11 +35,9 @@ class SnackbarEvent private constructor(
|
||||
) = Snackbar.make(view, message, length).apply(builder).show()
|
||||
|
||||
override fun invoke(activity: BaseUIActivity<*, *>) {
|
||||
if (activity is BaseUIActivity<*, *>) {
|
||||
snackbar(activity.snackbarView,
|
||||
msg.getText(activity.resources).toString(),
|
||||
length, builder)
|
||||
}
|
||||
snackbar(activity.snackbarView,
|
||||
msg.getText(activity.resources).toString(),
|
||||
length, builder)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -55,15 +55,15 @@ class EndlessRecyclerScrollListener(
|
||||
val visibleItemPosition = if (direction == Direction.BOTTOM) {
|
||||
when (layoutManager) {
|
||||
is StaggeredGridLayoutManager ->
|
||||
layoutManager.findLastVisibleItemPositions(null).max() ?: 0
|
||||
layoutManager.findLastVisibleItemPositions(null).maxOrNull() ?: 0
|
||||
is GridLayoutManager -> layoutManager.findLastVisibleItemPosition()
|
||||
is LinearLayoutManager -> layoutManager.findLastVisibleItemPosition()
|
||||
else -> throw IllegalArgumentException("Only LinearLayoutManager, GridLayoutManager and StaggeredGridLayoutManager are supported")
|
||||
}
|
||||
} else {
|
||||
when (layoutManager) {
|
||||
is StaggeredGridLayoutManager -> layoutManager.findFirstVisibleItemPositions(null).min()
|
||||
?: 0
|
||||
is StaggeredGridLayoutManager ->
|
||||
layoutManager.findFirstVisibleItemPositions(null).minOrNull() ?: 0
|
||||
is GridLayoutManager -> layoutManager.findFirstVisibleItemPosition()
|
||||
is LinearLayoutManager -> layoutManager.findFirstVisibleItemPosition()
|
||||
else -> throw IllegalArgumentException("Only LinearLayoutManager, GridLayoutManager and StaggeredGridLayoutManager are supported")
|
||||
|
@ -228,7 +228,7 @@ class MagiskDialog(
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
val items = list.mapIndexed { i, it -> DialogItem(it, i) }
|
||||
val items = list.mapIndexed { i, cs -> DialogItem(cs, i) }
|
||||
val binding = itemBindingOf<DialogItem> { it.bindExtra(BR.listener, actualListener) }
|
||||
.let { ItemBinding.of(it) }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user