[自主算路验证] feat: 增加算路结果反馈弹框;
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<gradient android:startColor="#2A537F" android:endColor="#263A5B" android:angle="135"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#2A4A7A" />
|
||||
<corners android:bottomRightRadius="@dimen/dp_45" />
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<gradient android:startColor="#20AAFF" android:endColor="#2F6EFF" android:angle="315"/>
|
||||
<corners android:bottomLeftRadius="@dimen/dp_45" android:bottomRightRadius="@dimen/dp_45"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#2F6EFF"
|
||||
android:startColor="#20AAFF" />
|
||||
<corners android:bottomLeftRadius="@dimen/dp_45" />
|
||||
</shape>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.och.common.module.wigets.OCHRoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="@dimen/dp_800"
|
||||
android:layout_height="@dimen/dp_500"
|
||||
android:background="@drawable/bg_shape_dialog_no_title"
|
||||
app:roundLayoutRadius="@dimen/dp_45">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/closeDialogIcon"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:src="@drawable/taxi_close_navi_icon"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/routing_common_tips"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="@dimen/dp_80"
|
||||
android:layout_marginEnd="@dimen/dp_80"
|
||||
android:gravity="center"
|
||||
android:text="@string/routing_feedback_result_hint"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/dp_56"
|
||||
app:layout_constraintBottom_toTopOf="@+id/routing_common_cancel"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/routing_common_cancel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="134dp"
|
||||
android:background="@drawable/bg_shape_left_bottom_round"
|
||||
android:gravity="center"
|
||||
android:text="@string/routing_feedback_result_btn_not_sure"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintWidth_percent="0.5" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/routing_common_confirm"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="134dp"
|
||||
android:background="@drawable/bg_shape_right_bottom_round"
|
||||
android:gravity="center"
|
||||
android:text="@string/routing_feedback_result_btn_sure"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/routing_common_cancel"
|
||||
app:layout_constraintWidth_percent="0.5" />
|
||||
</com.mogo.och.common.module.wigets.OCHRoundConstraintLayout>
|
||||
@@ -70,6 +70,9 @@
|
||||
<string name="routing_verify_choose_line_start">起点: </string>
|
||||
<string name="routing_verify_choose_line_end">终点:</string>
|
||||
<string name="routing_verify_line_item_goto_end">往%1$s方向</string>
|
||||
<string name="routing_feedback_result_btn_sure">线路可用</string>
|
||||
<string name="routing_feedback_result_btn_not_sure">线路不可用</string>
|
||||
<string name="routing_feedback_result_hint">路线验证结束啦!点击下方按钮反馈验证结果吧</string>
|
||||
|
||||
<!-- endregion -->
|
||||
</resources>
|
||||
Reference in New Issue
Block a user