[6.7.3]
[fix] [避免任务被删除]
This commit is contained in:
@@ -59,7 +59,6 @@ data class LineDataBean(
|
||||
|
||||
if (lineId != other.lineId) return false
|
||||
if (lineName != other.lineName) return false
|
||||
if (endStationName != other.endStationName) return false
|
||||
|
||||
return true
|
||||
}
|
||||
@@ -67,7 +66,7 @@ data class LineDataBean(
|
||||
override fun hashCode(): Int {
|
||||
var result = lineId?.hashCode() ?: 0
|
||||
result = 31 * result + (lineName?.hashCode() ?: 0)
|
||||
result = 31 * result + (endStationName?.hashCode() ?: 0)
|
||||
return result
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,10 +28,6 @@ class SwitchLineAdapter(
|
||||
private var mItemClickListener: LineItemClickListener? = null
|
||||
|
||||
fun setDataList(dataList: List<LineDataBean>) {
|
||||
if (this.mData == dataList) {
|
||||
// 如果新旧列表一致,则直接返回
|
||||
return
|
||||
}
|
||||
|
||||
val diffResult = DiffUtil.calculateDiff(MyDiffCallback(this.mData, dataList))
|
||||
this.mData.clear()
|
||||
@@ -95,13 +91,13 @@ class SwitchLineAdapter(
|
||||
override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
|
||||
val oldItem = oldData[oldItemPosition]
|
||||
val newItem = newData[newItemPosition]
|
||||
return oldItem == newItem
|
||||
return oldItem == newItem && oldItem.endStationName == newItem.endStationName
|
||||
}
|
||||
|
||||
override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
|
||||
val oldItem = oldData[oldItemPosition]
|
||||
val newItem = newData[newItemPosition]
|
||||
return oldItem == newItem
|
||||
return oldItem == newItem && oldItem.endStationName == newItem.endStationName
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user