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 f86613a..e327dec 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 @@ -248,6 +248,10 @@ class MapV3Fragment : BaseFragment(FragmentMapV3Binding::i XEventBus.observe(this, EventName.RefreshFences) { updateMapDeviceStatus() } + //删除设备 + XEventBus.observe(this, EventName.DeleteDevice) { + mMapViewModel.stopGetData() + } //直播自动结束提示 XEventBus.observe(this, EventName.LiveAutoEnd) { CommonDialog1( @@ -576,6 +580,8 @@ class MapV3Fragment : BaseFragment(FragmentMapV3Binding::i isCanLive = !(Util.isTimeoutReport(updateTime) || powerSwitch == ConstantInt.Type0 || powerSwitch == ConstantInt.Type2 || powerSwitch == ConstantInt.Type3 || inWifiZone == ConstantInt.Type1) setLiveBtnState(isCanLive) + mViewBinding.homeMapLiveBtn.visibility = if (liveFlag == ConstantInt.Type1) View.GONE + else View.VISIBLE mViewBinding.ilHomeMapDeviceBatteryLayout.let { mMapViewModel.setMapDeviceBattery( @@ -681,7 +687,7 @@ class MapV3Fragment : BaseFragment(FragmentMapV3Binding::i } else { mShowCenterLocationType = ConstantInt.PetLocationType isMoveCamera = true - updateMapDeviceStatus(useBleLocation = true) + updateMapDeviceStatus(useBleLocation = false) } ViewUtil.instance.setMapSwitchLocationButtonImage( homeMapRefreshBtn, mShowCenterLocationType diff --git a/app/src/main/java/com/abbidot/tracker/vm/MapViewModel.kt b/app/src/main/java/com/abbidot/tracker/vm/MapViewModel.kt index b1bea3f..5de5e45 100644 --- a/app/src/main/java/com/abbidot/tracker/vm/MapViewModel.kt +++ b/app/src/main/java/com/abbidot/tracker/vm/MapViewModel.kt @@ -32,7 +32,7 @@ class MapViewModel : ViewModel() { private var mCountDownTimer: CountDownTimer? = null //几分钟倒计时(min) - private var mRefreshDataMin = 0.5f + private var mRefreshDataMin = 0.35f private var mDeviceId = "" var mDeviceMsgType = ConstantInt.SpecialType