|
|
@@ -5,6 +5,7 @@ import android.app.Service
|
|
|
import android.content.Intent
|
|
|
import android.os.IBinder
|
|
|
import android.view.WindowManager
|
|
|
+import com.jld.vod.config.Config
|
|
|
import com.jld.vod.model.bean.PositionAdvertBean
|
|
|
import com.jld.vod.utils.LogUtils
|
|
|
import com.jld.vod.view.widget.CustomAdDialog
|
|
|
@@ -30,7 +31,7 @@ class PositionAdvertService : Service() {
|
|
|
fun onReceive( positionAdvert :List<PositionAdvertBean>) {
|
|
|
LogUtils.logD("我收到了消息"+positionAdvert)
|
|
|
|
|
|
- if (mCustom == null)
|
|
|
+ if (mCustom == null && Config.isShowAd)
|
|
|
{
|
|
|
mCustom = CustomAdDialog(this)
|
|
|
mCustom!!.getWindow()!!.setType((WindowManager.LayoutParams.TYPE_SYSTEM_ALERT));
|
|
|
@@ -38,13 +39,13 @@ class PositionAdvertService : Service() {
|
|
|
mCustom!!.setCancelable(false)
|
|
|
mCustom!!.setCanceledOnTouchOutside(false)
|
|
|
mCustom!!.show()
|
|
|
+ mCustom!!.setOnClickBottomListener(object : CustomAdDialog.OnClickBottomListener{
|
|
|
+ override fun onBtnCloseClick() {
|
|
|
+ mCustom!!.dismiss()
|
|
|
+ mCustom = null
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- mCustom!!.setOnClickBottomListener(object : CustomAdDialog.OnClickBottomListener{
|
|
|
- override fun onBtnCloseClick() {
|
|
|
- mCustom!!.dismiss()
|
|
|
- mCustom = null
|
|
|
- }
|
|
|
- })
|
|
|
}
|
|
|
|
|
|
|