From dd3beea20e5b2c99310d36b0f156bce95fda74a9 Mon Sep 17 00:00:00 2001 From: yezhiqiu <983577727@qq.com> Date: Fri, 9 Jan 2026 10:40:08 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=A5=97=E9=A4=90=E5=90=8D=E5=AD=97=E5=8E=BB?= =?UTF-8?q?=E6=8E=89Premium=E6=98=BE=E7=A4=BA=202.=E5=A5=97=E9=A4=90?= =?UTF-8?q?=E4=BB=B7=E6=A0=BC=E6=98=BE=E7=A4=BA=E4=BF=9D=E7=95=992?= =?UTF-8?q?=E4=BD=8D=E5=B0=8F=E6=95=B0=E7=82=B9=203.=E8=A7=A3=E7=BB=91?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=97=B6=EF=BC=8C=E6=9C=89=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E8=93=9D=E7=89=99=E4=BC=9A=E5=8F=91=E9=80=81=E6=B8=85=E9=99=A4?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AB=AF=E6=95=B0=E6=8D=AE=E6=8C=87=E4=BB=A4?= =?UTF-8?q?=EF=BC=9A=200x1A=E6=B6=88=E6=81=AF=EF=BC=8C=E9=A9=B1=E5=8A=A8?= =?UTF-8?q?=20Tracker=20=E6=8A=8A=E7=8A=B6=E6=80=81=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=B8=BA:2.=E5=87=BA=E5=8E=82=E7=8A=B6=E6=80=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/deploymentTargetSelector.xml | 3 - app/build.gradle | 6 +- .../tracker/adapter/ChoosePlanAdapter.kt | 4 +- .../tracker/adapter/MySubscriptionAdapter.kt | 3 +- .../adapter/SubscriptionHistoryAdapter.kt | 2 +- .../activity/device/DeleteTracker1Activity.kt | 26 ++- .../tracker/ui/activity/map/LiveActivityV3.kt | 1 - .../subscribe/SubscriptionHistoryActivity.kt | 10 +- .../subscribe/SureSubscriptionPlanActivity.kt | 163 +++--------------- .../tracker/ui/fragment/map/MapV3Fragment.kt | 11 +- app/src/main/res/values/strings.xml | 1 + 11 files changed, 61 insertions(+), 169 deletions(-) diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml index 58cd886..713138f 100644 --- a/.idea/deploymentTargetSelector.xml +++ b/.idea/deploymentTargetSelector.xml @@ -13,9 +13,6 @@ - - \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index d883191..a36cc4d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -28,9 +28,9 @@ android { applicationId "com.abbidot.tracker" minSdkVersion 23 targetSdkVersion 35 - versionCode 2102 -// versionName "2.1.2" - versionName "2.1.2-Beta1" + versionCode 2103 +// versionName "2.1.3" + versionName "2.1.3-Beta1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/src/main/java/com/abbidot/tracker/adapter/ChoosePlanAdapter.kt b/app/src/main/java/com/abbidot/tracker/adapter/ChoosePlanAdapter.kt index e93d84c..0d8cc95 100644 --- a/app/src/main/java/com/abbidot/tracker/adapter/ChoosePlanAdapter.kt +++ b/app/src/main/java/com/abbidot/tracker/adapter/ChoosePlanAdapter.kt @@ -35,12 +35,12 @@ class ChoosePlanAdapter( getTextView(R.id.tv_choose_plan_item_money).apply { text = String.format( mContext.getString(R.string.txt_money_unit), - Utils.formatDecimal(item.planPrice / item.planTimeMonthsCount, 1) + Utils.formatDecimal(item.planPrice / item.planTimeMonthsCount, 2) ) } getTextView(R.id.tv_choose_plan_item_plan_money).text = String.format( - mContext.getString(R.string.txt_money_unit), "${item.planPrice}" + mContext.getString(R.string.txt_money_unit), Utils.formatDecimal(item.planPrice, 2) ) getTextView(R.id.tv_choose_plan_item_unit).text = diff --git a/app/src/main/java/com/abbidot/tracker/adapter/MySubscriptionAdapter.kt b/app/src/main/java/com/abbidot/tracker/adapter/MySubscriptionAdapter.kt index 7f08398..3710b28 100644 --- a/app/src/main/java/com/abbidot/tracker/adapter/MySubscriptionAdapter.kt +++ b/app/src/main/java/com/abbidot/tracker/adapter/MySubscriptionAdapter.kt @@ -43,7 +43,8 @@ class MySubscriptionAdapter( holder: RecyclerViewHolder?, position: Int, item: SubscriptionsOrderBean ) { holder!!.setText(R.id.tv_my_subscription_device_out_id, item.deviceOutId) - holder.setText(R.id.tv_my_subscription_plan_name, "${item.mealName}(${item.planCategory})") +// holder.setText(R.id.tv_my_subscription_plan_name, "${item.mealName}(${item.planCategory})") + holder.setText(R.id.tv_my_subscription_plan_name, item.mealName) holder.getTextView(R.id.tv_my_subscription_auto_subscription_tips).apply { visibility = if (item.subscriptionStatus == ConstantInt.Open) { text = if (item.mealUnit == ConstantString.PackageUnitYear) String.format( diff --git a/app/src/main/java/com/abbidot/tracker/adapter/SubscriptionHistoryAdapter.kt b/app/src/main/java/com/abbidot/tracker/adapter/SubscriptionHistoryAdapter.kt index ce42394..8ac6e71 100644 --- a/app/src/main/java/com/abbidot/tracker/adapter/SubscriptionHistoryAdapter.kt +++ b/app/src/main/java/com/abbidot/tracker/adapter/SubscriptionHistoryAdapter.kt @@ -64,7 +64,7 @@ class SubscriptionHistoryAdapter( ) //保险时长,不足一年按12个月算 val insuranceTime = - if (item.planTimeMonthsCount > 12) item.mealPeriod else 1 + if (item.mealUnit == ConstantString.PackageUnitYear) item.mealPeriod else 1 holder.setText( R.id.tv_subscription_annual_care_expiry_time, Utils.formatTime( Utils.getAfterHowTimestamp( diff --git a/app/src/main/java/com/abbidot/tracker/ui/activity/device/DeleteTracker1Activity.kt b/app/src/main/java/com/abbidot/tracker/ui/activity/device/DeleteTracker1Activity.kt index 9951c2a..5085e95 100644 --- a/app/src/main/java/com/abbidot/tracker/ui/activity/device/DeleteTracker1Activity.kt +++ b/app/src/main/java/com/abbidot/tracker/ui/activity/device/DeleteTracker1Activity.kt @@ -13,6 +13,7 @@ import com.abbidot.tracker.R import com.abbidot.tracker.base.BaseActivity import com.abbidot.tracker.base.BaseDialog import com.abbidot.tracker.bean.DeviceBean +import com.abbidot.tracker.bean.ReceiveDeviceData import com.abbidot.tracker.constant.ConstantInt import com.abbidot.tracker.constant.ConstantString import com.abbidot.tracker.constant.GetResultCallback @@ -21,6 +22,7 @@ import com.abbidot.tracker.databinding.ActivityDeleteTracker1Binding import com.abbidot.tracker.dialog.CommonDialog1 import com.abbidot.tracker.util.Util import com.abbidot.tracker.util.ViewUtil +import com.abbidot.tracker.util.bluetooth.SRBleCmdUtil import com.abbidot.tracker.util.bluetooth.SRBleUtil import com.abbidot.tracker.vm.TrackerSetViewModel import kotlinx.coroutines.Dispatchers @@ -62,7 +64,16 @@ class DeleteTracker1Activity : lifecycleScope.launch { withContext(Dispatchers.IO) { mDeviceBean?.let { device -> - SRBleUtil.instance.disconnectToMac(device.macId) + //是否连接了蓝牙 + if (SRBleUtil.instance.isMacConnect(device.macId)) { + SRBleUtil.instance.getConnectMacDevice(device.macId) + ?.let { ble -> + SRBleUtil.instance.writeData( + ble.bleDevice, + SRBleCmdUtil.instance.setWorkingStatus(status = 2) + ) + } + } //删除设备成功后,把本地数据库中的设备也删除 MyDatabase.deviceDao().deleteByParams( ConstantString.DeviceId, @@ -83,6 +94,19 @@ class DeleteTracker1Activity : } }) } + //接收蓝牙返回数据 + XEventBus.observe(this, EventName.DeviceReceiveData) { receiveData: ReceiveDeviceData -> + mDeviceBean?.apply { + if (macId == receiveData.mac) { + receiveData.data?.let { + val data0 = SRBleCmdUtil.instance.byteToInt(it[0]) + if (data0 == 0x1A) { + SRBleUtil.instance.disconnectToMac(macId) + } + } + } + } + } } private fun showDeleteDialog() { diff --git a/app/src/main/java/com/abbidot/tracker/ui/activity/map/LiveActivityV3.kt b/app/src/main/java/com/abbidot/tracker/ui/activity/map/LiveActivityV3.kt index a3cd1b1..9e8fafe 100644 --- a/app/src/main/java/com/abbidot/tracker/ui/activity/map/LiveActivityV3.kt +++ b/app/src/main/java/com/abbidot/tracker/ui/activity/map/LiveActivityV3.kt @@ -1040,7 +1040,6 @@ class LiveActivityV3 : BaseActivity(ActivityLiveV3Binding } LogUtil.e("音量减小--,$volume") } - KeyEvent.KEYCODE_VOLUME_UP -> { LogUtil.e("音量增加++") if (!isOpenSound) { diff --git a/app/src/main/java/com/abbidot/tracker/ui/activity/subscribe/SubscriptionHistoryActivity.kt b/app/src/main/java/com/abbidot/tracker/ui/activity/subscribe/SubscriptionHistoryActivity.kt index ff939e9..66e234f 100644 --- a/app/src/main/java/com/abbidot/tracker/ui/activity/subscribe/SubscriptionHistoryActivity.kt +++ b/app/src/main/java/com/abbidot/tracker/ui/activity/subscribe/SubscriptionHistoryActivity.kt @@ -68,15 +68,7 @@ class SubscriptionHistoryActivity : for (l in list) { mSubscriptionsOrderList.add(l) if (l.annualCareType == ConstantInt.Type1) { - val subscriptionsOrder = SubscriptionsOrderBean(MultipleEntity.IMG) - subscriptionsOrder.orderNum = l.orderNum - subscriptionsOrder.createTime = l.createTime - subscriptionsOrder.enabled = l.enabled - subscriptionsOrder.surplusDays = l.surplusDays - subscriptionsOrder.subscriptionStatus = l.subscriptionStatus - subscriptionsOrder.mealPeriod = l.mealPeriod - subscriptionsOrder.annualCareType = l.annualCareType - subscriptionsOrder.annualCarePrice = l.annualCarePrice + val subscriptionsOrder = l.copy(menuType = MultipleEntity.IMG) mSubscriptionsOrderList.add(subscriptionsOrder) } } diff --git a/app/src/main/java/com/abbidot/tracker/ui/activity/subscribe/SureSubscriptionPlanActivity.kt b/app/src/main/java/com/abbidot/tracker/ui/activity/subscribe/SureSubscriptionPlanActivity.kt index c8eb714..f68c608 100644 --- a/app/src/main/java/com/abbidot/tracker/ui/activity/subscribe/SureSubscriptionPlanActivity.kt +++ b/app/src/main/java/com/abbidot/tracker/ui/activity/subscribe/SureSubscriptionPlanActivity.kt @@ -109,125 +109,6 @@ class SureSubscriptionPlanActivity : bottom = AppUtils.dpToPx(4) ) -// mOrderBean?.let { -// ilSubscribePlanDetail.tvSureSubscribePlanDeviceId.text = it.deviceOutId -// val nowTimestamp = System.currentTimeMillis() -// -// mPackageBean?.let { p -> -// ilSubscribePlanDetail.tvSureSubscribePlanPer.text = String.format( -// getString(R.string.txt_month_unit), "${p.planTimeMonthsCount}" -// ) -// val renewalString = if (p.mealUnit == ConstantString.PackageUnitYear) { -//// ilSubscribePlanDetail.tvSureSubscribePlanPer.text = -//// String.format(getString(R.string.txt_year_unit), p.period) -// val renewalTimestamp = -// Utils.getAfterHowTimestamp(nowTimestamp, p.period * 365L) -// val renewalDate = -// Utils.formatTime(renewalTimestamp, Utils.DATE_FORMAT_PATTERN_EN7) -// if (p.period > 1) { -// String.format( -// getString(R.string.txt_renewal_years), -// "${p.autoRenewPrice}", -// "${p.period}", -// renewalDate -// ) -// } else { -// String.format( -// getString(R.string.txt_renewal_year), -// "${p.autoRenewPrice}", -// renewalDate -// ) -// } -// } else { -// val renewalTimestamp = -// Utils.getAfterHowTimestamp(nowTimestamp, 30L * p.planTimeMonthsCount) -// val renewalDate = -// Utils.formatTime(renewalTimestamp, Utils.DATE_FORMAT_PATTERN_EN7) -// if (p.planTimeMonthsCount > 1) { -// String.format( -// getString(R.string.txt_renewal_months), -// "${p.autoRenewPrice}", -// "${p.planTimeMonthsCount}", -// renewalDate -// ) -// } else { -// String.format( -// getString(R.string.txt_renewal_month), -// "${p.autoRenewPrice}", -// renewalDate -// ) -// } -// } -// ilSubscribePlanDetail.tvSureSubscribePlanUnderused.text = renewalString -// ilSubscribePlanDetail.tvSureSubscribePlanMoneySum.text = String.format( -// getString(R.string.txt_money_unit), "${p.autoRenewPrice}" -// ) -// -// val packageName = "${p.planName}(${p.planCategory})" -// ilSubscribePlanDetail.tvSureSubscribePlanName.text = packageName -// val price = p.planPrice -//// val price = if (p.discountedPrice > 0.0) p.discountedPrice else p.planPrice -// val priceString = String.format( -// getString(R.string.txt_money_unit), -// Utils.formatDecimal(price / p.planTimeMonthsCount, 1) -// ) -// ilSubscribePlanDetail.tvSureSubscribePlanMoney.text = priceString -// -// ViewUtil.instance.addMenuBean( -// mSummaryAdapter.getData(), -// p.planName, -// "$price", -// colorRedId = R.color.data_black_color -// ) -// mTotalMoney += price -// mSumInsuranceMoney = -// Utils.formatDecimal(p.everyMonthSafeFee * p.period * 12, 1).toDouble() -// ViewUtil.instance.addMenuBean( -// mSummaryAdapter.getData(), -// getString(R.string.txt_annual_care_text), -// "$mSumInsuranceMoney", -// colorRedId = R.color.data_black_color -// ) -// mTotalMoney += mSumInsuranceMoney -// -// val insuranceMoneyString = -// String.format(getString(R.string.txt_month_unit), "${p.period * 12}") -// ilSubscribePlanInsurance.tvSureSubscribePlanInsurancePer.text = -// insuranceMoneyString -// ilSubscribePlanInsurance.tvSureSubscribePlanInsurancePerMoney.text = -// String.format(getString(R.string.txt_money_unit), "${p.everyMonthSafeFee}") -// ilSubscribePlanInsurance.tvSureSubscribePlanInsuranceMoney.text = -// String.format(getString(R.string.txt_money_unit), "$mSumInsuranceMoney") -// -// if (isUpgrade) { -// mTotalMoney -= mResidualMoney -// ViewUtil.instance.addMenuBean( -// mSummaryAdapter.getData(), -// getString(R.string.txt_residual_value), -// Utils.formatDecimal(mResidualMoney, 1), -// colorRedId = R.color.red_color5, -// isSwitch = true -// ) -// } -// ViewUtil.instance.addMenuBean( -// mSummaryAdapter.getData(), -// getString(R.string.txt_sales_tax), -// "0", -// colorRedId = R.color.data_black_color -// ) -// } -// -// //判断套餐是否过期 -// if (!TextUtils.isEmpty(it.orderNum) && it.surplusDays == 0L && it.subscriptionStatus == ConstantInt.Close) { -// mOrderBean?.reactivation = 1 -// mSubscriptionViewModel.getReactivationFee(it.orderNum) -// } else { -// mOrderBean?.reactivation = 0 -// mOrderBean?.reactivatePrice = 0.0 -// updateMoney() -// } -// } - //添加下划线 ilSubscribePlanDetail.tvSureSubscribePlanTermsConditions.paint.flags = Paint.UNDERLINE_TEXT_FLAG @@ -297,6 +178,7 @@ class SureSubscriptionPlanActivity : val nowTimestamp = System.currentTimeMillis() mPackageBean?.let { p -> + val autoRenewPrice = Utils.formatDecimal(p.autoRenewPrice, 2) ilSubscribePlanDetail.tvSureSubscribePlanPer.text = if (p.mealUnit == ConstantString.PackageUnitDay) String.format( getString(R.string.txt_day_unit), "${p.planTimeMonthsCount}" @@ -312,15 +194,13 @@ class SureSubscriptionPlanActivity : if (p.planTimeMonthsCount > 12) { String.format( getString(R.string.txt_renewal_years), - "${p.autoRenewPrice}", + autoRenewPrice, "${p.period}", renewalDate ) } else { String.format( - getString(R.string.txt_renewal_year), - "${p.autoRenewPrice}", - renewalDate + getString(R.string.txt_renewal_year), autoRenewPrice, renewalDate ) } } else if (p.mealUnit == ConstantString.PackageUnitDay) { @@ -330,7 +210,7 @@ class SureSubscriptionPlanActivity : Utils.formatTime(renewalTimestamp, Utils.DATE_FORMAT_PATTERN_EN7) String.format( getString(R.string.txt_renewal_day), - "${p.autoRenewPrice}", + autoRenewPrice, "${p.period}", renewalDate ) @@ -342,30 +222,27 @@ class SureSubscriptionPlanActivity : if (p.planTimeMonthsCount > 1) { String.format( getString(R.string.txt_renewal_months), - "${p.autoRenewPrice}", + autoRenewPrice, "${p.planTimeMonthsCount}", renewalDate ) } else { String.format( - getString(R.string.txt_renewal_month), - "${p.autoRenewPrice}", - renewalDate + getString(R.string.txt_renewal_month), autoRenewPrice, renewalDate ) } } ilSubscribePlanDetail.tvSureSubscribePlanUnderused.text = renewalString - ilSubscribePlanDetail.tvSureSubscribePlanMoneySum.text = String.format( - getString(R.string.txt_money_unit), "${p.autoRenewPrice}" - ) + ilSubscribePlanDetail.tvSureSubscribePlanMoneySum.text = + String.format(getString(R.string.txt_money_unit), autoRenewPrice) - val packageName = "${p.planName}(${p.planCategory})" - ilSubscribePlanDetail.tvSureSubscribePlanName.text = packageName +// val packageName = "${p.planName}(${p.planCategory})" + ilSubscribePlanDetail.tvSureSubscribePlanName.text = p.planName val price = p.planPrice // val price = if (p.discountedPrice > 0.0) p.discountedPrice else p.planPrice val priceString = String.format( getString(R.string.txt_money_unit), - Utils.formatDecimal(price / p.planTimeMonthsCount, 1) + Utils.formatDecimal(price / p.planTimeMonthsCount, 2) ) ilSubscribePlanDetail.tvSureSubscribePlanMoney.text = priceString @@ -380,7 +257,7 @@ class SureSubscriptionPlanActivity : val insuranceTime = if (p.planTimeMonthsCount > 12) p.planTimeMonthsCount else 12 mSumInsuranceMoney = - Utils.formatDecimal(p.everyMonthSafeFee * insuranceTime, 1).toDouble() + Utils.formatDecimal(p.everyMonthSafeFee * insuranceTime, 2).toDouble() ViewUtil.instance.addMenuBean( mSummaryAdapter.getData(), getString(R.string.txt_annual_care_text), @@ -403,7 +280,7 @@ class SureSubscriptionPlanActivity : ViewUtil.instance.addMenuBean( mSummaryAdapter.getData(), getString(R.string.txt_residual_value), - Utils.formatDecimal(mResidualMoney, 1), + Utils.formatDecimal(mResidualMoney, 2), colorRedId = R.color.red_color5, isSwitch = true ) @@ -471,7 +348,7 @@ class SureSubscriptionPlanActivity : //升级套餐,把之前剩余保险费退还,再重新买1年的保险 mTotalMoney -= surplusSafeValidFee mResidualMoney = Utils.formatDecimal( - mResidualMoney + surplusSafeValidFee, 1 + mResidualMoney + surplusSafeValidFee, 2 ).toDouble() val insuranceTime = if (p.planTimeMonthsCount > 12) p.planTimeMonthsCount else 12 @@ -481,7 +358,7 @@ class SureSubscriptionPlanActivity : mViewBinding.ilSubscribePlanInsurance.tvSureSubscribePlanInsurancePer.text = insuranceMoneyString mSumInsuranceMoney = - Utils.formatDecimal(p.everyMonthSafeFee * insuranceTime, 1) + Utils.formatDecimal(p.everyMonthSafeFee * insuranceTime, 2) .toDouble() mTotalMoney += mSumInsuranceMoney mViewBinding.ilSubscribePlanInsurance.tvSureSubscribePlanInsuranceMoney.text = @@ -501,7 +378,7 @@ class SureSubscriptionPlanActivity : mViewBinding.ilSubscribePlanInsurance.tvSureSubscribePlanInsurancePer.text = insuranceMoneyString mSumInsuranceMoney = Utils.formatDecimal( - howSafeValidMonths * p.everyMonthSafeFee, 1 + howSafeValidMonths * p.everyMonthSafeFee, 2 ).toDouble() mTotalMoney += mSumInsuranceMoney mViewBinding.ilSubscribePlanInsurance.tvSureSubscribePlanInsuranceMoney.text = @@ -547,14 +424,14 @@ class SureSubscriptionPlanActivity : private fun updateMoney() { mViewBinding.apply { val list = mSummaryAdapter.getData() - val taxMoney = abs(Utils.formatDecimal(mTaxRate * mTotalMoney, 1).toDouble()) + val taxMoney = abs(Utils.formatDecimal(mTaxRate * mTotalMoney, 2).toDouble()) mOrderBean?.tax = taxMoney list[list.size - 1].menuValue = taxMoney.toString() mTotalWithTaxMoney = taxMoney + mTotalMoney mTotalWithTaxMoney = abs(mTotalWithTaxMoney) ilSubscribePlanSummary.ilSureSubscribePlanTotalLayout.tvSubscribeSummaryItemMoney.text = String.format( - getString(R.string.txt_money_unit), Utils.formatDecimal(mTotalWithTaxMoney, 1) + getString(R.string.txt_money_unit), Utils.formatDecimal(mTotalWithTaxMoney, 2) ) mSummaryAdapter.notifyItemRangeChanged(0, list.size) @@ -591,13 +468,13 @@ class SureSubscriptionPlanActivity : mealUnit = cPlan.mealUnit planCategory = cPlan.planCategory autoRenewPrice = - Utils.formatDecimal(cPlan.autoRenewPrice + cPlan.autoRenewPrice * mTaxRate, 1) + Utils.formatDecimal(cPlan.autoRenewPrice + cPlan.autoRenewPrice * mTaxRate, 2) .toDouble() // autoRenewPrice = cPlan.autoRenewPrice mealDesc = mViewBinding.ilSubscribePlanDetail.tvSureSubscribePlanMoney.text.toString() + mViewBinding.ilSubscribePlanDetail.tvSureSubscribePlanPer.text.toString() } - totalAmountWithTax = Utils.formatDecimal(mTotalWithTaxMoney, 1).toDouble() + totalAmountWithTax = Utils.formatDecimal(mTotalWithTaxMoney, 2).toDouble() Intent(mContext, PaymentMethodActivity::class.java).let { it.putExtra(ConstantString.LkSetMeal, this) it.putExtra(ConstantString.RechargeType, mRechargeType) diff --git a/app/src/main/java/com/abbidot/tracker/ui/fragment/map/MapV3Fragment.kt b/app/src/main/java/com/abbidot/tracker/ui/fragment/map/MapV3Fragment.kt index 99eead3..e96ceb2 100644 --- a/app/src/main/java/com/abbidot/tracker/ui/fragment/map/MapV3Fragment.kt +++ b/app/src/main/java/com/abbidot/tracker/ui/fragment/map/MapV3Fragment.kt @@ -354,9 +354,6 @@ class MapV3Fragment : BaseFragment(FragmentMapV3Binding::i } } - private val mPermissionsTips = - "ABBIDOT APP collects location data,The route and distance between the current location and the device can be calculated." - /** * 弹窗说明需要位置权限做什么,上架市场需要 */ @@ -371,13 +368,17 @@ class MapV3Fragment : BaseFragment(FragmentMapV3Binding::i if (type == 0) checkPermissions(type) } else { ViewUtil.instance.showDialog( - mContext!!, mPermissionsTips, object : BaseDialog.OnDialogOkListener { + mContext!!, + getString(R.string.txt_location_tip), + object : BaseDialog.OnDialogOkListener { override fun onOkClick(dialog: BaseDialog<*>) { dialog.dismiss() if (type == 0) checkPermissions(type) else Util.checkLocationPermissionsGpsEnabled(mContext!!, {}) } - }, okTextResId = R.string.txt_accept, cancelTextResId = R.string.txt_deny + }, + okTextResId = R.string.txt_accept, + cancelTextResId = R.string.txt_deny ) } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8985ac2..ff808af 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1060,6 +1060,7 @@ /day Renewal: $%s/%s day on %s /day x%s + "ABBIDOT APP collects location data,The route and distance between the current location and the device can be calculated." (Renew at $%s per %s day thereafter) \ No newline at end of file