mirror of
https://github.com/afollestad/nock-nock.git
synced 2025-08-04 07:08:42 +00:00
Fix DiffUtil usage
This commit is contained in:
parent
b09088ab9e
commit
b7c51a12ed
2 changed files with 3 additions and 3 deletions
|
@ -31,10 +31,10 @@ class SiteDiffCallback(
|
||||||
override fun areItemsTheSame(
|
override fun areItemsTheSame(
|
||||||
oldItemPosition: Int,
|
oldItemPosition: Int,
|
||||||
newItemPosition: Int
|
newItemPosition: Int
|
||||||
) = oldItems[oldItemPosition].id == oldItems[newItemPosition].id
|
) = oldItems[oldItemPosition].id == newItems[newItemPosition].id
|
||||||
|
|
||||||
override fun areContentsTheSame(
|
override fun areContentsTheSame(
|
||||||
oldItemPosition: Int,
|
oldItemPosition: Int,
|
||||||
newItemPosition: Int
|
newItemPosition: Int
|
||||||
) = oldItems[oldItemPosition] == oldItems[newItemPosition]
|
) = oldItems[oldItemPosition] == newItems[newItemPosition]
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ inline fun <reified T> EditText.attachLiveData(
|
||||||
if (data.value != null) {
|
if (data.value != null) {
|
||||||
this.setText(data.value.toString())
|
this.setText(data.value.toString())
|
||||||
} else {
|
} else {
|
||||||
data.value = this.text.trim().toString().toInt() as T
|
data.value = (this.text.trim().toString().toIntOrNull() ?: 0) as T
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Out
|
// Out
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue