From: TrillGates Date: Tue, 13 Jul 2021 11:23:11 +0000 (+0800) Subject: merge files. X-Git-Url: http://git.snicker.com.cn/sitemap.xml?a=commitdiff_plain;h=632eb129182260992c73b159bca94d1883c5faff;p=icfotaclient.git merge files. --- 632eb129182260992c73b159bca94d1883c5faff diff --cc app/FotaBrand8521e/release/FotaBrand8521e_V1_202107131922_release.apk index 0000000,0000000..6cf22a3 new file mode 100644 Binary files differ diff --cc app/FotaBrand8521e/release/output-metadata.json index 29db7b3,aac2068..4cdb665 --- a/app/FotaBrand8521e/release/output-metadata.json +++ b/app/FotaBrand8521e/release/output-metadata.json @@@ -12,7 -12,7 +12,7 @@@ "filters": [], "versionCode": 1, "versionName": "1.0", - "outputFile": "FotaBrand8521e_V1_202106281712_release.apk" - "outputFile": "FotaBrand8541e_V1_202103181928_release.apk" ++ "outputFile": "FotaBrand8521e_V1_202107131922_release.apk" } ] } diff --cc app/src/main/java/com/ic/icfotaclient/view/SystemUpdateActivity.kt index 446d52e,cf26a72..74b70fc --- a/app/src/main/java/com/ic/icfotaclient/view/SystemUpdateActivity.kt +++ b/app/src/main/java/com/ic/icfotaclient/view/SystemUpdateActivity.kt @@@ -18,18 -24,45 +24,39 @@@ class SystemUpdateActivity : AppCompatA override fun onBackPressed() { //不让退出了哇 - val checkNetWork = OtaViewModelCreator.getOtaViewModel(null)?.checkNetWork() - /**val checkNetWork = OtaViewModelCreator.getOtaViewModel(null)?.checkNetWork() -- val currentActionState = OtaViewModelCreator.getOtaViewModel(null)?.currentActionState -- val tipsWifiConnect = OtaViewModelCreator.getOtaViewModel(null)?.isTipsWifiConnect - if (checkNetWork != true || - currentActionState?.value == UpdateActionState.LAST_VERSION || - currentActionState?.value == UpdateActionState.BATTERY_LEVEL_NOT_ENOUGH - || tipsWifiConnect?.value == true - ) { - if (checkNetWork != true || currentActionState?.value == UpdateActionState.LAST_VERSION || tipsWifiConnect?.value == true) { -- super.onBackPressed() - }*/ + createNewVersionDialog() + } + + private fun createNewVersionDialog() { + val manager = App.sContext.getSystemService(Context.WINDOW_SERVICE) as WindowManager + val layoutParams = WindowManager.LayoutParams() + layoutParams.gravity = Gravity.CENTER + layoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT + val screenWidth = windowManager.defaultDisplay.width + layoutParams.width = screenWidth - 40; + layoutParams.height = WindowManager.LayoutParams.WRAP_CONTENT + layoutParams.alpha = 1.0f + layoutParams.packageName = App.sContext.getPackageName() + layoutParams.buttonBrightness = 1f + layoutParams.windowAnimations = android.R.style.Animation_Dialog + + val view: View = View.inflate(App.sContext, R.layout.dialog_tips, null) + + val descText: TextView = view.findViewById(R.id.description) + val titleText: TextView = view.findViewById(R.id.notify) + titleText.text = view.context.getString(R.string.update_tips_title_text) + descText.text = view.context.getString(R.string.update_tips_exit_desc) + val yesButton: Button = view.findViewById(R.id.button_ok) as Button + val noButton: Button = view.findViewById(R.id.button_cancel) as Button + yesButton.setOnClickListener { + manager.removeView(view) + finish() } + noButton.setOnClickListener { manager.removeView(view) } + manager.addView(view, layoutParams) } + override fun onResume() { super.onResume() //检查一下网络更新