修复已有设备,再去添加新设备不绑定宠物bug;
70分钟无上报、关机、休眠、in wifi zone时,增加GPS 状态为“Off”; 蓝牙直播支持网络; 修复有时进入围栏设置会卡死,退不出来bug; 删除Tracker Battery Life项,里面设备休眠状态配图;
This commit is contained in:
@@ -11,6 +11,8 @@ import com.abbidot.tracker.base.BaseDialog
|
||||
import com.abbidot.tracker.databinding.DialogCalenderAndTimeLayoutBinding
|
||||
import com.abbidot.tracker.util.NumberPickerValueFill0Format
|
||||
import com.abbidot.tracker.util.ViewUtil
|
||||
import com.haibin.calendarview.CalendarView
|
||||
import com.hjq.toast.Toaster
|
||||
import java.util.Calendar
|
||||
|
||||
|
||||
@@ -65,6 +67,16 @@ class ShowCalenderAndTimeDialog(
|
||||
mShowYear = year
|
||||
updateMonthYear()
|
||||
}
|
||||
it.setOnCalendarSelectListener(object : CalendarView.OnCalendarSelectListener {
|
||||
override fun onCalendarOutOfRange(calendar: com.haibin.calendarview.Calendar?) {
|
||||
Toaster.show(R.string.txt_time_out_of_range)
|
||||
}
|
||||
|
||||
override fun onCalendarSelect(
|
||||
calendar: com.haibin.calendarview.Calendar, isClick: Boolean
|
||||
) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
npDialogCalenderHour.let {
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.abbidot.tracker.base.BaseDialog
|
||||
import com.abbidot.tracker.databinding.DialogCalenderLayoutBinding
|
||||
import com.haibin.calendarview.Calendar
|
||||
import com.haibin.calendarview.CalendarView
|
||||
import com.hjq.toast.Toaster
|
||||
|
||||
/**
|
||||
*Created by .yzq on 2022/1/7/007.
|
||||
@@ -75,7 +76,7 @@ class ShowCalenderDialog(
|
||||
|
||||
it.setOnCalendarSelectListener(object : CalendarView.OnCalendarSelectListener {
|
||||
override fun onCalendarOutOfRange(calendar: Calendar?) {
|
||||
|
||||
Toaster.show(R.string.txt_time_out_of_range)
|
||||
}
|
||||
|
||||
override fun onCalendarSelect(calendar: Calendar, isClick: Boolean) {
|
||||
|
||||
@@ -124,7 +124,7 @@ class HomeV2Activity : BaseActivity<ActivityHomeV2Binding>(ActivityHomeV2Binding
|
||||
|
||||
override fun initData() {
|
||||
isEdgeToEdgeAdapterNavigationBars = false
|
||||
checkCrash=false
|
||||
checkCrash = false
|
||||
super.initData()
|
||||
setStatusBarLight()
|
||||
|
||||
@@ -266,7 +266,6 @@ class HomeV2Activity : BaseActivity<ActivityHomeV2Binding>(ActivityHomeV2Binding
|
||||
isCountdownAutoConnBle = false
|
||||
if (SRBleUtil.instance.isBleEnable(mContext)) {
|
||||
autoConnectDevice()
|
||||
mCountDownTimerViewModel.startCountDown(20)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -299,14 +298,12 @@ class HomeV2Activity : BaseActivity<ActivityHomeV2Binding>(ActivityHomeV2Binding
|
||||
//蓝牙连接断开上传日志
|
||||
if (ble.mac == macID) {
|
||||
if (ble.conState == ConState.CONNECTED) {
|
||||
mCountDownTimerViewModel.stopCountDown()
|
||||
stopCountDownConBle()
|
||||
//蓝牙连接就去连接socket
|
||||
mBleReportManage.dealBleReportData(macID, null)
|
||||
// mBleReportManage.dealBleReportData(macID, null)
|
||||
} else {
|
||||
mLogBleReportViewModel.uploadLog(mContext, macID)
|
||||
LogUtil.e("15秒监听蓝牙自动连接")
|
||||
mCountdownType = ConstantInt.Type1
|
||||
mCountDownTimerViewModel.startCountDown(15)
|
||||
startCountDownConBle(15)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -419,6 +416,17 @@ class HomeV2Activity : BaseActivity<ActivityHomeV2Binding>(ActivityHomeV2Binding
|
||||
}
|
||||
}
|
||||
|
||||
private fun startCountDownConBle(second: Long) {
|
||||
LogUtil.e("${second}秒监听蓝牙自动连接")
|
||||
mCountdownType = ConstantInt.Type1
|
||||
mCountDownTimerViewModel.startCountDown(second)
|
||||
}
|
||||
|
||||
private fun stopCountDownConBle() {
|
||||
isCountdownAutoConnBle = false
|
||||
mCountDownTimerViewModel.stopCountDown()
|
||||
}
|
||||
|
||||
private fun setPetData(petList: MutableList<PetBean>) {
|
||||
mPetList.addAll(petList)
|
||||
if (mSelectPetPosition > mPetList.size - 1) {
|
||||
@@ -680,15 +688,15 @@ class HomeV2Activity : BaseActivity<ActivityHomeV2Binding>(ActivityHomeV2Binding
|
||||
if (TextUtils.isEmpty(macID)) return@apply
|
||||
if (SRBleUtil.instance.isBleEnable(mContext)) {
|
||||
if (BleManager.getInstance().isConnected(macID)) {
|
||||
SRBleUtil.instance.cancelBleScan("已连接设备,取消其他连接扫描")
|
||||
val bleTrack = SRBleUtil.instance.getConnectMacDevice(macID)
|
||||
XEventBus.post(EventName.ConnectDeviceState, bleTrack)
|
||||
LogUtil.e("已连接设备,不用再次自动连接设备")
|
||||
// SRBleUtil.instance.cancelBleScan("已连接设备,取消其他连接扫描")
|
||||
// val bleTrack = SRBleUtil.instance.getConnectMacDevice(macID)
|
||||
// XEventBus.post(EventName.ConnectDeviceState, bleTrack)
|
||||
} else {
|
||||
mAutomaticConnectionDeviceViewModel.connectDeviceToMac(
|
||||
this@HomeV2Activity, macID, false
|
||||
)
|
||||
mCountdownType = ConstantInt.Type1
|
||||
mCountDownTimerViewModel.startCountDown(30)
|
||||
startCountDownConBle(30)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -734,7 +742,7 @@ class HomeV2Activity : BaseActivity<ActivityHomeV2Binding>(ActivityHomeV2Binding
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
LogUtil.e("HomeV2Activity---------------onDestroy")
|
||||
mCountDownTimerViewModel.stopCountDown()
|
||||
stopCountDownConBle()
|
||||
mSocketUtilManage?.destroy()
|
||||
mBleListenerReceiver?.let {
|
||||
unregisterReceiver(it)
|
||||
|
||||
@@ -24,6 +24,7 @@ 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.CountDownTimerViewModel
|
||||
import com.abbidot.tracker.vm.FencesManageViewModel
|
||||
import com.clj.fastble.BleManager
|
||||
import com.qmuiteam.qmui.util.QMUIDisplayHelper
|
||||
@@ -35,6 +36,7 @@ class VirtualFencesActivity :
|
||||
BaseActivity<ActivityVirtualFencesBinding>(ActivityVirtualFencesBinding::inflate) {
|
||||
|
||||
private val mFencesManageViewModel: FencesManageViewModel by viewModels()
|
||||
private val mCountDownTimerViewModel: CountDownTimerViewModel by viewModels()
|
||||
|
||||
private lateinit var mFencesAdapter: FencesZoneAdapter
|
||||
private lateinit var mFencesList: MutableList<FencesBean>
|
||||
@@ -116,6 +118,10 @@ class VirtualFencesActivity :
|
||||
}
|
||||
|
||||
override fun liveDataObserve() {
|
||||
//防止蓝牙同步超时
|
||||
mCountDownTimerViewModel.mCountDownEndLiveData.observe(this) {
|
||||
showNoCancelableLoading(false)
|
||||
}
|
||||
//接收更新围栏返回通知
|
||||
XEventBus.observe(this, EventName.RefreshFences) {
|
||||
mPetBean?.apply {
|
||||
@@ -216,6 +222,8 @@ class VirtualFencesActivity :
|
||||
|
||||
mPetBean?.apply {
|
||||
if (BleManager.getInstance().isConnected(macID)) {
|
||||
//设置8秒超时同步
|
||||
mCountDownTimerViewModel.startCountDown(8)
|
||||
showNoCancelableLoading(true, "")
|
||||
SRBleUtil.instance.isConnectBleSendCmdData(macID, SRBleCmdUtil.instance.getFences())
|
||||
}
|
||||
@@ -241,6 +249,7 @@ class VirtualFencesActivity :
|
||||
)
|
||||
}
|
||||
} else {
|
||||
mCountDownTimerViewModel.stopCountDown()
|
||||
showNoCancelableLoading(false)
|
||||
}
|
||||
} else {
|
||||
@@ -323,6 +332,7 @@ class VirtualFencesActivity :
|
||||
)
|
||||
}
|
||||
} else {
|
||||
mCountDownTimerViewModel.stopCountDown()
|
||||
showNoCancelableLoading(false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,12 +33,12 @@ class HelpTrackerBatteryActivity :
|
||||
getString(R.string.txt_tracker_battery_tip1),
|
||||
menuType = MultipleEntity.IMG_IMG
|
||||
)
|
||||
ViewUtil.instance.addMenuBean(
|
||||
menuList,
|
||||
"",
|
||||
imageResId = R.drawable.battery_life_help1,
|
||||
menuType = MultipleEntity.IMG
|
||||
)
|
||||
// ViewUtil.instance.addMenuBean(
|
||||
// menuList,
|
||||
// "",
|
||||
// imageResId = R.drawable.battery_life_help1,
|
||||
// menuType = MultipleEntity.IMG
|
||||
// )
|
||||
|
||||
ViewUtil.instance.addMenuBean(menuList, getString(R.string.txt_in_wifi_zone))
|
||||
ViewUtil.instance.addMenuBean(
|
||||
|
||||
@@ -307,7 +307,11 @@ class LiveActivityV3 : BaseActivity<ActivityLiveV3Binding>(ActivityLiveV3Binding
|
||||
//直播开始
|
||||
else -> {
|
||||
//直播开启后,就去获取直播轨迹
|
||||
if (!BleManager.getInstance().isConnected(macID)) {
|
||||
// if (!BleManager.getInstance().isConnected(macID)) {
|
||||
// mMapLiveViewModel.mGetPetLivePointTimeStamp =
|
||||
// System.currentTimeMillis() / 1000
|
||||
// mMapLiveViewModel.getPetLivePoint(deviceId)
|
||||
// }
|
||||
mMapLiveViewModel.mGetPetLivePointTimeStamp =
|
||||
System.currentTimeMillis() / 1000
|
||||
mMapLiveViewModel.getPetLivePoint(deviceId)
|
||||
@@ -315,7 +319,6 @@ class LiveActivityV3 : BaseActivity<ActivityLiveV3Binding>(ActivityLiveV3Binding
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onRequestError(exceptionCode: String?) {
|
||||
LogUtil.e("HomeV2Activity直播开启错误onRequestError,再次请求")
|
||||
@@ -505,6 +508,7 @@ class LiveActivityV3 : BaseActivity<ActivityLiveV3Binding>(ActivityLiveV3Binding
|
||||
* 更新蓝牙上报的数据
|
||||
*/
|
||||
private fun updateBleReportData(bleReportDataBean: BleReportDataBean) {
|
||||
mMapLiveViewModel.stopGetData()
|
||||
mHomeMapCommon.startRefreshUserLocation()
|
||||
bleReportDataBean.apply {
|
||||
if (haveDeviceStateData) {
|
||||
|
||||
@@ -66,7 +66,7 @@ class PaymentSuccessActivity :
|
||||
// if (it.rechargeType == ConstantInt.Type0) {
|
||||
// btnPaymentSuccessContinue.setText(R.string.txt_continue)
|
||||
// }
|
||||
if (it.rechargeType != ConstantInt.Type2) {
|
||||
if (it.rechargeType == ConstantInt.Type0 || it.rechargeType == ConstantInt.Type1) {
|
||||
btnPaymentSuccessContinue.isEnabled = false
|
||||
//刷新设备绑定
|
||||
mAddTrackerViewModel.updatePayDeviceState(
|
||||
@@ -145,7 +145,7 @@ class PaymentSuccessActivity :
|
||||
mPayResult?.apply {
|
||||
if (mMac == receiveData.mac) {
|
||||
val data = receiveData.data
|
||||
setButtonEnabled(mViewBinding.btnPaymentSuccessContinue, ConstantInt.Type1)
|
||||
// setButtonEnabled(mViewBinding.btnPaymentSuccessContinue, ConstantInt.Type1)
|
||||
parseData(data)
|
||||
}
|
||||
}
|
||||
@@ -240,10 +240,8 @@ class PaymentSuccessActivity :
|
||||
MMKVUtil.putString(MMKVKey.FirstDeviceMac, "")
|
||||
XEventBus.post(EventName.PayBack)
|
||||
mPayResult?.let {
|
||||
if (it.rechargeType == ConstantInt.Type0) {
|
||||
mUserProfileViewModel.updateMeasureUnit( ConstantInt.Type1
|
||||
)
|
||||
|
||||
if (it.rechargeType == ConstantInt.Type0 || it.rechargeType == ConstantInt.Type1) {
|
||||
mUserProfileViewModel.updateMeasureUnit(ConstantInt.Type1)
|
||||
// val intent = Intent(mContext, FirstSetPetTypeActivity::class.java)
|
||||
// intent.putExtra(ConstantString.isFirstBind, true)
|
||||
// startActivity(intent)
|
||||
|
||||
@@ -438,7 +438,7 @@ class HomeTrackFragment :
|
||||
ViewUtil.instance.addMenuBean(
|
||||
mTrackStateList,
|
||||
getString(R.string.tracker_manage_set_gps),
|
||||
getString(R.string.txt_weak_signal),
|
||||
getString(R.string.tracker_manage_set_led_off),
|
||||
imageResId = R.drawable.icon_map_gps
|
||||
)
|
||||
ViewUtil.instance.addMenuBean(
|
||||
@@ -535,13 +535,12 @@ class HomeTrackFragment :
|
||||
}
|
||||
}
|
||||
mTrackStateList[1].let {
|
||||
it.colorRedId = R.color.orange_color3
|
||||
it.menuValue = if (inWifiZone == ConstantInt.Type1) {
|
||||
getString(R.string.tracker_manage_set_led_off)
|
||||
} else if (isTimeoutReport || gpsSignal == ConstantInt.NoSignal || powerSwitch == ConstantInt.Type0 || powerSwitch == ConstantInt.Type2) {
|
||||
getString(R.string.txt_weak_signal)
|
||||
} else if (gpsSignal > ConstantInt.WeakSignal) {
|
||||
it.colorRedId = R.color.blue_color1
|
||||
it.menuValue =
|
||||
if (isTimeoutReport || powerSwitch == ConstantInt.Type0 || powerSwitch == ConstantInt.Type2 || inWifiZone == ConstantInt.Type1) {
|
||||
it.colorRedId = R.color.orange_color3
|
||||
getString(R.string.tracker_manage_set_led_off)
|
||||
} else if (gpsSignal > ConstantInt.WeakSignal) {
|
||||
getString(R.string.txt_strong_signal)
|
||||
} else {
|
||||
getString(R.string.txt_weak_signal)
|
||||
|
||||
@@ -88,7 +88,7 @@ class MapViewModel : ViewModel() {
|
||||
menuType = ConstantInt.Close
|
||||
name = context.getString(R.string.tracker_manage_set_gps)
|
||||
value =
|
||||
context.getString(R.string.tracker_manage_set_gps) + ":" + context.getString(R.string.txt_no_signal)
|
||||
context.getString(R.string.tracker_manage_set_gps) + ":" + context.getString(R.string.tracker_manage_set_led_off)
|
||||
deviceStateList.add(this)
|
||||
}
|
||||
DataBean().apply {
|
||||
@@ -273,7 +273,7 @@ class MapViewModel : ViewModel() {
|
||||
deviceStateList[1].apply {
|
||||
menuType = ConstantInt.Close
|
||||
value =
|
||||
context.getString(R.string.tracker_manage_set_gps) + ":" + context.getString(R.string.txt_no_signal)
|
||||
context.getString(R.string.tracker_manage_set_gps) + ":" + context.getString(R.string.tracker_manage_set_led_off)
|
||||
}
|
||||
deviceStateList[2].apply {
|
||||
menuType = ConstantInt.Close
|
||||
@@ -312,12 +312,10 @@ class MapViewModel : ViewModel() {
|
||||
}
|
||||
deviceStateList[1].apply {
|
||||
menuType = ConstantInt.Open
|
||||
val gpsValue = if (it.inWifiZone == ConstantInt.Type1) {
|
||||
val gpsValue =
|
||||
if (isTimeoutReport || it.powerSwitch == ConstantInt.Type0 || it.powerSwitch == ConstantInt.Type2 || it.inWifiZone == ConstantInt.Type1) {
|
||||
menuType = ConstantInt.Close
|
||||
context.getString(R.string.tracker_manage_set_led_off)
|
||||
} else if (isTimeoutReport || it.gpsSignal == ConstantInt.NoSignal || it.powerSwitch == ConstantInt.Type0 || it.powerSwitch == ConstantInt.Type2) {
|
||||
menuType = ConstantInt.Close
|
||||
context.getString(R.string.txt_weak_signal)
|
||||
} else if (it.gpsSignal > ConstantInt.WeakSignal) {
|
||||
context.getString(R.string.txt_strong_signal)
|
||||
} else {
|
||||
|
||||
@@ -9,6 +9,7 @@ import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.abbidot.tracker.R;
|
||||
import com.hjq.toast.Toaster;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -141,20 +142,23 @@ public class DayV2Adapter extends RecyclerView.Adapter<DayV2Adapter.ViewHolder>
|
||||
|
||||
// holder.tvPoint.setVisibility(item.isCurrent() ? View.VISIBLE : View.INVISIBLE);
|
||||
|
||||
holder.rootView.setOnClickListener(v -> {
|
||||
if (item.isFuture()) {
|
||||
Toaster.show(R.string.txt_time_out_of_range);
|
||||
} else {
|
||||
if (null != itemClick) {
|
||||
itemClick.onItemClick(item.getYear(), item.getMonth(), item.getDay(),
|
||||
item.getWeek());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (item.isFuture()) {
|
||||
holder.tvDay.setTextColor(ContextCompat.getColor(context,
|
||||
R.color.sleep_time_gray_color2));
|
||||
holder.rootView.setOnClickListener(null);
|
||||
} else {
|
||||
holder.tvDay.setTextColor(item.isSelected() ? dayTextColorSelected :
|
||||
dayTextColorNormal);
|
||||
holder.rootView.setOnClickListener(v -> {
|
||||
if (itemClick != null) {
|
||||
itemClick.onItemClick(datas.get(position).getYear(),
|
||||
datas.get(position).getMonth(), datas.get(position).getDay(),
|
||||
datas.get(position).getWeek());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (todayBgDrawable > 0) {
|
||||
@@ -163,7 +167,7 @@ public class DayV2Adapter extends RecyclerView.Adapter<DayV2Adapter.ViewHolder>
|
||||
|
||||
}
|
||||
if (todayTextColor > 0) {
|
||||
holder.tvCurrentDay.setTextColor(ContextCompat.getColor(context,todayTextColor));
|
||||
holder.tvCurrentDay.setTextColor(ContextCompat.getColor(context, todayTextColor));
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 81 KiB |
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.abbidot.tracker.widget.TypefaceTextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@android:id/message"
|
||||
style="@style/my_TextView_style_v2"
|
||||
android:background="@drawable/shape40_black70_toast_bg"
|
||||
@@ -8,5 +7,4 @@
|
||||
android:paddingVertical="@dimen/dp_8"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/tab_select"
|
||||
android:textSize="15dp"
|
||||
app:typeface="@string/roboto_regular_font" />
|
||||
android:textSize="15dp" />
|
||||
Reference in New Issue
Block a user