From d2c92897e22b2c1992eceaef585f967a06b6ea84 Mon Sep 17 00:00:00 2001 From: liugl <liugl@sinata.cn> Date: 星期一, 02 十一月 2020 15:59:29 +0800 Subject: [PATCH] 11.30 首页列表添加 其他数据用来展示页面 不空 --- app/src/main/java/com/okgoincar/slab/SlabMainActivity.kt | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/com/okgoincar/slab/SlabMainActivity.kt b/app/src/main/java/com/okgoincar/slab/SlabMainActivity.kt index 92ef0e5..0132e2c 100644 --- a/app/src/main/java/com/okgoincar/slab/SlabMainActivity.kt +++ b/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 { @@ -374,16 +377,17 @@ if (bean.data.version != "" && bean.data.version != Utils.getAppVersion(this)) { if (bean.data.mandatory == 0) { var pop = - DialogUtil.getSlabDelAndSurePopWindow(this, "确定", "取消", "有新版本是否更新", {}) { + DialogUtil.getSlabDelAndSurePopWindow(true,this, "确定", "取消", "有新版本是否更新", {}) { DownloadUtil(this).downloadAPK(bean.data.url, "ok出行车载端") } pop.showCenter(window.decorView) } else { var pop = DialogUtil.getSlabDelAndSurePopWindow( + false, this, "确定", "取消", - "版本已过时,是否强制升级?", + "版本已过时,强制升级!", {}) { DownloadUtil(this).downloadAPK(bean.data.url, "ok出行车载端") toast("后台开始下载,请等待") -- Gitblit v1.7.1