3.2.3司机认证优化
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.cuspop
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.view.View
|
||||
import com.arpa.hndahesudintocctmsdriver.R
|
||||
import com.dahe.mylibrary.utils.BaseUtils
|
||||
import com.dahe.mylibrary.utils.ToastUtils
|
||||
import com.lxj.xpopup.core.CenterPopupView
|
||||
import kotlinx.android.synthetic.main.load.view.*
|
||||
import kotlinx.android.synthetic.main.pop_message_center.view.*
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName MessagePop
|
||||
* @Author 用户
|
||||
* @Date 2023/8/14 18:01
|
||||
* @Description TODO
|
||||
*/
|
||||
class MessagePop(context: Context) : CenterPopupView(context), View.OnClickListener {
|
||||
|
||||
lateinit var content :String
|
||||
|
||||
constructor(context: Context,message : String) :this(context) {
|
||||
content = message
|
||||
}
|
||||
|
||||
override fun getImplLayoutId() = R.layout.pop_message_center
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
tvCancel.setOnClickListener(this)
|
||||
tvOk.setOnClickListener(this)
|
||||
tvPhone.setOnClickListener(this)
|
||||
tvContent.text = "$content"
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
when(v?.id){
|
||||
R.id.tvCancel -> {
|
||||
dismiss()
|
||||
}
|
||||
R.id.tvOk,R.id.tvPhone -> {
|
||||
dismiss()
|
||||
val toString = tvPhone.text.toString()
|
||||
val intent = Intent(Intent.ACTION_CALL)
|
||||
val data = Uri.parse("tel:$toString")
|
||||
intent.data = data
|
||||
context.startActivity(intent)
|
||||
dismiss()
|
||||
// BaseUtils.callPhone(content as Activity, tvPhone.text.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private var listener: OnMyItemClickListener? = null
|
||||
fun setOnMyItemClickListener(listener: OnMyItemClickListener?): MessagePop {
|
||||
this.listener = listener
|
||||
return this
|
||||
}
|
||||
|
||||
interface OnMyItemClickListener {
|
||||
fun onItemClick(startTime: String, endTime: String)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user