From c41eec636d1c67eface7e4e737546389458c6d52 Mon Sep 17 00:00:00 2001 From: aibingbing Date: Mon, 20 Nov 2023 15:20:11 +0800 Subject: [PATCH] =?UTF-8?q?[=E8=87=AA=E4=B8=BB=E7=AE=97=E8=B7=AF=E9=AA=8C?= =?UTF-8?q?=E8=AF=81]=20feat:=20=E5=A2=9E=E5=8A=A0=E7=AE=97=E8=B7=AF?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E5=8F=8D=E9=A6=88=E5=BC=B9=E6=A1=86=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/routing/TaxiRoutingFeedbackDialog.kt | 89 +++++++++++++++++++ .../taxi/ui/routing/TaxiRoutingFragment.kt | 21 +++++ .../res/drawable/bg_shape_dialog_no_title.xml | 4 + .../drawable/bg_shape_left_bottom_round.xml | 6 ++ .../bg_shape_left_right_bottom_round.xml | 5 ++ .../drawable/bg_shape_right_bottom_round.xml | 9 ++ .../layout/dialog_routing_feedback_result.xml | 61 +++++++++++++ .../src/main/res/values/strings.xml | 3 + 8 files changed, 198 insertions(+) create mode 100644 OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingFeedbackDialog.kt create mode 100644 OCH/taxi/unmanned-driver/src/main/res/drawable/bg_shape_dialog_no_title.xml create mode 100644 OCH/taxi/unmanned-driver/src/main/res/drawable/bg_shape_left_bottom_round.xml create mode 100644 OCH/taxi/unmanned-driver/src/main/res/drawable/bg_shape_left_right_bottom_round.xml create mode 100644 OCH/taxi/unmanned-driver/src/main/res/drawable/bg_shape_right_bottom_round.xml create mode 100644 OCH/taxi/unmanned-driver/src/main/res/layout/dialog_routing_feedback_result.xml diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingFeedbackDialog.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingFeedbackDialog.kt new file mode 100644 index 0000000000..b7de129128 --- /dev/null +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingFeedbackDialog.kt @@ -0,0 +1,89 @@ +package com.mogo.och.taxi.ui.routing + +import android.content.Context +import android.widget.ImageView +import android.widget.TextView +import androidx.lifecycle.LifecycleObserver +import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog +import com.mogo.och.taxi.R + +class TaxiRoutingFeedbackDialog : BaseFloatDialog, LifecycleObserver { + + private var commonConfirm: TextView? = null + private var commonCancel: TextView? = null + private var commonTips: TextView? = null + private var commonCloseIcon: ImageView? = null + private var clickListener: ClickListener? = null + + constructor(builder: Builder, context: Context) : super(context) { + commonTips?.text = builder.tipsStr + commonCancel?.text = builder.cancelStr + commonConfirm?.text = builder.confirmStr + } + + init { + setContentView(R.layout.dialog_routing_feedback_result) + + setCanceledOnTouchOutside(true) + + commonConfirm = findViewById(R.id.routing_common_confirm) + commonCancel = findViewById(R.id.routing_common_cancel) + commonTips = findViewById(R.id.routing_common_tips) + commonCloseIcon = findViewById(R.id.closeDialogIcon) + + commonCloseIcon?.setOnClickListener { + dismiss() + } + + commonConfirm?.setOnClickListener { + clickListener?.confirm() + dismiss() + } + + commonCancel?.setOnClickListener { + clickListener?.cancel() + dismiss() + } + } + + fun setClickListener(clickListener: ClickListener) { + this.clickListener = clickListener + } + + fun showDialog() { + if (isShowing) { + return + } + show() + } + + interface ClickListener { + fun confirm() + fun cancel() + } + + class Builder { + var tipsStr: String = "" + var confirmStr: String = "" + var cancelStr: String = "" + + fun tips(tips: String): Builder { + this.tipsStr = tips + return this + } + + fun confirmStr(commit: String): Builder { + this.confirmStr = commit + return this + } + + fun cancelStr(cancel: String): Builder { + this.cancelStr = cancel + return this + } + + fun build(context: Context): TaxiRoutingFeedbackDialog? { + return TaxiRoutingFeedbackDialog(this, context) + } + } +} \ No newline at end of file diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingFragment.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingFragment.kt index 22c90c21fe..18c41878a2 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingFragment.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingFragment.kt @@ -6,12 +6,14 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import com.mogo.commons.mvp.BaseFragment +import com.mogo.eagle.core.function.main.MainMoGoApplication import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant import com.mogo.eagle.core.utilcode.util.ToastUtils import com.mogo.och.common.module.utils.FlowBus import com.mogo.och.taxi.R import com.mogo.och.taxi.constant.TaxiDriverEventConst import kotlinx.android.synthetic.main.routing_fragment.btnChooseTask +import kotlinx.android.synthetic.main.routing_fragment.btnFinishTask import kotlinx.android.synthetic.main.routing_fragment.btnStartTask import kotlinx.android.synthetic.main.routing_fragment.finishSubmitIssueGroup import kotlinx.android.synthetic.main.routing_fragment.headerTitleContainer @@ -94,5 +96,24 @@ class TaxiRoutingFragment : BaseFragment() { btnChooseTask.visibility = View.GONE btnStartTask.visibility = View.GONE finishSubmitIssueGroup.visibility = View.VISIBLE + btnFinishTask.setOnClickListener { + showFeedbackDialog() + } + } + + private fun showFeedbackDialog() { + val builder: TaxiRoutingFeedbackDialog.Builder = TaxiRoutingFeedbackDialog.Builder() + builder.cancelStr( + MainMoGoApplication.getApp() + .getString(R.string.routing_feedback_result_btn_not_sure) + ) + .confirmStr( + MainMoGoApplication.getApp() + .getString(R.string.routing_feedback_result_btn_sure) + ) + .tips(MainMoGoApplication.getApp().getString(R.string.routing_feedback_result_hint)) + activity?.also { + builder.build(it)?.showDialog() + } } } \ No newline at end of file diff --git a/OCH/taxi/unmanned-driver/src/main/res/drawable/bg_shape_dialog_no_title.xml b/OCH/taxi/unmanned-driver/src/main/res/drawable/bg_shape_dialog_no_title.xml new file mode 100644 index 0000000000..e6970921d5 --- /dev/null +++ b/OCH/taxi/unmanned-driver/src/main/res/drawable/bg_shape_dialog_no_title.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/OCH/taxi/unmanned-driver/src/main/res/drawable/bg_shape_left_bottom_round.xml b/OCH/taxi/unmanned-driver/src/main/res/drawable/bg_shape_left_bottom_round.xml new file mode 100644 index 0000000000..0a852f4062 --- /dev/null +++ b/OCH/taxi/unmanned-driver/src/main/res/drawable/bg_shape_left_bottom_round.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/OCH/taxi/unmanned-driver/src/main/res/drawable/bg_shape_left_right_bottom_round.xml b/OCH/taxi/unmanned-driver/src/main/res/drawable/bg_shape_left_right_bottom_round.xml new file mode 100644 index 0000000000..bd0ab9d1e1 --- /dev/null +++ b/OCH/taxi/unmanned-driver/src/main/res/drawable/bg_shape_left_right_bottom_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/OCH/taxi/unmanned-driver/src/main/res/drawable/bg_shape_right_bottom_round.xml b/OCH/taxi/unmanned-driver/src/main/res/drawable/bg_shape_right_bottom_round.xml new file mode 100644 index 0000000000..3b6f63de68 --- /dev/null +++ b/OCH/taxi/unmanned-driver/src/main/res/drawable/bg_shape_right_bottom_round.xml @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file diff --git a/OCH/taxi/unmanned-driver/src/main/res/layout/dialog_routing_feedback_result.xml b/OCH/taxi/unmanned-driver/src/main/res/layout/dialog_routing_feedback_result.xml new file mode 100644 index 0000000000..de14625b26 --- /dev/null +++ b/OCH/taxi/unmanned-driver/src/main/res/layout/dialog_routing_feedback_result.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/OCH/taxi/unmanned-driver/src/main/res/values/strings.xml b/OCH/taxi/unmanned-driver/src/main/res/values/strings.xml index db87842190..0c01eb4938 100644 --- a/OCH/taxi/unmanned-driver/src/main/res/values/strings.xml +++ b/OCH/taxi/unmanned-driver/src/main/res/values/strings.xml @@ -70,6 +70,9 @@ 起点: 终点: 往%1$s方向 + 线路可用 + 线路不可用 + 路线验证结束啦!点击下方按钮反馈验证结果吧 \ No newline at end of file