merge files.
authorTrillGates <williamtrillgates@gmail.com>
Tue, 13 Jul 2021 11:23:11 +0000 (19:23 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Tue, 13 Jul 2021 11:23:11 +0000 (19:23 +0800)
1  2 
app/FotaBrand8521e/release/FotaBrand8521e_V1_202107131922_release.apk
app/FotaBrand8521e/release/output-metadata.json
app/src/main/java/com/ic/icfotaclient/presenter/OtaViewModel.kt
app/src/main/java/com/ic/icfotaclient/view/SystemUpdateActivity.kt
app/src/main/res/values-en/strings.xml
app/src/main/res/values-zh-rCN/strings.xml
app/src/main/res/values/strings.xml

index 0000000,0000000..6cf22a3
new file mode 100644 (file)
Binary files differ
@@@ -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"
      }
    ]
  }
@@@ -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()
          //检查一下网络更新
Simple merge