[8.0.0]
[fix] [RoutingSwitchView 数据清理]
This commit is contained in:
@@ -39,6 +39,8 @@ class RoutingSwitchView: ConstraintLayout, RoutingSwitchModel.SwtichLineViewCall
|
||||
|
||||
private var viewModel: RoutingSwitchModel?=null
|
||||
|
||||
private var data: StartGrayAndQueryContrailRsp?=null
|
||||
|
||||
|
||||
|
||||
init {
|
||||
@@ -95,8 +97,6 @@ class RoutingSwitchView: ConstraintLayout, RoutingSwitchModel.SwtichLineViewCall
|
||||
},dex, ThreadUtils.MODE.QUEUE)
|
||||
}
|
||||
|
||||
private var data: StartGrayAndQueryContrailRsp?=null
|
||||
|
||||
override fun showRoutingRunning(data: StartGrayAndQueryContrailRsp) {
|
||||
this.data = data
|
||||
val endLoading = System.currentTimeMillis()
|
||||
@@ -123,11 +123,19 @@ class RoutingSwitchView: ConstraintLayout, RoutingSwitchModel.SwtichLineViewCall
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
CallerLogger.d(TAG,"onAttachedToWindow")
|
||||
super.onAttachedToWindow()
|
||||
viewModel = findViewTreeViewModelStoreOwner()?.let {
|
||||
ViewModelProvider(it).get(RoutingSwitchModel::class.java)
|
||||
}
|
||||
viewModel?.setDistanceCallback(this)
|
||||
data = null
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerLogger.d(TAG,"onDetachedFromWindow")
|
||||
data = null
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user