[清扫车]人工驾驶子任务弹窗布局添加
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="@drawable/bg_shape_dialog_no_title"
|
||||
app:roundLayoutRadius="@dimen/dp_45">
|
||||
<TextView
|
||||
android:id="@+id/sweeper_common_tips"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/sweeper_common_confirm"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/dp_56"
|
||||
android:gravity="center_vertical"
|
||||
tools:text="前方子任务惠新西街南口地铁站公交站手动驾驶至惠新西街南口地铁站公交站"
|
||||
android:layout_marginStart="@dimen/dp_80"
|
||||
android:layout_marginEnd="@dimen/dp_80"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/sweeper_common_confirm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="134dp"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/dp_50"
|
||||
android:gravity="center"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintWidth_percent="0.5"
|
||||
android:background="@drawable/bg_shape_left_right_bottom_round"
|
||||
tools:text="确认"
|
||||
/>
|
||||
</com.mogo.och.common.module.wigets.OCHRoundConstraintLayout>
|
||||
Reference in New Issue
Block a user