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