river-lucky-driver/app/src/main/java/com/arpa/hndahesudintocctmsdriver/cuspop/TopMsgPopup.kt
2024-11-28 08:26:45 +08:00

40 lines
1.0 KiB
Kotlin

package com.arpa.hndahesudintocctmsdriver.cuspop
import android.content.Context
import android.view.View
import android.widget.TextView
import com.arpa.hndahesudintocctmsdriver.R
import com.lxj.xpopup.core.PositionPopupView
import com.lxj.xpopup.enums.DragOrientation
/**
* Description: 自定义自由定位Position弹窗
* Create by dance, at 2019/6/14
*/
class TopMsgPopup(context: Context,title:String, message: String) : PositionPopupView(context) {
private var message: String
private var title: String
init {
this.message = message
this.title = title
}
override fun getImplLayoutId(): Int {
return R.layout.popup_qq_msg
}
override fun getDragOrientation(): DragOrientation {
return DragOrientation.DragToLeft
}
override fun onCreate() {
super.onCreate()
val tvMessage = findViewById<View>(R.id.tvMessage) as TextView
val tvTitle = findViewById<View>(R.id.tvTitle) as TextView
tvMessage.text = message
tvTitle.text = title
}
}