|
@@ -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()
|