diff --git a/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/model/DriverM1Model.kt b/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/model/DriverM1Model.kt
index de771bcc76..d72a9a072e 100644
--- a/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/model/DriverM1Model.kt
+++ b/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/model/DriverM1Model.kt
@@ -651,6 +651,7 @@ class DriverM1Model {
if (TextUtils.isEmpty(data.data.orderNo)){//还未换车,显示还车状态
mOrderCallback?.updateReturnCarStatus(false)
mCurrentOrder = null
+ currentChangeDestMsg = null
sendCharterEndTripInfo()
startOrStopCheckCountDown(false)
updateToClientData()
@@ -662,6 +663,7 @@ class DriverM1Model {
mOrderCallback?.updateReturnCarStatus(true)
clearAutopilotControlParameters()
mCurrentOrder = null
+ currentChangeDestMsg = null
startOrStopCheckCountDown(false)
updateToClientData()
}
diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHCommitDialog.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHCommitDialog.kt
index d28cd32db5..1d546fe19e 100644
--- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHCommitDialog.kt
+++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHCommitDialog.kt
@@ -42,6 +42,14 @@ class OCHCommitDialog: BaseFloatDialog, LifecycleObserver {
commonConfirm?.text = builder.confirmStr
countDownTxt?.text = builder.countDownValue.toString()
mCountdownValue = builder.countDownValue
+
+ if (mCountdownValue > 0){
+ countDownTxt?.visibility = View.VISIBLE
+ countdownRotateIv?.visibility = View.VISIBLE
+ }else{
+ countDownTxt?.visibility = View.GONE
+ countdownRotateIv?.visibility = View.GONE
+ }
}
init{
@@ -64,14 +72,6 @@ class OCHCommitDialog: BaseFloatDialog, LifecycleObserver {
clickListener?.cancel()
dismiss()
}
-
- if (mCountdownValue > 0){
- countDownTxt?.visibility = View.VISIBLE
- countdownRotateIv?.visibility = View.VISIBLE
- }else{
- countDownTxt?.visibility = View.GONE
- countdownRotateIv?.visibility = View.GONE
- }
}
fun setClickListener(clickListener: ClickListener) {
@@ -96,6 +96,11 @@ class OCHCommitDialog: BaseFloatDialog, LifecycleObserver {
it.dispose()
}
}
+ val mAnimation: Animation = AnimationUtils.loadAnimation(context, R.anim.count_down_rotate)
+ val lin = LinearInterpolator()
+ mAnimation.interpolator = lin
+ countdownRotateIv?.startAnimation(mAnimation)
+
subscribeCountDown = Observable.intervalRange(0L
, mCountdownValue.toLong(), 0, 1, TimeUnit.SECONDS)
.map { aLong -> mCountdownValue - aLong }
@@ -105,14 +110,20 @@ class OCHCommitDialog: BaseFloatDialog, LifecycleObserver {
UiThreadHandler.post {
mCountdownValue -= 1
countDownTxt?.text = mCountdownValue.toString()
+ if (mCountdownValue == 0){
+ mAnimation.cancel()
+ countdownRotateIv?.clearAnimation()
+ countDownTxt?.visibility = View.GONE
+ countdownRotateIv?.visibility = View.GONE
+ dialogCancel()
+ }
}
}
+ }
- val mAnimation: Animation = AnimationUtils.loadAnimation(context, R.anim.count_down_rotate)
- val lin = LinearInterpolator()
- mAnimation.interpolator = lin
- count_down_rotate_iv.startAnimation(mAnimation)
-
+ private fun dialogCancel() {
+ clickListener?.cancel()
+ dismiss()
}
override fun onDetachedFromWindow() {
diff --git a/OCH/mogo-och-common-module/src/main/res/layout/dialog_bus_commit.xml b/OCH/mogo-och-common-module/src/main/res/layout/dialog_bus_commit.xml
index 65e1add2a9..ab121f0d7e 100644
--- a/OCH/mogo-och-common-module/src/main/res/layout/dialog_bus_commit.xml
+++ b/OCH/mogo-och-common-module/src/main/res/layout/dialog_bus_commit.xml
@@ -2,6 +2,7 @@
+ android:textSize="@dimen/dp_20"/>