Browse Source

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

江天明 11 months ago
parent
commit
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 weight = false;
 
 
+    private var isUpdate = false
+
     //退出称重校准
     //退出称重校准
     fun exitWeightAlign() {
     fun exitWeightAlign() {
         CofarSDK.stoptWeightAlign()
         CofarSDK.stoptWeightAlign()
@@ -289,7 +291,6 @@ class AboutActivity : BaseActivity<ActivityAboutBinding>() {
 
 
             weightAlignCount++
             weightAlignCount++
             if (weightAlignCount >= 7) {
             if (weightAlignCount >= 7) {
-                weight = true;
                 weightAlignCount = 0
                 weightAlignCount = 0
 
 
                 val ctx = this
                 val ctx = this
@@ -304,7 +305,6 @@ class AboutActivity : BaseActivity<ActivityAboutBinding>() {
                             var dailog = CancelConfirmDialog()
                             var dailog = CancelConfirmDialog()
                             dailog.title = getString(R.string.change_lang_tips)
                             dailog.title = getString(R.string.change_lang_tips)
                             dailog.showCancel = false;
                             dailog.showCancel = false;
-
                             dailog.onDialogClickListener = object : CancelConfirmDialog.OnDialogClickListener {
                             dailog.onDialogClickListener = object : CancelConfirmDialog.OnDialogClickListener {
                                 override fun onConfirm() {
                                 override fun onConfirm() {
 
 
@@ -318,6 +318,7 @@ class AboutActivity : BaseActivity<ActivityAboutBinding>() {
                                 dailog.showDialog(supportFragmentManager, "confirm")
                                 dailog.showDialog(supportFragmentManager, "confirm")
                             } else {
                             } else {
 //                    CofarSDK.register(this)
 //                    CofarSDK.register(this)
+                                weight = true;
                                 //进入称重标定模式
                                 //进入称重标定模式
                                 CofarSDK.startWeightAlign()
                                 CofarSDK.startWeightAlign()
                             }
                             }
@@ -396,7 +397,11 @@ class AboutActivity : BaseActivity<ActivityAboutBinding>() {
             }
             }
 
 
         binding.tvUpdate.setOnClickListener {
         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()
         super.onResume()
         FoodRepository.devInfo().observeStatus(onSuccess = {
         FoodRepository.devInfo().observeStatus(onSuccess = {
             updateApkUrl = it?.apkUrl ?: ""
             updateApkUrl = it?.apkUrl ?: ""
+            isUpdate = it?.apkUpdate?:false
             if (it?.apkUpdate == true) {
             if (it?.apkUpdate == true) {
 
 
                 binding.tvUpdate.performClick()
                 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="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="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="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>
 </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="reset_password_success">Reset password success!</string>
     <string name="tuya">TUYA</string>
     <string name="tuya">TUYA</string>
     <string name="cancel_tuya_bind">Cancel Bind</string>
     <string name="cancel_tuya_bind">Cancel Bind</string>
+    <string name="apk_version_latest">The app version is already up to date.</string>
 </resources>
 </resources>