修改home键,dialog不消失问题
This commit is contained in:
@@ -7,9 +7,11 @@ import android.util.Log
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.widget.media.video.NoticeSimpleVideoPlayer
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener
|
||||
@@ -25,7 +27,7 @@ import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack
|
||||
* @brief 点击查看对话框
|
||||
* @author lixiaopeng
|
||||
*/
|
||||
class NoticeCheckDialog(context: Context) : BaseFloatDialog(context) {
|
||||
class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver{
|
||||
|
||||
private val TAG = "NoticeCheckDialog"
|
||||
private var pushCheckClose: ImageView? = null
|
||||
@@ -39,7 +41,7 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context) {
|
||||
private var mVideoUrl: String = ""
|
||||
private var playErrorImageView: ImageView? = null
|
||||
private var connectTextView: TextView? = null
|
||||
private val mServiceApis: IMogoServiceApis? = null
|
||||
private var mServiceApis: IMogoServiceApis? = null
|
||||
private val statusChangedListenerForCheckNotice = IMogoStatusChangedListener { descriptor, isTrue ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND) {
|
||||
dismiss()
|
||||
@@ -49,6 +51,7 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context) {
|
||||
init {
|
||||
setContentView(R.layout.notice_dialog_check_with_accessory)
|
||||
setCanceledOnTouchOutside(true)
|
||||
|
||||
pushCheckClose = findViewById(R.id.module_push_dialog_close)
|
||||
pushCheckTitle = findViewById(R.id.module_push_dialog_acc_title)
|
||||
pushCheckContent = findViewById(R.id.module_push_dialog_bottom_title)
|
||||
@@ -88,11 +91,9 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context) {
|
||||
pushVideo!!.visibility = View.VISIBLE
|
||||
playVideo(mVideoUrl)
|
||||
}
|
||||
mServiceApis?.statusManagerApi?.registerStatusChangedListener(
|
||||
TAG,
|
||||
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||
statusChangedListenerForCheckNotice
|
||||
)
|
||||
|
||||
mServiceApis = MogoApisHandler.getInstance().apis
|
||||
mServiceApis?.getStatusManagerApi()?.registerStatusChangedListener(TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForCheckNotice)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user