liugl
2020-09-25 95231bd94b71c9c6435110cf6489761eaf75daed
app/src/main/java/com/okgoincar/slab/SlabMainActivity.kt
@@ -106,7 +106,7 @@
                callVersion()
            }
        }else{
            toast("无网络")
            showNoneNetDialog()
        }
    }
@@ -124,6 +124,15 @@
    override fun onResume() {
        super.onResume()
        showNoneNetDialog()
        try {
            mainFragment?.refresh()
        }catch (e:Exception){
        }
    }
    fun showNoneNetDialog(){
        if (!NetUtils.isNetworkConnected(this)){
            popup = getSlabDelAndSurePopWindow(this,"刷新","取消","网络不通畅,是否刷新页面?",{}){
                if (!NetUtils.isNetworkConnected(this)){
@@ -137,12 +146,6 @@
                popup?.showCenter(window.decorView)
            }
        }
        try {
            mainFragment?.refresh()
        }catch (e:Exception){
        }
    }
    fun getSlabDelAndSurePopWindow(context: Context,sureStr:String,cancelStr:String,content:String,clickClose :() -> Unit,clickSure:() -> Unit): EasyPopup {