瀏覽代碼

提交人:江天明
提交内容:优化

江天明 11 月之前
父節點
當前提交
df39d04313

+ 9 - 3
BusinessSetting/src/main/java/com/develop/setting/init/ui/AboutActivity.kt

@@ -70,6 +70,8 @@ class AboutActivity : BaseActivity<ActivityAboutBinding>() {
 
     private var weight = false;
 
+    private var isUpdate = false
+
     //退出称重校准
     fun exitWeightAlign() {
         CofarSDK.stoptWeightAlign()
@@ -289,7 +291,6 @@ class AboutActivity : BaseActivity<ActivityAboutBinding>() {
 
             weightAlignCount++
             if (weightAlignCount >= 7) {
-                weight = true;
                 weightAlignCount = 0
 
                 val ctx = this
@@ -304,7 +305,6 @@ class AboutActivity : BaseActivity<ActivityAboutBinding>() {
                             var dailog = CancelConfirmDialog()
                             dailog.title = getString(R.string.change_lang_tips)
                             dailog.showCancel = false;
-
                             dailog.onDialogClickListener = object : CancelConfirmDialog.OnDialogClickListener {
                                 override fun onConfirm() {
 
@@ -318,6 +318,7 @@ class AboutActivity : BaseActivity<ActivityAboutBinding>() {
                                 dailog.showDialog(supportFragmentManager, "confirm")
                             } else {
 //                    CofarSDK.register(this)
+                                weight = true;
                                 //进入称重标定模式
                                 CofarSDK.startWeightAlign()
                             }
@@ -396,7 +397,11 @@ class AboutActivity : BaseActivity<ActivityAboutBinding>() {
             }
 
         binding.tvUpdate.setOnClickListener {
-            cancelConfirmDialog.showDialog(supportFragmentManager, "cancelConfirmDialog")
+            if (isUpdate){
+             GlobalToast.showToast(getString(com.develop.base.R.string.apk_version_latest))
+            } else {
+                cancelConfirmDialog.showDialog(supportFragmentManager, "cancelConfirmDialog")
+            }
         }
 
 
@@ -478,6 +483,7 @@ class AboutActivity : BaseActivity<ActivityAboutBinding>() {
         super.onResume()
         FoodRepository.devInfo().observeStatus(onSuccess = {
             updateApkUrl = it?.apkUrl ?: ""
+            isUpdate = it?.apkUpdate?:false
             if (it?.apkUpdate == true) {
 
                 binding.tvUpdate.performClick()

+ 1 - 1
libBase/src/main/res/values-de/strings.xml

@@ -248,6 +248,6 @@
     <string name="captcha_can_not_be_empty">Geben Sie den Code ein</string>
     <string name="please_fill_in_the_password">Sie müssen das Passwort eingeben</string>
     <string name="reset_password_success">Dein Passwort wurde geändert</string>
-
+    <string name="apk_version_latest">Die App-Version ist bereits auf dem neuesten Stand.</string>
 </resources>
 

+ 1 - 0
libBase/src/main/res/values/strings.xml

@@ -254,4 +254,5 @@ Nanfang plus client is an online information platform developed and operated by
     <string name="reset_password_success">Reset password success!</string>
     <string name="tuya">TUYA</string>
     <string name="cancel_tuya_bind">Cancel Bind</string>
+    <string name="apk_version_latest">The app version is already up to date.</string>
 </resources>