diff --git a/FastBleLib/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties b/FastBleLib/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties
index 313ae4d..38c4cd6 100644
--- a/FastBleLib/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties
+++ b/FastBleLib/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties
@@ -1 +1 @@
-#Fri Jul 31 17:44:57 CST 2026
+#Fri Aug 07 11:10:38 CST 2026
diff --git a/app/build.gradle b/app/build.gradle
index 4fb3570..5371b26 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -29,8 +29,8 @@ android {
minSdkVersion 24
targetSdkVersion 35
versionCode 2400
-// versionName "2.4.0"
- versionName "2.4.0-Beta1"
+ versionName "2.4.0"
+// versionName "2.4.0-Beta1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 78073e3..bb2f322 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -43,10 +43,9 @@
-
-
-
-
+
+
+
@@ -108,6 +107,9 @@
android:usesCleartextTraffic="true"
tools:replace="android:supportsRtl"
tools:targetApi="33">
+
@@ -187,7 +189,7 @@
android:exported="false"
android:screenOrientation="portrait" />
-
-
+ android:value="${CARD_RSA_KEY}" />
diff --git a/app/src/main/java/com/abbidot/tracker/ui/activity/SplashActivity.kt b/app/src/main/java/com/abbidot/tracker/ui/activity/SplashActivity.kt
index 97ddd1b..618cdf8 100644
--- a/app/src/main/java/com/abbidot/tracker/ui/activity/SplashActivity.kt
+++ b/app/src/main/java/com/abbidot/tracker/ui/activity/SplashActivity.kt
@@ -141,7 +141,7 @@ class SplashActivity : QMUIActivity() {
private fun Activity.overrideTransitionClose(enter: Int, exit: Int) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
- overrideActivityTransition(Activity.OVERRIDE_TRANSITION_CLOSE, enter, exit)
+ overrideActivityTransition(OVERRIDE_TRANSITION_CLOSE, enter, exit)
} else {
@Suppress("DEPRECATION")
overridePendingTransition(enter, exit)
diff --git a/app/src/main/java/com/abbidot/tracker/ui/activity/device/AddNewTracker2Activity.kt b/app/src/main/java/com/abbidot/tracker/ui/activity/device/AddNewTracker2Activity.kt
index 47ad217..883bfdb 100644
--- a/app/src/main/java/com/abbidot/tracker/ui/activity/device/AddNewTracker2Activity.kt
+++ b/app/src/main/java/com/abbidot/tracker/ui/activity/device/AddNewTracker2Activity.kt
@@ -91,13 +91,13 @@ class AddNewTracker2Activity :
}
private fun scanFinished() {
- if (againScan && mScanDeviceList.size == 0) {
+ if (againScan && mScanDeviceList.isEmpty()) {
againScan = false
LogUtil.e("没有扫描到设备,再次重试")
startScanBle()
return
}
- if (mScanDeviceList.size > 0) {
+ if (mScanDeviceList.isNotEmpty()) {
val intent = Intent(mContext, AddNewTracker3Activity::class.java)
intent.putParcelableArrayListExtra(ConstantString.DeviceInfo, mScanDeviceList)
intent.putExtra(ConstantString.isFirstBind, isFirstBind)
diff --git a/app/src/main/java/com/abbidot/tracker/ui/activity/device/AddNewTracker3Activity.kt b/app/src/main/java/com/abbidot/tracker/ui/activity/device/AddNewTracker3Activity.kt
index c86e364..bd229e8 100644
--- a/app/src/main/java/com/abbidot/tracker/ui/activity/device/AddNewTracker3Activity.kt
+++ b/app/src/main/java/com/abbidot/tracker/ui/activity/device/AddNewTracker3Activity.kt
@@ -99,6 +99,7 @@ class AddNewTracker3Activity :
mViewBinding.ivAddNewTracker3RefreshBtn.isEnabled = true
if (ble.conState == ConState.CONNECTED) {
setNoConnectState()
+ if (!isFrontRunning) return@observe
val intent = Intent(mContext, AddPairedSuccessActivity::class.java)
intent.putExtra(ConstantString.DeviceOutId, mDeviceOutId)
intent.putExtra(ConstantString.isFirstBind, isFirstBind)
@@ -153,7 +154,7 @@ class AddNewTracker3Activity :
private fun setNoConnectState() {
mScanDeviceAdapter.apply {
getData().let {
- if (it.size > 0) {
+ if (it.isNotEmpty()) {
isConnect = false
for (device in it) {
if (device.conState == ConState.CONNECTING) device.conState =
@@ -276,7 +277,7 @@ class AddNewTracker3Activity :
private fun scanFinished() {
mAnimatorSet?.cancel()
mViewBinding.ivAddNewTracker3RefreshBtn.isEnabled = true
- if (isFrontRunning && mScanDeviceAdapter.getData().size == 0) {
+ if (isFrontRunning && mScanDeviceAdapter.getData().isEmpty()) {
ViewUtil.instance.showDialog(
mContext,
R.string.txt_no_search_device,
diff --git a/app/src/main/java/com/abbidot/tracker/ui/activity/help/HelpCommonActivity.kt b/app/src/main/java/com/abbidot/tracker/ui/activity/help/HelpCommonActivity.kt
new file mode 100644
index 0000000..2f2ae7f
--- /dev/null
+++ b/app/src/main/java/com/abbidot/tracker/ui/activity/help/HelpCommonActivity.kt
@@ -0,0 +1,63 @@
+package com.abbidot.tracker.ui.activity.help
+
+import android.view.View
+import android.widget.LinearLayout
+import com.abbidot.baselibrary.util.AppUtils
+import com.abbidot.tracker.R
+import com.abbidot.tracker.base.BaseActivity
+import com.abbidot.tracker.constant.ConstantInt
+import com.abbidot.tracker.constant.ConstantString
+import com.abbidot.tracker.databinding.ActivityHelpCommonBinding
+
+class HelpCommonActivity :
+ BaseActivity(ActivityHelpCommonBinding::inflate) {
+
+ private var mType = ConstantInt.Type0
+
+ override fun getTopBar() = mViewBinding.ilHelpCommonBar.titleTopBar
+
+ override fun initData() {
+ super.initData()
+ intent.extras?.apply {
+ mType = getInt(ConstantString.Type, ConstantInt.Type0)
+ }
+ mViewBinding.apply {
+ when (mType) {
+
+ 1 -> {
+ setTopBarTitle(R.string.txt_sleep_mode)
+ setLeftBackImage(R.drawable.icon_white_back_svg)
+ ilHelpCommonTitle1.tvHelpTitleOne.setText(R.string.txt_sleep_mode_help)
+ val layoutManager =
+ ivHelpCommonImage.layoutParams as LinearLayout.LayoutParams
+ layoutManager.height = AppUtils.dpToPx(400)
+ ivHelpCommonImage.layoutParams = layoutManager
+ ivHelpCommonImage.setImageResource(R.drawable.help_sleep_mode)
+ }
+
+ 2 -> {
+ setTopBarTitle(R.string.txt_wifi_zone_home)
+ setLeftBackImage(R.drawable.icon_white_back_svg)
+ ilHelpCommonTitle1.tvHelpTitleOne.setText(R.string.txt_wifi_zone_home_help)
+ val layoutManager =
+ ivHelpCommonImage.layoutParams as LinearLayout.LayoutParams
+ layoutManager.height = AppUtils.dpToPx(450)
+ ivHelpCommonImage.layoutParams = layoutManager
+ ivHelpCommonImage.setImageResource(R.drawable.help_wifi_zone)
+ }
+
+ 3 -> {
+ setTopBarTitle(R.string.tracker_manage_set_duration)
+ setLeftBackImage(R.drawable.icon_white_back_svg)
+ ilHelpCommonTitle1.tvHelpTitleOne.setText(R.string.txt_gps_update_help)
+ val layoutManager =
+ ivHelpCommonImage.layoutParams as LinearLayout.LayoutParams
+ layoutManager.height = AppUtils.dpToPx(400)
+ ivHelpCommonImage.layoutParams = layoutManager
+ ivHelpCommonImage.setImageResource(R.drawable.help_gps_update)
+ llHelpCommonBoldLayout.visibility = View.VISIBLE
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/abbidot/tracker/ui/activity/help/HelpCreatePetFenceActivity.kt b/app/src/main/java/com/abbidot/tracker/ui/activity/help/HelpCreatePetFenceActivity.kt
index 4e6c56e..abbb136 100644
--- a/app/src/main/java/com/abbidot/tracker/ui/activity/help/HelpCreatePetFenceActivity.kt
+++ b/app/src/main/java/com/abbidot/tracker/ui/activity/help/HelpCreatePetFenceActivity.kt
@@ -1,12 +1,8 @@
package com.abbidot.tracker.ui.activity.help
import com.abbidot.tracker.R
-import com.abbidot.tracker.adapter.HelpTextImageTypeAdapter
import com.abbidot.tracker.base.BaseActivity
-import com.abbidot.tracker.bean.MenuTxtBean
-import com.abbidot.tracker.constant.MultipleEntity
import com.abbidot.tracker.databinding.ActivityHelpCreatePetFenceBinding
-import com.abbidot.tracker.util.ViewUtil
class HelpCreatePetFenceActivity :
BaseActivity(ActivityHelpCreatePetFenceBinding::inflate) {
@@ -18,50 +14,41 @@ class HelpCreatePetFenceActivity :
setTopBarTitle(R.string.txt_create_pet_fence)
setLeftBackImage(R.drawable.icon_white_back_svg)
- val menuList = mutableListOf()
- ViewUtil.instance.addMenuBean(
- menuList, getString(R.string.txt_create_fence_tip1), menuType = MultipleEntity.IMG_IMG
- )
- ViewUtil.instance.addMenuBean(
- menuList, "", imageResId = R.drawable.create_fence_help1, menuType = MultipleEntity.IMG
- )
- ViewUtil.instance.addMenuBean(
- menuList, getString(R.string.txt_set_fence_type)
- )
- ViewUtil.instance.addMenuBean(
- menuList, getString(R.string.txt_fence_type_help), menuType = MultipleEntity.IMG_IMG
- )
- ViewUtil.instance.addMenuBean(
- menuList, getString(R.string.txt_set_boundary)
- )
- ViewUtil.instance.addMenuBean(
- menuList, getString(R.string.txt_create_fence_tip2), menuType = MultipleEntity.IMG_IMG
- )
- ViewUtil.instance.addMenuBean(
- menuList, "", imageResId = R.drawable.create_fence_help2, menuType = MultipleEntity.IMG
- )
- ViewUtil.instance.addMenuBean(
- menuList, getString(R.string.txt_enable_set_notify)
- )
- ViewUtil.instance.addMenuBean(
- menuList, getString(R.string.txt_create_fence_tip3), menuType = MultipleEntity.IMG_IMG
- )
- ViewUtil.instance.addMenuBean(
- menuList, "", imageResId = R.drawable.create_fence_help4, menuType = MultipleEntity.IMG
- )
- ViewUtil.instance.addMenuBean(
- menuList, getString(R.string.txt_edit_delete_fence)
- )
+// val menuList = mutableListOf()
// ViewUtil.instance.addMenuBean(
-// menuList, getString(R.string.txt_create_fence_tip4), menuType = MultipleEntity.IMG_IMG
+// menuList, "", imageResId = R.drawable.create_fence_help1, menuType = MultipleEntity.IMG
+// )
+// ViewUtil.instance.addMenuBean(
+// menuList, getString(R.string.txt_set_fence_type)
+// )
+// ViewUtil.instance.addMenuBean(
+// menuList, getString(R.string.txt_fence_type_help), menuType = MultipleEntity.IMG_IMG
+// )
+// ViewUtil.instance.addMenuBean(
+// menuList, getString(R.string.txt_set_boundary)
+// )
+// ViewUtil.instance.addMenuBean(
+// menuList, getString(R.string.txt_create_fence_tip2), menuType = MultipleEntity.IMG_IMG
+// )
+// ViewUtil.instance.addMenuBean(
+// menuList, "", imageResId = R.drawable.create_fence_help3, menuType = MultipleEntity.IMG
+// )
+// ViewUtil.instance.addMenuBean(
+// menuList, getString(R.string.txt_enable_set_notify)
+// )
+// ViewUtil.instance.addMenuBean(
+// menuList, getString(R.string.txt_create_fence_tip3), menuType = MultipleEntity.IMG_IMG
// )
// ViewUtil.instance.addMenuBean(
// menuList, "", imageResId = R.drawable.create_fence_help4, menuType = MultipleEntity.IMG
// )
+// ViewUtil.instance.addMenuBean(
+// menuList, getString(R.string.txt_edit_delete_fence)
+// )
- val helpCreateFenceAdapter = HelpTextImageTypeAdapter(menuList)
- ViewUtil.instance.setRecyclerViewVerticalLinearLayout(
- mContext, mViewBinding.rvHelpCreatePetFenceContent, helpCreateFenceAdapter
- )
+// val helpCreateFenceAdapter = HelpTextImageTypeAdapter(menuList)
+// ViewUtil.instance.setRecyclerViewVerticalLinearLayout(
+// mContext, mViewBinding.rvHelpCreatePetFenceContent, helpCreateFenceAdapter
+// )
}
}
\ No newline at end of file
diff --git a/app/src/main/java/com/abbidot/tracker/ui/activity/help/HelpTrackerStatusActivity.kt b/app/src/main/java/com/abbidot/tracker/ui/activity/help/HelpTrackerStatusActivity.kt
index 608b4c4..af87cc3 100644
--- a/app/src/main/java/com/abbidot/tracker/ui/activity/help/HelpTrackerStatusActivity.kt
+++ b/app/src/main/java/com/abbidot/tracker/ui/activity/help/HelpTrackerStatusActivity.kt
@@ -1,53 +1,19 @@
package com.abbidot.tracker.ui.activity.help
-import android.view.View
import com.abbidot.tracker.R
import com.abbidot.tracker.base.BaseActivity
-import com.abbidot.tracker.constant.ConstantInt
-import com.abbidot.tracker.constant.ConstantString
import com.abbidot.tracker.databinding.ActivityHelpTrackerStatusBinding
class HelpTrackerStatusActivity :
BaseActivity(ActivityHelpTrackerStatusBinding::inflate) {
-
- private var mType = ConstantInt.Type0
-
override fun getTopBar() = mViewBinding.ilHelpTrackerStatusBar.titleTopBar
override fun initData() {
super.initData()
- intent.extras?.apply {
- mType = getInt(ConstantString.Type, ConstantInt.Type0)
- }
+ setTopBarTitle(R.string.txt_check_tracker_status)
+ setLeftBackImage(R.drawable.icon_white_back_svg)
mViewBinding.apply {
- when (mType) {
- 0 -> {
- setTopBarTitle(R.string.txt_check_tracker_status)
- setLeftBackImage(R.drawable.icon_white_back_svg)
- ilHelpTrackerStatusTitle1.tvHelpTitleOne.setText(R.string.txt_check_tracker_status_top_tip)
- }
-
- 1 -> {
- setTopBarTitle(R.string.txt_sleep_mode)
- setLeftBackImage(R.drawable.icon_white_back_svg)
- ilHelpTrackerStatusTitle1.tvHelpTitleOne.setText(R.string.txt_sleep_mode_help)
- ivHelpTrackerStatusImage.visibility = View.GONE
- }
-
- 2 -> {
- setTopBarTitle(R.string.txt_wifi_zone_home)
- setLeftBackImage(R.drawable.icon_white_back_svg)
- ilHelpTrackerStatusTitle1.tvHelpTitleOne.setText(R.string.txt_wifi_zone_home_help)
- ivHelpTrackerStatusImage.visibility = View.GONE
- }
-
- 3 -> {
- setTopBarTitle(R.string.tracker_manage_set_duration)
- setLeftBackImage(R.drawable.icon_white_back_svg)
- ilHelpTrackerStatusTitle1.tvHelpTitleOne.setText(R.string.txt_gps_update_help)
- ivHelpTrackerStatusImage.visibility = View.GONE
- }
- }
+ ilHelpTrackerStatusTitle1.tvHelpTitleOne.setText(R.string.txt_check_tracker_status_top_tip)
}
}
}
\ No newline at end of file
diff --git a/app/src/main/java/com/abbidot/tracker/ui/activity/help/HowWorkActivity.kt b/app/src/main/java/com/abbidot/tracker/ui/activity/help/HowWorkActivity.kt
index 4155402..76d61bd 100644
--- a/app/src/main/java/com/abbidot/tracker/ui/activity/help/HowWorkActivity.kt
+++ b/app/src/main/java/com/abbidot/tracker/ui/activity/help/HowWorkActivity.kt
@@ -41,19 +41,19 @@ class HowWorkActivity : BaseActivity(ActivityHowWorkBind
1 -> startActivity(Intent(mContext, HelpActiveTrackerActivity::class.java))
2 -> startActivity(Intent(mContext, HelpTrackerStatusActivity::class.java))
3 -> {
- Intent(mContext, HelpTrackerStatusActivity::class.java).let {
+ Intent(mContext, HelpCommonActivity::class.java).let {
it.putExtra(ConstantString.Type, ConstantInt.Type1)
startActivity(it)
}
}
4 -> {
- Intent(mContext, HelpTrackerStatusActivity::class.java).let {
+ Intent(mContext, HelpCommonActivity::class.java).let {
it.putExtra(ConstantString.Type, ConstantInt.Type2)
startActivity(it)
}
}
5 -> {
- Intent(mContext, HelpTrackerStatusActivity::class.java).let {
+ Intent(mContext, HelpCommonActivity::class.java).let {
it.putExtra(ConstantString.Type, ConstantInt.Type3)
startActivity(it)
}
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 a2fc24d..788784c 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
@@ -413,7 +413,10 @@ class SureSubscriptionPlanActivity :
}
}
mGoogleLocationViewModel.mGoogleLocationLiveData.observe(this) {
- mGeoCoderViewModel.getLatLonAddress(it.latitude, it.longitude)
+// mGeoCoderViewModel.getLatLonAddress(it.latitude, it.longitude)
+ mSubscriptionViewModel.getTaxRateByRegionName(
+ mGeoCoderViewModel.mCountryCode, mGeoCoderViewModel.mRegion
+ )
}
mGeoCoderViewModel.mLatLonAddressLiveData.observe(this) {
mSubscriptionViewModel.getTaxRateByRegionName(
diff --git a/app/src/main/java/com/abbidot/tracker/ui/fragment/data/RouteV3Fragment.kt b/app/src/main/java/com/abbidot/tracker/ui/fragment/data/RouteV3Fragment.kt
index 3470944..0f07a81 100644
--- a/app/src/main/java/com/abbidot/tracker/ui/fragment/data/RouteV3Fragment.kt
+++ b/app/src/main/java/com/abbidot/tracker/ui/fragment/data/RouteV3Fragment.kt
@@ -514,13 +514,13 @@ class RouteV3Fragment : BaseFragment(FragmentRouteV3Bind
机动车行驶:epsilon=1.5~2.0,插值 3 个
**/
// 1. 降噪
- val filterPoints = filterNoisePoint(data)
- // 2. RDP平滑抽稀
- val smoothPoints = rdpSmooth(filterPoints, epsilon = 0.5)
- // 3. 插值加密线条
- val finalPoints = latLngInterpolate(smoothPoints, step = 2)
+// val filterPoints = filterNoisePoint(data)
+// // 2. RDP平滑抽稀
+// val smoothPoints = rdpSmooth(filterPoints, epsilon = 0.5)
+// // 3. 插值加密线条
+// val finalPoints = latLngInterpolate(smoothPoints, step = 2)
- mHistoryDataList = finalPoints.toMutableList()
+ mHistoryDataList = data.toMutableList()
getHomeV2Activity()?.getPet(false)?.let {
mHistoryDataMapCommon.setPetBean(it)
}
@@ -534,17 +534,17 @@ class RouteV3Fragment : BaseFragment(FragmentRouteV3Bind
}
}
}
- if (finalPoints.isEmpty()) {
+ if (data.isEmpty()) {
setSeekBarShowHide(false)
mHistoryDataMapCommon.setPetUserLatLng()
return@launch
}
setSeekBarShowHide(true)
- val max = finalPoints.size - 1
+ val max = data.size - 1
setSeekBarMax(max)
- mHistoryDataMapCommon.setLatLngData(finalPoints.toMutableList())
+ mHistoryDataMapCommon.setLatLngData(data.toMutableList())
}
}
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 152f621..de46941 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
@@ -1077,7 +1077,7 @@ class MapV3Fragment : BaseFragment(FragmentMapV3Binding::i
showToast(R.string.txt_pet_close, gravity = Gravity.CENTER)
} else {
SRBleUtil.instance.isConnectBleSendCmdData(
- pet.macID, SRBleCmdUtil.instance.refreshLocation(userGpsLat, userGpsLon)
+ pet.macID, SRBleCmdUtil.instance.refreshLocation(0x2C, userGpsLat, userGpsLon)
)
refreshLocationAnim()
}
diff --git a/app/src/main/java/com/abbidot/tracker/ui/fragment/subscribe/PaypalPaymentFragment.kt b/app/src/main/java/com/abbidot/tracker/ui/fragment/subscribe/PaypalPaymentFragment.kt
index c0faffd..a976f59 100644
--- a/app/src/main/java/com/abbidot/tracker/ui/fragment/subscribe/PaypalPaymentFragment.kt
+++ b/app/src/main/java/com/abbidot/tracker/ui/fragment/subscribe/PaypalPaymentFragment.kt
@@ -60,12 +60,16 @@ class PaypalPaymentFragment :
mViewBinding.apply {
root.visibility = View.VISIBLE
tvPaypalPaymentEmail.text = pId.paypalMethodInfo.email
+ tvPaypalPaymentEmail.visibility =
+ if (TextUtils.isEmpty(pId.paypalMethodInfo.email))
+ View.GONE
+ else
+ View.VISIBLE
+
ilPaypalPaymentNoData.root.visibility =
- if (TextUtils.isEmpty(pId.paypalMethodInfo.email)) {
- tvPaypalPaymentEmail.visibility = View.GONE
+ if (null == it.mOrderBean && TextUtils.isEmpty(pId.paypalMethodInfo.email)) {
View.VISIBLE
} else {
- tvPaypalPaymentEmail.visibility = View.VISIBLE
View.GONE
}
}
diff --git a/app/src/main/java/com/abbidot/tracker/util/bluetooth/SRBleCmdUtil.kt b/app/src/main/java/com/abbidot/tracker/util/bluetooth/SRBleCmdUtil.kt
index 8a92584..20d3359 100644
--- a/app/src/main/java/com/abbidot/tracker/util/bluetooth/SRBleCmdUtil.kt
+++ b/app/src/main/java/com/abbidot/tracker/util/bluetooth/SRBleCmdUtil.kt
@@ -394,10 +394,10 @@ class SRBleCmdUtil private constructor() {
}
/**
- * 刷新定位
+ * 刷新定位, 上传定位信息2c/2d
*/
- fun refreshLocation(lat: Double, lon: Double): ByteArray {
- var byteArray = byteArrayOf(0x2C, CMD_WRITE.toByte())
+ fun refreshLocation(cmd: Byte, lat: Double, lon: Double): ByteArray {
+ var byteArray = byteArrayOf(cmd, CMD_WRITE.toByte())
byteArray = byteArray.plus(longTo4ByteArray((lon * 1000000).toLong()))
byteArray = byteArray.plus(longTo4ByteArray((lat * 1000000).toLong()))
//单位是米/秒(m/s)
diff --git a/app/src/main/java/com/abbidot/tracker/util/bluetooth/SRBleUtil.kt b/app/src/main/java/com/abbidot/tracker/util/bluetooth/SRBleUtil.kt
index 9d7b27c..a496d9c 100644
--- a/app/src/main/java/com/abbidot/tracker/util/bluetooth/SRBleUtil.kt
+++ b/app/src/main/java/com/abbidot/tracker/util/bluetooth/SRBleUtil.kt
@@ -253,6 +253,7 @@ class SRBleUtil private constructor() {
XEventBus.post(EventName.BlePassThrough, deviceData)
} else if (data0 == 0x09 && data1 == 0x00) {
val deviceData = ReceiveDeviceData(bleDevice, data, bleDevice.mac)
+ //获取固件版本并通知map页
if (isNotifyFirmware) {
isNotifyFirmware = false
XEventBus.post(EventName.BleFirmwareVersion, deviceData)
@@ -311,7 +312,9 @@ class SRBleUtil private constructor() {
.notify(bleDevice, uuidService, uuidNotify, object : BleNotifyCallback() {
override fun onNotifySuccess() {
LogUtil.e("打开日志上报通道成功:${bleDevice.name}--${bleDevice.mac}")
- notifyDeviceState(bleDevice, ConState.CONNECTED)
+ openG40LogReportNotify(
+ bleDevice, logG40ServiceUUID, logG40NotifyCharacteristicUUID
+ )
}
override fun onNotifyFailure(exception: BleException?) {
@@ -340,12 +343,22 @@ class SRBleUtil private constructor() {
.notify(bleDevice, uuidService, uuidNotify, object : BleNotifyCallback() {
override fun onNotifySuccess() {
LogUtil.e("打开日志上报通道成功:${bleDevice.name}--${bleDevice.mac}")
- notifyDeviceState(bleDevice, ConState.CONNECTED)
+ val userGpsLat = MMKVUtil.getDouble(MMKVKey.UserGpsLat)
+ val userGpsLon = MMKVUtil.getDouble(MMKVKey.UserGpsLon)
+ writeData(
+ bleDevice,
+ SRBleCmdUtil.instance.refreshLocation(0x2D, userGpsLat, userGpsLon)
+ )
}
override fun onNotifyFailure(exception: BleException?) {
LogUtil.e("打开日志上报通道失败:${bleDevice.mac},$exception")
- notifyDeviceState(bleDevice, ConState.CONNECTED)
+ val userGpsLat = MMKVUtil.getDouble(MMKVKey.UserGpsLat)
+ val userGpsLon = MMKVUtil.getDouble(MMKVKey.UserGpsLon)
+ writeData(
+ bleDevice,
+ SRBleCmdUtil.instance.refreshLocation(0x2D, userGpsLat, userGpsLon)
+ )
}
override fun onCharacteristicChanged(data: ByteArray?) {
@@ -383,6 +396,10 @@ class SRBleUtil private constructor() {
LogUtil.e(
"writeData onWriteSuccess data:" + HexUtil.formatHexString(data, true)
)
+ val data0 = SRBleCmdUtil.instance.byteToInt(data[0])
+ if (data0 == 0x2D) {
+ notifyDeviceState(bleDevice, ConState.CONNECTED)
+ }
}
override fun onWriteFailure(exception: BleException?) {
diff --git a/app/src/main/java/com/abbidot/tracker/vm/GoogleLocationViewModel.kt b/app/src/main/java/com/abbidot/tracker/vm/GoogleLocationViewModel.kt
index ea54dfb..0a20de3 100644
--- a/app/src/main/java/com/abbidot/tracker/vm/GoogleLocationViewModel.kt
+++ b/app/src/main/java/com/abbidot/tracker/vm/GoogleLocationViewModel.kt
@@ -5,7 +5,9 @@ import android.content.Context
import android.location.Location
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
+import com.abbidot.baselibrary.constant.MMKVKey
import com.abbidot.baselibrary.util.LogUtil
+import com.abbidot.baselibrary.util.MMKVUtil
import com.abbidot.tracker.util.LonAndLatUtil
import com.google.android.gms.location.FusedLocationProviderClient
import com.google.android.gms.location.LocationServices
@@ -39,8 +41,7 @@ class GoogleLocationViewModel : ViewModel() {
var location: Location? = null
if (taskLocation.isSuccessful && taskLocation.result != null) {
location = taskLocation.result
- LonAndLatUtil.currentUserGPSLat = location.latitude
- LonAndLatUtil.currentUserGPSLon = location.longitude
+ setLatLng(location)
LogUtil.e("Google,getLastLocation:${location.latitude}, ${location.longitude}")
} else {
LogUtil.e("Google,getLastLocation:exception" + taskLocation.exception)
@@ -75,8 +76,7 @@ class GoogleLocationViewModel : ViewModel() {
var location: Location? = null
val result = if (task.isSuccessful && task.result != null) {
location = task.result
- LonAndLatUtil.currentUserGPSLat = location.latitude
- LonAndLatUtil.currentUserGPSLon = location.longitude
+ setLatLng(location)
"(success): ${location.latitude}, ${location.longitude}"
} else {
val exception = task.exception
@@ -93,6 +93,17 @@ class GoogleLocationViewModel : ViewModel() {
}
}
+ private fun setLatLng(location: Location) {
+ location.apply {
+ MMKVUtil.putDouble(MMKVKey.UserGpsLat, latitude)
+ MMKVUtil.putDouble(MMKVKey.UserGpsLon, longitude)
+ //单位是米/秒(m/s)
+ MMKVUtil.putFloat(MMKVKey.UserGpsSpeed, speed)
+ LonAndLatUtil.currentUserGPSLat = location.latitude
+ LonAndLatUtil.currentUserGPSLon = location.longitude
+ }
+ }
+
private fun stopLocation() {
mCancellationTokenSource?.cancel()
}
diff --git a/app/src/main/res/drawable/active_tracker_help.png b/app/src/main/res/drawable/active_tracker_help.png
index 0f93a29..b7c4c41 100644
Binary files a/app/src/main/res/drawable/active_tracker_help.png and b/app/src/main/res/drawable/active_tracker_help.png differ
diff --git a/app/src/main/res/drawable/create_fence_help1.png b/app/src/main/res/drawable/create_fence_help1.png
index 15fae56..325a60a 100644
Binary files a/app/src/main/res/drawable/create_fence_help1.png and b/app/src/main/res/drawable/create_fence_help1.png differ
diff --git a/app/src/main/res/drawable/create_fence_help2.png b/app/src/main/res/drawable/create_fence_help2.png
index cb69ba1..c8b5757 100644
Binary files a/app/src/main/res/drawable/create_fence_help2.png and b/app/src/main/res/drawable/create_fence_help2.png differ
diff --git a/app/src/main/res/drawable/create_fence_help3.png b/app/src/main/res/drawable/create_fence_help3.png
index d29e310..b6ce02a 100644
Binary files a/app/src/main/res/drawable/create_fence_help3.png and b/app/src/main/res/drawable/create_fence_help3.png differ
diff --git a/app/src/main/res/drawable/create_fence_help4.png b/app/src/main/res/drawable/create_fence_help4.png
index 3291676..cbe5a58 100644
Binary files a/app/src/main/res/drawable/create_fence_help4.png and b/app/src/main/res/drawable/create_fence_help4.png differ
diff --git a/app/src/main/res/drawable/create_fence_help5.png b/app/src/main/res/drawable/create_fence_help5.png
new file mode 100644
index 0000000..bb52652
Binary files /dev/null and b/app/src/main/res/drawable/create_fence_help5.png differ
diff --git a/app/src/main/res/drawable/help_gps_update.png b/app/src/main/res/drawable/help_gps_update.png
new file mode 100644
index 0000000..11d8847
Binary files /dev/null and b/app/src/main/res/drawable/help_gps_update.png differ
diff --git a/app/src/main/res/drawable/help_sleep_mode.png b/app/src/main/res/drawable/help_sleep_mode.png
new file mode 100644
index 0000000..b6ac4f9
Binary files /dev/null and b/app/src/main/res/drawable/help_sleep_mode.png differ
diff --git a/app/src/main/res/drawable/help_tracker_status.png b/app/src/main/res/drawable/help_tracker_status.png
index 0a4224b..a7f09ea 100644
Binary files a/app/src/main/res/drawable/help_tracker_status.png and b/app/src/main/res/drawable/help_tracker_status.png differ
diff --git a/app/src/main/res/drawable/help_wifi_zone.png b/app/src/main/res/drawable/help_wifi_zone.png
new file mode 100644
index 0000000..133ce4c
Binary files /dev/null and b/app/src/main/res/drawable/help_wifi_zone.png differ
diff --git a/app/src/main/res/layout/activity_add_credit_card_payment.xml b/app/src/main/res/layout/activity_add_credit_card_payment.xml
index aecf004..95b7793 100644
--- a/app/src/main/res/layout/activity_add_credit_card_payment.xml
+++ b/app/src/main/res/layout/activity_add_credit_card_payment.xml
@@ -186,8 +186,7 @@
android:id="@+id/btn_save_new_credit_card"
style="@style/my_match_RoundRect_Button_style"
android:layout_marginHorizontal="@dimen/dp_16"
- android:text="@string/txt_ok"
- android:textAllCaps="true"
+ android:text="@string/acccount_btn_save"
app:qmui_radius="@dimen/dp_64"
app:typeface="@string/roboto_bold_font" />
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_add_new_tracker1.xml b/app/src/main/res/layout/activity_add_new_tracker1.xml
index d5b68ff..3e9ed93 100644
--- a/app/src/main/res/layout/activity_add_new_tracker1.xml
+++ b/app/src/main/res/layout/activity_add_new_tracker1.xml
@@ -43,6 +43,7 @@
app:typeface="@string/roboto_regular_font" />
+ android:layout_centerVertical="true"
+ android:layout_marginTop="@dimen/dp_18"
+ android:src="@drawable/active_tracker_help" />
diff --git a/app/src/main/res/layout/activity_help_common.xml b/app/src/main/res/layout/activity_help_common.xml
new file mode 100644
index 0000000..d833c17
--- /dev/null
+++ b/app/src/main/res/layout/activity_help_common.xml
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_help_create_pet_fence.xml b/app/src/main/res/layout/activity_help_create_pet_fence.xml
index 26cd622..35adbc8 100644
--- a/app/src/main/res/layout/activity_help_create_pet_fence.xml
+++ b/app/src/main/res/layout/activity_help_create_pet_fence.xml
@@ -1,5 +1,6 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_help_tracker_status.xml b/app/src/main/res/layout/activity_help_tracker_status.xml
index 71108ea..7d060ea 100644
--- a/app/src/main/res/layout/activity_help_tracker_status.xml
+++ b/app/src/main/res/layout/activity_help_tracker_status.xml
@@ -2,6 +2,7 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ android:src="@drawable/help_tracker_status" />
-
-
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 28af08f..7d88cdd 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -880,7 +880,7 @@
Yesterday
Power On/Off
Charge and unplug to turn on \nFlashing green light = on
- Choose a subscription \nTap to activate the tracker \nEnable GPS and cellular tracking
+ 1.Choose a subscription \n2.Tap to activate the tracker \n3.Enable GPS and cellular tracking
Active Tracker
(The GPS and cellular network conditions can vary depending on the environment. Before placing it on your pet, check various locations around you to evaluate the GPS and network status.)
Check Tracker Status
@@ -888,7 +888,6 @@
Connect the tracker to home WiFi (no password required). In the WiFi Zone, GPS activation is disabled. It connects to the network every 10–60 minutes, with very low power consumption.
When your tracker is outside the WiFi Zone, it activates GPS and connects to the network every 3/5/10/15 minutes.
Tracker Battery Life
- Go to Pet > My Pet Fence > Manage > + Add New
Choose location and adjust radius or shapeSave fence to activate it
Alerts when pet enters or leaves the zone
Create a Pet Fence
@@ -967,7 +966,6 @@
/month on
Replacement Guarantee
Enter discount code
- Check
Annual Care
Annual Care:
Bluetooth connection failed
@@ -1017,7 +1015,7 @@
Account exists. Log in now?
Selected date is out of range
Shake to turn on \nFlashing green light confirms on
- Go to Pet > Tracker Check \nNetwork \nGPS \nBattery \nWiFi Zone \nBluetooth \nLED \nGPS and cellular signals may vary by location \nTest in different locations before use
+ GPS and cellular signals may vary by location. \nTest in different locations before use.
Tracker is on charging
Subscribed
Baidu Maps
@@ -1067,10 +1065,10 @@
First use
Daily use
Sleep Mode
- 15 minutes no movement → sleep mode \nAuto wake on movement \nBattery updates every 24 hours
+ 1.15 minutes no movement → sleep mode. \n2.Auto wake on movement. \n3.Battery updates every 24 hours.
WiFi Zone(Home)
- Connect to home WiFi \nGPS off → save battery \nUpdate every ~60 minutes
- Pet > Tracker > GPS Update \nSelect 3–15 min \nShort interval = higher battery use \nDefault: 5 min
+ 1.Connect to home WiFi. \n2.GPS off → save battery. \n3.Update every ~60 minutes.
+ 1.Select 3–15 min. \n2.Short interval = higher battery use. \n3.Default: 5 min.
Set Fence type
Safe Zone or No-go Zone
Set boundary
@@ -1089,4 +1087,15 @@
subscription_terms_conditions_en.html
该手机号码已被绑定
+ Go to
+ Pet > Tracker
+ Pet > Tracker > GPS Update
+ Pet > My Pet Fence > Manage > + Add New
+ Check:
+ · Network
+ · Bluetooth
+ · WiFi Zone
+ · Battery
+ · GPS
+ · LED
\ No newline at end of file