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