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