[清扫车]结束任务弹窗布局添加
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
package com.mogo.och.sweeper.ui.dialog
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
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 SweeperNoTitleCommonDialog: BaseFloatDialog, LifecycleObserver {
|
||||
|
||||
private var commonConfirm : TextView? = null
|
||||
private var commonCancel : TextView? = null
|
||||
private var commonTips : TextView? = 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_sweeper_no_title)
|
||||
|
||||
setCanceledOnTouchOutside(true)
|
||||
|
||||
commonConfirm = findViewById(R.id.sweeper_common_confirm)
|
||||
commonCancel = findViewById(R.id.sweeper_common_cancel)
|
||||
commonTips = findViewById(R.id.sweeper_common_tips)
|
||||
|
||||
commonConfirm?.setOnClickListener{
|
||||
clickListener?.confirm()
|
||||
dismiss()
|
||||
}
|
||||
commonCancel?.setOnClickListener {
|
||||
clickListener?.cancel()
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
fun setClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
fun showUpgradeDialog(){
|
||||
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): SweeperNoTitleCommonDialog? {
|
||||
return SweeperNoTitleCommonDialog(this,context)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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="139"/>
|
||||
</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="-44"/>
|
||||
<corners android:bottomLeftRadius="@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="-44"/>
|
||||
<corners android:bottomLeftRadius="@dimen/dp_45" 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">
|
||||
<solid android:color="#2A4A7A"/>
|
||||
<corners android:bottomRightRadius="@dimen/dp_45" />
|
||||
</shape>
|
||||
@@ -0,0 +1,51 @@
|
||||
<?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"
|
||||
tools:text="是否结束任务?"
|
||||
android:layout_marginStart="@dimen/dp_80"
|
||||
android:layout_marginEnd="@dimen/dp_80"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/sweeper_common_confirm"
|
||||
android:layout_width="0dp"
|
||||
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_bottom_round"
|
||||
tools:text="确认"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/sweeper_common_cancel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="134dp"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/dp_50"
|
||||
android:gravity="center"
|
||||
app:layout_constraintStart_toEndOf="@+id/sweeper_common_confirm"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintWidth_percent="0.5"
|
||||
android:background="@drawable/bg_shape_right_bottom_round"
|
||||
tools:text="取消"
|
||||
/>
|
||||
</com.mogo.och.common.module.wigets.OCHRoundConstraintLayout>
|
||||
Reference in New Issue
Block a user