From c0e172077f64e132677a85e35b6503871241cdb8 Mon Sep 17 00:00:00 2001 From: bxb Date: Sat, 11 Feb 2023 16:59:31 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=B8=85=E6=89=AB=E8=BD=A6]=E4=BA=BA=E5=B7=A5?= =?UTF-8?q?=E9=A9=BE=E9=A9=B6=E5=AD=90=E4=BB=BB=E5=8A=A1=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/dialog/SweeperManualDrivingDialog.kt | 70 +++++++++++++++++++ .../layout/dialog_sweeper_manual_driving.xml | 37 ++++++++++ 2 files changed, 107 insertions(+) create mode 100644 OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/dialog/SweeperManualDrivingDialog.kt create mode 100644 OCH/mogo-och-sweeper/src/main/res/layout/dialog_sweeper_manual_driving.xml diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/dialog/SweeperManualDrivingDialog.kt b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/dialog/SweeperManualDrivingDialog.kt new file mode 100644 index 0000000000..788f2965e6 --- /dev/null +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/dialog/SweeperManualDrivingDialog.kt @@ -0,0 +1,70 @@ +package com.mogo.och.sweeper.ui.dialog + +import android.content.Context +import android.widget.TextView +import androidx.lifecycle.LifecycleObserver +import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog +import com.mogo.och.sweeper.R + +/** + * 不带带有title, tip,confirm,cancel的dialog + */ +class SweeperManualDrivingDialog: BaseFloatDialog, LifecycleObserver { + + private var commonConfirm : TextView? = null + private var commonTips : TextView? = null + + private var clickListener: ClickListener? = null + + constructor(builder: Builder,context: Context) : super(context) { + commonTips?.text = builder.tipsStr + commonConfirm?.text = builder.confirmStr + } + + init{ + setContentView(R.layout.dialog_sweeper_manual_driving) + + setCanceledOnTouchOutside(false) + + commonConfirm = findViewById(R.id.sweeper_common_confirm) + commonTips = findViewById(R.id.sweeper_common_tips) + + commonConfirm?.setOnClickListener{ + clickListener?.confirm() + dismiss() + } + } + + fun setClickListener(clickListener: ClickListener) { + this.clickListener = clickListener + } + + fun showUpgradeDialog(){ + if(isShowing){ + return + } + show() + } + + interface ClickListener{ + fun confirm() + } + + class Builder{ + var tipsStr:String = "" + var confirmStr:String = "" + fun tips(tips: String) : Builder{ + this.tipsStr = tips + return this + } + + fun confirmStr(commit: String) : Builder{ + this.confirmStr = commit + return this + } + fun build(context: Context): SweeperManualDrivingDialog? { + return SweeperManualDrivingDialog(this,context) + } + } + +} \ No newline at end of file diff --git a/OCH/mogo-och-sweeper/src/main/res/layout/dialog_sweeper_manual_driving.xml b/OCH/mogo-och-sweeper/src/main/res/layout/dialog_sweeper_manual_driving.xml new file mode 100644 index 0000000000..c6fca84ec2 --- /dev/null +++ b/OCH/mogo-och-sweeper/src/main/res/layout/dialog_sweeper_manual_driving.xml @@ -0,0 +1,37 @@ + + + + + \ No newline at end of file