From 00e4a33e190beca7b62809e4a1b8e2f9aefacac3 Mon Sep 17 00:00:00 2001 From: yezhiqiu <983577727@qq.com> Date: Mon, 30 Mar 2026 10:48:32 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E6=B6=88=E6=81=AF=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E5=B7=B2=E8=AF=BB=E9=A1=B5=E9=9D=A2=E4=B8=8D=E6=9B=B4?= =?UTF-8?q?=E6=96=B0bug=202.=E4=BC=98=E5=8C=96=E7=9B=B4=E6=92=AD=E9=9B=B7?= =?UTF-8?q?=E8=BE=BE=E5=BC=80=E7=81=AF=E5=8A=A0=E8=BD=BD=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=E5=8F=98=E5=A4=A7=E9=97=AE=E9=A2=98=203.led=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=87=8D=E6=96=B0=E7=BC=96=E5=86=99=E9=80=BB?= =?UTF-8?q?=E8=BE=91=204.=E8=93=9D=E7=89=99=E7=BB=91=E5=AE=9A=E6=8C=87?= =?UTF-8?q?=E4=BB=A4=E5=A2=9E=E5=8A=A0=E4=B8=8A=E4=BD=8D=E6=9C=BA=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=92=8C=E7=BB=91=E5=AE=9A=E5=AF=86=E9=92=A5=205.map?= =?UTF-8?q?=E9=A1=B5=E6=96=B0=E5=A2=9E=E7=9D=A1=E7=9C=A0=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=206.=E4=BF=A1=E7=94=A8=E5=8D=A1=E9=A1=B5=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E5=90=8D=E5=AD=97=E9=BB=98=E8=AE=A4=E5=85=A8?= =?UTF-8?q?=E5=A4=A7=E5=86=99=207.Wifi=20zone=20=E5=86=85=EF=BC=8C?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E6=98=BE=E7=A4=BA=E4=B8=BA=E2=80=9CHome=20?= =?UTF-8?q?=C2=B7=20xxxxx=E2=80=9D=208.=E4=BC=98=E5=8C=96=E9=9B=B7?= =?UTF-8?q?=E8=BE=BE=E7=9B=B4=E6=92=ADLED=E7=81=AF=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 6 +- .../account/NotificationV2Activity.kt | 8 +- .../activity/device/set/LedLightActivity.kt | 372 ++++++++---------- .../tracker/ui/activity/map/LiveActivityV3.kt | 32 +- .../subscribe/AddCreditCardPaymentActivity.kt | 1 + .../ui/fragment/device/HomeTrackFragment.kt | 17 +- .../tracker/ui/fragment/map/MapV3Fragment.kt | 3 + .../googlemap/HomeMapGoogleMapFragmentV3.kt | 7 +- .../tracker/util/bluetooth/SRBleCmdUtil.kt | 2 +- .../com/abbidot/tracker/vm/MapViewModel.kt | 22 +- .../gray_ico_switch_disable.png | Bin 0 -> 830 bytes .../icon_device_sleep_image.png | Bin 0 -> 354 bytes .../gray_ico_switch_disable.png | Bin 0 -> 1277 bytes .../icon_device_sleep_image.png | Bin 0 -> 443 bytes .../gray_ico_switch_disable.png | Bin 0 -> 1487 bytes .../icon_device_sleep_image.png | Bin 0 -> 599 bytes .../drawable/selector_gray_icon_switch.xml | 1 + .../drawable/shape44_gray_border_white_bg.xml | 2 +- .../main/res/layout/activity_led_light.xml | 1 + .../res/layout/activity_power_saving_set.xml | 2 +- .../main/res/layout/layout_led_btn_state.xml | 4 +- app/src/main/res/values/strings.xml | 3 +- 22 files changed, 249 insertions(+), 234 deletions(-) create mode 100644 app/src/main/res/drawable-xhdpi/gray_ico_switch_disable.png create mode 100644 app/src/main/res/drawable-xhdpi/icon_device_sleep_image.png create mode 100644 app/src/main/res/drawable-xxhdpi/gray_ico_switch_disable.png create mode 100644 app/src/main/res/drawable-xxhdpi/icon_device_sleep_image.png create mode 100644 app/src/main/res/drawable-xxxhdpi/gray_ico_switch_disable.png create mode 100644 app/src/main/res/drawable-xxxhdpi/icon_device_sleep_image.png diff --git a/app/build.gradle b/app/build.gradle index 92b76e2..3d7eed3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -28,9 +28,9 @@ android { applicationId "com.abbidot.tracker" minSdkVersion 23 targetSdkVersion 35 - versionCode 2111 -// versionName "2.1.11" - versionName "2.1.11-Beta1" + versionCode 2112 +// versionName "2.1.12" + versionName "2.1.12-Beta1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/src/main/java/com/abbidot/tracker/ui/activity/account/NotificationV2Activity.kt b/app/src/main/java/com/abbidot/tracker/ui/activity/account/NotificationV2Activity.kt index 5e8760c..c7d90f5 100644 --- a/app/src/main/java/com/abbidot/tracker/ui/activity/account/NotificationV2Activity.kt +++ b/app/src/main/java/com/abbidot/tracker/ui/activity/account/NotificationV2Activity.kt @@ -38,8 +38,10 @@ class NotificationV2Activity : setOnItemClickListener(object : BaseRecyclerAdapter.OnItemClickListener { override fun onItemClick(itemView: View?, pos: Int) { val message = getItem(pos) - mReadMessageId = message.messageId - mNotificationsViewModel.setMessageIsRead(mReadMessageId) + if (message.isRead == ConstantInt.Type0) { + mReadMessageId = message.messageId + mNotificationsViewModel.setMessageIsRead(mReadMessageId) + } } }) } @@ -125,7 +127,7 @@ class NotificationV2Activity : isRefresh = true } } - if (isRefresh) mMessageAdapter.notifyItemChanged(0, list.size) + if (isRefresh) mMessageAdapter.notifyItemRangeChanged(0, list.size) } }) } diff --git a/app/src/main/java/com/abbidot/tracker/ui/activity/device/set/LedLightActivity.kt b/app/src/main/java/com/abbidot/tracker/ui/activity/device/set/LedLightActivity.kt index c8e8d0b..52fd682 100644 --- a/app/src/main/java/com/abbidot/tracker/ui/activity/device/set/LedLightActivity.kt +++ b/app/src/main/java/com/abbidot/tracker/ui/activity/device/set/LedLightActivity.kt @@ -1,7 +1,5 @@ package com.abbidot.tracker.ui.activity.device.set -import android.graphics.Color -import android.graphics.drawable.ColorDrawable import android.view.Gravity import android.view.View import androidx.activity.viewModels @@ -10,12 +8,8 @@ import androidx.core.view.isGone import com.abbidot.baselibrary.constant.ConState import com.abbidot.baselibrary.constant.EventName import com.abbidot.baselibrary.eventbus.XEventBus -import com.abbidot.baselibrary.list.BaseRecyclerAdapter -import com.abbidot.baselibrary.util.AppUtils import com.abbidot.tracker.R -import com.abbidot.tracker.adapter.LedLightColorAdapter import com.abbidot.tracker.base.BaseActivity -import com.abbidot.tracker.base.BaseDialog import com.abbidot.tracker.bean.BleTrackDeviceBean import com.abbidot.tracker.bean.MapDeviceBean import com.abbidot.tracker.bean.PetBean @@ -48,16 +42,14 @@ class LedLightActivity : BaseActivity(ActivityLedLightB private var mPetBean: PetBean? = null private var mMapDeviceBean: MapDeviceBean? = null - private var mOldMapDeviceBean: MapDeviceBean? = null - private var mBleTrackDeviceBean: BleTrackDeviceBean? = null - private lateinit var mLedLightColorAdapter: LedLightColorAdapter private lateinit var mLedModeList: MutableList - //防止多次按返回键执行 - private var isFinishSave = false - //禁用模式 private var isDisabledMode = true + private var mLedControlType = ConstantInt.Type0 + private var mLedSwitch = ConstantInt.Type1 + private var mLedMode = ConstantInt.Type1 + private var mLedTempMode = ConstantInt.Type1 override fun getTopBar() = mViewBinding.ilLedLightBar.titleTopBar @@ -65,7 +57,6 @@ class LedLightActivity : BaseActivity(ActivityLedLightB super.initData() setTopBarTitle(R.string.tracker_manage_set_led) setLeftBackImage(R.drawable.icon_white_back_svg) -// initStatus() mPetBean = Util.getParcelableAdaptive(intent, ConstantString.Pet, PetBean::class.java) @@ -86,14 +77,10 @@ class LedLightActivity : BaseActivity(ActivityLedLightB val builder = ViewUtil.instance.showBottomSheetList(mContext, { dialog, _, position, _ -> mMapDeviceBean?.apply { dialog.dismiss() - ledMode = position + 1 - mViewBinding.ledLightMode.detailText = mLedModeList[position] - mViewBinding.ledLightOpenAndClose.switch.let { - if (!it.isChecked) { - it.isChecked = true - } - setBleLedMode(ledMode) - } + mLedSwitch = ledSwitch + mLedMode = ledMode + mLedTempMode = position + 1 + setBleLedMode(mLedTempMode) } }) for (i in 0 until mLedModeList.size) builder.addItem(mLedModeList[i]) @@ -102,39 +89,8 @@ class LedLightActivity : BaseActivity(ActivityLedLightB ViewUtil.instance.showQMUICommonListItemView(mContext, this, { if (!isDisabledMode) builder.build().show() }, getString(R.string.txt_light_mode)) -// mMapDeviceBean?.apply { -// detailText = when { -// ledMode - 1 >= mLedModeList.size -> { -// mLedModeList[mLedModeList.size - 1] -// } -// -// ledMode == 0 -> { -// mLedModeList[0] -// } -// -// else -> mLedModeList[ledMode - 1] -// } -// } } - val colorListResId = mutableListOf( - R.color.white, - R.color.colormenu, - R.color.corner_color, - R.color.blue_light, - R.color.deep_blue, - R.color.red_blue, - R.color.yellow_color, - R.color.yellow_red_color - ) - mLedLightColorAdapter = LedLightColorAdapter(mContext, colorListResId) - mLedLightColorAdapter.setOnItemClickListener(object : - BaseRecyclerAdapter.OnItemClickListener { - override fun onItemClick(itemView: View?, pos: Int) { - setLedLightColor(ContextCompat.getColor(mContext, colorListResId[pos])) - } - }) - mViewBinding.apply { ViewUtil.instance.viewRotationAnimator(ilLedLightBtnState.ivLedBtnState, true) @@ -146,19 +102,6 @@ class LedLightActivity : BaseActivity(ActivityLedLightB it.tvIssueTwoSmallTwoTitle.setText(R.string.txt_network_setup) it.tvIssueTwoSmallTitleTwoContent.setText(R.string.txt_network_setup_dec) } - ViewUtil.instance.setRecyclerViewGridLayout( - mContext, - colorSelectRecyclerView, - mLedLightColorAdapter, - spanCount = 2, - bottom = AppUtils.dpToPx(9), - itemWidth = AppUtils.dpToPx(30), - offset = AppUtils.dpToPx(290) - ) - - selectColorPaintView.setOnColorSelectListener { - setLedLightColor(it) - } setOnClickListenerViews( ledLightBluetoothTips.trbBleConnectState, @@ -186,23 +129,59 @@ class LedLightActivity : BaseActivity(ActivityLedLightB val data = it.getOrNull() data?.apply { mMapDeviceBean = data - mOldMapDeviceBean = data.copy() setDeviceData(data) } } }) } - mLedLightViewModel.mSetLedLightLiveData.observe(this) { - dealRequestResult(it, object : GetResultCallback { - override fun onResult(any: Any) { - showToast(R.string.txt_change_successful, isFinish = true) - } + mLedLightViewModel.apply { + mLedSwitchLiveData.observe(this@LedLightActivity) { + dealRequestResult(it, object : GetResultCallback { + override fun onResult(any: Any) { + mPetBean?.apply { + if (!SRBleUtil.instance.isMacConnect(macID)) { + mViewBinding.ledLightOpenAndClose.switch.isChecked = + !mViewBinding.ledLightOpenAndClose.switch.isChecked + mMapDeviceBean?.let { m -> + val ledSwitch = if (m.ledSwitch == ConstantInt.Open) { + ConstantInt.Close + } else { + ConstantInt.Open + } + m.ledSwitch = ledSwitch + } + } + } + setLedControlState() + } - override fun onRequestError(exceptionCode: String?) { - isFinishSave = false - mViewBinding.btnLedLightSetSave.isEnabled = true - } - }) + override fun onRequestError(exceptionCode: String?) { + setLedControlState() + } + + override fun onErrorCode() { + setLedControlState() + } + }) + } + mSetLedLightLiveData.observe(this@LedLightActivity) { + dealRequestResult(it, object : GetResultCallback { + override fun onResult(any: Any) { + mLedMode = mLedTempMode + mLedSwitch = ConstantInt.Type1 + mViewBinding.ledLightOpenAndClose.switch.isChecked = true + setLedModeControlState() + } + + override fun onRequestError(exceptionCode: String?) { + setLedModeControlState() + } + + override fun onErrorCode() { + setLedModeControlState() + } + }) + } } //接收开蓝牙操作,然后搜索连接设备 @@ -234,6 +213,29 @@ class LedLightActivity : BaseActivity(ActivityLedLightB } } + /** + * 设置LED可以点击状态 + */ + private fun setLedControlState() { + mPetBean?.apply { + if (!SRBleUtil.instance.isMacConnect(macID)) { + setBtnState(true) + } + } + } + + private fun setLedModeControlState() { + mPetBean?.apply { + if (!SRBleUtil.instance.isMacConnect(macID)) { + setBtnState(true) + mMapDeviceBean?.let { + it.ledSwitch = mLedSwitch + it.ledMode = mLedMode + } + } + } + } + private fun parseData(data: ByteArray?) { if (null != data && data.isNotEmpty()) { val data0 = SRBleCmdUtil.instance.byteToInt(data[0]) @@ -242,26 +244,34 @@ class LedLightActivity : BaseActivity(ActivityLedLightB if (data0 == 3 && data1 == 1) { val data3 = SRBleCmdUtil.instance.byteToInt(data[3]) val ledSwitch = if (data3 > 0) { + mLedMode = data3 mViewBinding.ledLightOpenAndClose.switch.isChecked = true ConstantInt.Open } else { mViewBinding.ledLightOpenAndClose.switch.isChecked = false ConstantInt.Close } - mMapDeviceBean?.ledSwitch = ledSwitch + val modeType = if (data2 == 0) { ConstantInt.Type1 } else { ConstantInt.Type3 } mMapDeviceBean?.let { - mViewBinding.ledLightOpenAndClose.accessoryType = - QMUICommonListItemView.ACCESSORY_TYPE_SWITCH - mViewBinding.ilLedLightBtnState.root.visibility = View.GONE - //远程控制 - mLedLightViewModel.setLedSwitch( - null, it.deviceServerId, ledSwitch, modeType - ) + it.ledSwitch = ledSwitch + setBtnState(true) + //控制开关 + if (mLedControlType == ConstantInt.Type0) { + //远程控制 + mLedLightViewModel.setLedSwitch( + null, it.deviceServerId, ledSwitch, modeType + ) + } else { + //控制模式 + it.ledMode = data3 + //远程控制 + mLedLightViewModel.setLedLight(this@LedLightActivity, it, modeType) + } } } } @@ -269,12 +279,11 @@ class LedLightActivity : BaseActivity(ActivityLedLightB private fun setDeviceData(mapDeviceBean: MapDeviceBean) { mapDeviceBean.apply { + mLedMode=ledMode + mLedSwitch=ledSwitch mViewBinding.let { it.ledLightOpenAndClose.switch.isChecked = ledSwitch == ConstantInt.Open - setLedLightColor( - Color.rgb(ledRedValue, ledGreenValue, ledBlueValue), true - ) if (ledMode == 0 || ledMode > mLedModeList.size) ledMode = 1 it.ledLightMode.detailText = mLedModeList[ledMode - 1] @@ -285,7 +294,7 @@ class LedLightActivity : BaseActivity(ActivityLedLightB private fun updateDisabledState(mapDeviceBean: MapDeviceBean) { mapDeviceBean.apply { - setDisabledState(!Util.getLedControlState(deviceMacId,mapDeviceBean)) + setDisabledState(!Util.getLedControlState(deviceMacId, mapDeviceBean)) } } @@ -297,7 +306,7 @@ class LedLightActivity : BaseActivity(ActivityLedLightB ledLightBluetoothTips.root.visibility = View.GONE R.color.grey_color } else { - btnLedLightSetSave.visibility = View.VISIBLE + btnLedLightSetSave.visibility = View.GONE ledLightBluetoothTips.root.visibility = View.VISIBLE R.color.qmui_config_color_gray_1 } @@ -309,8 +318,9 @@ class LedLightActivity : BaseActivity(ActivityLedLightB /** * 更新设备连接状态 */ - private fun updateConState(trackBleDevice: BleTrackDeviceBean, isShowToast: Boolean = true) { - mBleTrackDeviceBean = trackBleDevice + private fun updateConState( + trackBleDevice: BleTrackDeviceBean, isShowToast: Boolean = true + ) { mViewBinding.ledLightBluetoothTips.trbBleConnectState.let { view -> val bgColor = if (trackBleDevice.conState == ConState.CONNECTED) { view.text = getString(R.string.tracker_manage_set_ble_connect) @@ -327,105 +337,23 @@ class LedLightActivity : BaseActivity(ActivityLedLightB } private fun setBleLedMode(mode: Int) { - mBleTrackDeviceBean?.apply { - SRBleUtil.instance.setBleLedSwitch(mContext, bleDevice, mode) - } - } - - override fun leftBackOnClick() { - if (null == mMapDeviceBean || null == mOldMapDeviceBean) { - super.leftBackOnClick() - return - } - if (isFinishSave) return - //是否是蓝牙连接了,修改设备数据返回,同步服务器 - if (null != mBleTrackDeviceBean) { - mMapDeviceBean?.apply { - mOldMapDeviceBean?.let { - if (it == mMapDeviceBean) { - super.leftBackOnClick() - } else { - //判断是否有蓝牙连接 - if (BleManager.getInstance().isConnected(mBleTrackDeviceBean!!.bleDevice)) { - finishAndSave(ConstantInt.Type1) - } else { - super.leftBackOnClick() - } - } - } - } - } else { - super.leftBackOnClick() - } - } - - /** - * 保存设置数据 - */ - private fun finishAndSave(modeType: Int) { - if (null == mMapDeviceBean) { - finish() - return - } mMapDeviceBean?.apply { - isFinishSave = true - mLedLightViewModel.setLedLight(this@LedLightActivity, this, modeType) - } - } - - /** - * @param show 只显示,不作为命令处理 - */ - private fun setLedLightColor(color: Int, show: Boolean = false) { - val drawableColor = ColorDrawable(color) - mViewBinding.currentSelectColor.appHeadImage.setImageDrawable(drawableColor) -// mViewBinding.ledLightBarColorImage.setBackgroundColor(color) - - val red = color and 0xff0000 shr 16 - val green = color and 0x00ff00 shr 8 - val blue = color and 0x0000ff - - mMapDeviceBean?.apply { - ledRedValue = red - ledGreenValue = green - ledBlueValue = blue - } - -// mViewBinding.tvLedLightCurrentRgb.text = String.format("#%06X", -0x1 and color) - mViewBinding.tvLedLightCurrentRgb.text = String.format("#%06X", 0xffffff and color) - - if (!show) { - mBleTrackDeviceBean?.let { - //判断是否有蓝牙连接 - if (BleManager.getInstance().isConnected(it.bleDevice)) { - SRBleUtil.instance.writeData( - it.bleDevice, SRBleCmdUtil.instance.ledColor( - SRBleCmdUtil.CMD_WRITE, red, green, blue - ) - ) + mLedControlType = ConstantInt.Type1 + setBtnState(false) + if (BleManager.getInstance().isConnected(deviceMacId)) { + //蓝牙控制 + SRBleUtil.instance.getConnectMacDevice(deviceMacId)?.let { + SRBleUtil.instance.setBleLedSwitch(mContext, it.bleDevice, mode) } + } else { + //远程控制 + ledMode = mode + ledSwitch = ConstantInt.Open + mLedLightViewModel.setLedLight(this@LedLightActivity, this, ConstantInt.Type2) } } } - /** - * 断开连接设备 - */ - private fun operateDeviceTips(messageID: Int, type: Int = 0) { - ViewUtil.instance.showDialog(mContext, messageID, object : BaseDialog.OnDialogOkListener { - override fun onOkClick(dialog: BaseDialog<*>) { - dialog.dismiss() - when (type) { - 0 -> { - mBleTrackDeviceBean?.let { - mConnectionDeviceViewModel.disconnect(it.bleDevice) - } - } - } - } - }, okTextResId = R.string.start_txt_yes) - } - /** * 手动连接/断开设备 */ @@ -454,45 +382,61 @@ class LedLightActivity : BaseActivity(ActivityLedLightB } } - private fun setLedSwitch() { - mViewBinding.ledLightOpenAndClose.switch.apply { - mMapDeviceBean?.let { - mViewBinding.ledLightOpenAndClose.accessoryType = - QMUICommonListItemView.ACCESSORY_TYPE_NONE - mViewBinding.ilLedLightBtnState.root.visibility = View.VISIBLE - val ledSwitch = if (it.ledSwitch == ConstantInt.Open) { - ConstantInt.Close - } else { - ConstantInt.Open - } - if (BleManager.getInstance().isConnected(it.deviceMacId)) { - //蓝牙控制 - mBleTrackDeviceBean?.apply { - SRBleUtil.instance.setBleLedSwitch(mContext, bleDevice, ledSwitch) - } - } else { - //远程控制 - mLedLightViewModel.setLedSwitch( - null, it.deviceServerId, ledSwitch, ConstantInt.Type2 - ) - } + private fun setBtnState(setEnabled: Boolean) { + mViewBinding.apply { + if (setEnabled) { + ledLightMode.detailText = mLedModeList[mLedMode - 1] + ledLightMode.isEnabled = true + lvLedLightModeLoading.visibility = View.GONE + ledLightOpenAndClose.accessoryType = QMUICommonListItemView.ACCESSORY_TYPE_SWITCH + ilLedLightBtnState.root.visibility = View.GONE + } else { + ledLightMode.detailText = "" + ledLightMode.isEnabled = false + lvLedLightModeLoading.visibility = View.VISIBLE + ledLightOpenAndClose.accessoryType = QMUICommonListItemView.ACCESSORY_TYPE_NONE + ilLedLightBtnState.root.visibility = View.VISIBLE } } } + private fun setLedSwitch() { + mMapDeviceBean?.apply { + mLedControlType = ConstantInt.Type0 + mViewBinding.ledLightOpenAndClose.switch.isChecked = + !mViewBinding.ledLightOpenAndClose.switch.isChecked + setBtnState(false) + val ledSwitch = if (ledSwitch == ConstantInt.Open) { + ConstantInt.Close + } else { + ConstantInt.Open + } + if (BleManager.getInstance().isConnected(deviceMacId)) { + //蓝牙控制 + SRBleUtil.instance.getConnectMacDevice(deviceMacId)?.let { + SRBleUtil.instance.setBleLedSwitch(mContext, it.bleDevice, ledSwitch) + } + } else { + //远程控制 + mLedLightViewModel.setLedSwitch( + null, deviceServerId, ledSwitch, ConstantInt.Type2 + ) + } + } + } + +// val modeType = if (null != mBleTrackDeviceBean && BleManager.getInstance() +// .isConnected(mBleTrackDeviceBean!!.bleDevice) +// ) ConstantInt.Type1 +// else ConstantInt.Type2 +// btnLedLightSetSave.isEnabled = false +// finishAndSave(modeType) + override fun onClick(v: View?) { mViewBinding.apply { when (v) { //手动连接设备 ledLightBluetoothTips.trbBleConnectState -> connectionBtn(ledLightBluetoothTips.trbBleConnectState.text.toString()) - btnLedLightSetSave -> { - val modeType = if (null != mBleTrackDeviceBean && BleManager.getInstance() - .isConnected(mBleTrackDeviceBean!!.bleDevice) - ) ConstantInt.Type1 - else ConstantInt.Type2 - btnLedLightSetSave.isEnabled = false - finishAndSave(modeType) - } btnLedLightIssue -> showLedIssue() ilLedLightIssueLayout.tvCloseIssueBtn -> showLedIssue() 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 65c0654..d4fa1a3 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 @@ -1,11 +1,14 @@ package com.abbidot.tracker.ui.activity.map import android.content.Intent +import android.graphics.PorterDuff import android.graphics.Typeface import android.view.KeyEvent import android.view.View import android.widget.RelativeLayout import androidx.activity.viewModels +import androidx.core.content.ContextCompat +import androidx.core.graphics.drawable.DrawableCompat import androidx.core.view.isGone import androidx.core.view.isVisible import androidx.fragment.app.Fragment @@ -292,7 +295,6 @@ class LiveActivityV3 : BaseActivity(ActivityLiveV3Binding override fun onResult(any: Any) { val data = it.getOrNull() data?.let { d -> - LogUtil.e("xxxxxxxxxxxxxxxxxxxxx,${d.latitude},${d.longitude}") d.isCloseBattery = isCloseBattery d.isCloseMsg = isCloseMsg mMapDeviceBean = d @@ -400,6 +402,17 @@ class LiveActivityV3 : BaseActivity(ActivityLiveV3Binding } mMapDeviceBean?.apply { if (trackBle.mac == deviceMacId) { + //蓝牙连接断开更快更新状态 + mMapViewModel.setDeviceStateAndWarningData( + mContext, + mPetBean, + this, + mViewBinding.ilLiveV3MapDeviceMsg.root, + mViewBinding.ilLiveV3MapDeviceMsg.tvDeviceMsgContent, + mViewBinding.ilLiveV3MapDeviceMsg.ivDeviceMsgCloseBtn, + mDeviceStateList, + mDeviceStateAdapter + ) updateConState(trackBle) //分享设备不可以控制灯 if (p.shared == ConstantInt.NoShare) { @@ -848,6 +861,23 @@ class LiveActivityV3 : BaseActivity(ActivityLiveV3Binding private fun setLedBtnEnabled(btnEnabled: Boolean) { mViewBinding.apply { + ilLiveV2BluetoothFindDevice.ilLiveV2RadarLightSwitch.tvDeviceLightSwitchTitle.let { + val tColor = if (btnEnabled) { + R.color.data_black_color + } else { + R.color.grey_color + } + val cColor = ContextCompat.getColor(mContext, tColor) + // 假设只给左侧图标 tint + val drawables = ContextCompat.getDrawable(mContext, R.drawable.icon_light_svg) + drawables?.let { d -> + val wrappedDrawable = DrawableCompat.wrap(d) + DrawableCompat.setTint(wrappedDrawable, cColor) + DrawableCompat.setTintMode(wrappedDrawable, PorterDuff.Mode.SRC_IN) + it.setCompoundDrawablesWithIntrinsicBounds(d, null, null, null) + } + it.setTextColor(cColor) + } ilLiveV2OperateLayout.ilLiveV2DataLightSwitch.cbDeviceLightSwitch.isEnabled = btnEnabled ilLiveV2OperateLayout.ilLiveV2DataLightSwitch.root.isEnabled = btnEnabled ilLiveV2BluetoothFindDevice.ilLiveV2RadarLightSwitch.root.isEnabled = btnEnabled diff --git a/app/src/main/java/com/abbidot/tracker/ui/activity/subscribe/AddCreditCardPaymentActivity.kt b/app/src/main/java/com/abbidot/tracker/ui/activity/subscribe/AddCreditCardPaymentActivity.kt index 6ebe7b5..1c15f97 100644 --- a/app/src/main/java/com/abbidot/tracker/ui/activity/subscribe/AddCreditCardPaymentActivity.kt +++ b/app/src/main/java/com/abbidot/tracker/ui/activity/subscribe/AddCreditCardPaymentActivity.kt @@ -57,6 +57,7 @@ class AddCreditCardPaymentActivity : ilAddCardNameOnCard.let { it.tvInputView2NameTitle.setText(R.string.txt_name_card) + it.etInputView2Content.setFilters(arrayOf(InputFilter.AllCaps())) it.etInputView2Content.onFocusChangeListener = this@AddCreditCardPaymentActivity showEditViewContent(it.etInputView2Content, mCreditCard!!.cardName) } diff --git a/app/src/main/java/com/abbidot/tracker/ui/fragment/device/HomeTrackFragment.kt b/app/src/main/java/com/abbidot/tracker/ui/fragment/device/HomeTrackFragment.kt index 5837810..85e43aa 100644 --- a/app/src/main/java/com/abbidot/tracker/ui/fragment/device/HomeTrackFragment.kt +++ b/app/src/main/java/com/abbidot/tracker/ui/fragment/device/HomeTrackFragment.kt @@ -386,8 +386,7 @@ class HomeTrackFragment : } mLedLightViewModel.mLedSwitchLiveData.observe(viewLifecycleOwner) { dealRequestResult( - it, - object : GetResultCallback { + it, object : GetResultCallback { override fun onResult(any: Any) { getHomeV2Activity()?.let { h -> h.getPet(false)?.let { p -> @@ -415,13 +414,21 @@ class HomeTrackFragment : override fun onRequestError(exceptionCode: String?) { setLedErrorState() } - }, - isRequestErrorTip = mLedMac == getHomeV2Activity()!!.getPet(false)!!.macID, - isShowCodeError = mLedMac == getHomeV2Activity()!!.getPet(false)!!.macID + }, isRequestErrorTip = getShowError(), isShowCodeError = getShowError() ) } } + private fun getShowError(): Boolean { + var showCodeError = false + getHomeV2Activity()?.apply { + getPet(false)?.let { + showCodeError = mLedMac == it.macID + } + } + return showCodeError + } + private fun setLedErrorState() { getHomeV2Activity()?.apply { getPet(false)?.let { 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 2cf6f96..456a0d7 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 @@ -830,6 +830,9 @@ class MapV3Fragment : BaseFragment(FragmentMapV3Binding::i getPet()?.let { pet -> if (SRBleUtil.instance.isMacConnect(pet.macID)) { showToast(R.string.txt_pet_close, gravity = Gravity.CENTER) + } else if (null != mMapDeviceBean && mMapDeviceBean!!.powerSwitch == ConstantInt.Type2) { + val string = String.format(getString(R.string.txt_move_wake), pet.petName) + showToast(string, gravity = Gravity.CENTER) } else if (!isCanLive) { showToast(R.string.txt_locate_works, gravity = Gravity.CENTER) } else if (!isNotifyRefreshLocation) { diff --git a/app/src/main/java/com/abbidot/tracker/ui/fragment/map/googlemap/HomeMapGoogleMapFragmentV3.kt b/app/src/main/java/com/abbidot/tracker/ui/fragment/map/googlemap/HomeMapGoogleMapFragmentV3.kt index 373d3dc..ca9eb99 100644 --- a/app/src/main/java/com/abbidot/tracker/ui/fragment/map/googlemap/HomeMapGoogleMapFragmentV3.kt +++ b/app/src/main/java/com/abbidot/tracker/ui/fragment/map/googlemap/HomeMapGoogleMapFragmentV3.kt @@ -13,6 +13,7 @@ import com.abbidot.baselibrary.util.Utils import com.abbidot.tracker.R import com.abbidot.tracker.bean.HistoryDataBean import com.abbidot.tracker.bean.MapDeviceBean +import com.abbidot.tracker.constant.ConstantInt import com.abbidot.tracker.databinding.LayoutPetLocationInfoBinding import com.abbidot.tracker.util.Util import com.abbidot.tracker.util.ViewUtil @@ -99,7 +100,11 @@ class HomeMapGoogleMapFragmentV3 : BaseGoogleMapFragment() { // mMarker?.tag = history // showMarkerInfoWindow(history) - val address = String.format(mContext!!.getString(R.string.txt_near), it) + val address = if (inWifiZone == ConstantInt.Type1) { + mContext!!.getString(R.string.txt_home) + " · $it" + } else { + String.format(mContext!!.getString(R.string.txt_near), it) + } ViewUtil.instance.viewShow(mPetLocationLayoutBinding.root) mPetLocationLayoutBinding.let { layout -> layout.tvPetLocationReverseGeocode.text = address 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 785117f..d356d9e 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 @@ -146,7 +146,7 @@ class SRBleCmdUtil private constructor() { * 绑定设备 */ fun bindDevice(): ByteArray { - val byteArray = byteArrayOf(0x01, CMD_WRITE.toByte()) + val byteArray = byteArrayOf(0x01, CMD_WRITE.toByte(),0x02,0,0) return getCrc8Cmd(byteArray) } 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 c89d982..4cae142 100644 --- a/app/src/main/java/com/abbidot/tracker/vm/MapViewModel.kt +++ b/app/src/main/java/com/abbidot/tracker/vm/MapViewModel.kt @@ -25,6 +25,7 @@ import com.abbidot.tracker.widget.TypefaceButton import com.abbidot.tracker.widget.TypefaceTextView import com.clj.fastble.BleManager import kotlinx.coroutines.launch +import java.util.concurrent.TimeUnit class MapViewModel : ViewModel() { @@ -447,7 +448,16 @@ class MapViewModel : ViewModel() { batteryText.let { canShowBattery = true rootView.visibility = View.VISIBLE - if (powerSwitch == ConstantInt.Type0) { + if (powerSwitch == ConstantInt.Type2) { + //R.drawable.icon_weak_gps_image + it.setCompoundDrawablesWithIntrinsicBounds( + R.drawable.icon_device_sleep_image, 0, 0, 0 + ) + it.text = String.format( + context.getString(R.string.txt_fully_asleep), forTime(updateTime) + ) + ViewUtil.instance.viewShow(closeBtn) + } else if (powerSwitch == ConstantInt.Type0) { //连接蓝牙就不显示关机 if (SRBleUtil.instance.isMacConnect(deviceMacId)) { rootView.visibility = View.INVISIBLE @@ -485,6 +495,16 @@ class MapViewModel : ViewModel() { } } + private fun forTime(timestamp: Long): String { + val durationMillis = + if (timestamp < 1000000000000) System.currentTimeMillis() - timestamp * 1000 + else System.currentTimeMillis() - timestamp + val hours = TimeUnit.MILLISECONDS.toHours(durationMillis) + val minutes = + TimeUnit.MILLISECONDS.toMinutes(durationMillis) - TimeUnit.HOURS.toMinutes(hours) + val timeStr = if (hours > 0) "${hours}h ${minutes}m" else "${minutes}m" + return timeStr + } fun setPetLocationReverseGeocode( context: Context, diff --git a/app/src/main/res/drawable-xhdpi/gray_ico_switch_disable.png b/app/src/main/res/drawable-xhdpi/gray_ico_switch_disable.png new file mode 100644 index 0000000000000000000000000000000000000000..654e49d0e7873e18e75202c3ff763dae7442409c GIT binary patch literal 830 zcmV-E1Ht@>P)Fws`@8#v|<>v0@=kMm|?&#?5FMsw%*^KJ?$*}X z&CSi!)Ys0=&f??g&(F}{;O5lT*VEJ0+uY#c;^)!P)7RJ9+}+{W+1%dWfWG_3lrr*MGnSzR2ctDDhs`Nwr_F zi?PqBysKFbLnpt%I(sWm$(h8JJG;!+XCcO?#cr?kvQpy_9rp;6<5c*THC(B%t3h(g z-F+DPsr-33Q9!5e$sTt*e&h;aEk7lDdDuL|%Agg<@mtIpciSk8E5t~FoVk+SdU(NA zA}2hsTfd=s;B##7n3GH{@{VnI9{9-?Cl@7{f5(TX_27Tm_yCh*4mZp4C-oaVfH4N5>?_>MEK-L)sr-`Kq)zQG<0oDEsT$kXtje?Ifh9gc> zS87jKE>195qaUeVVBiG|HmN1GI}E&o!3OoDc8`H^`=V2ygRl^?1qW<5A?ipq(C1Z5 zfZaBUy~+xS7&lu^qi^&1fRGihCTdFX~2`g;aIPQQKIrm~8_WvGKlY0WfryRQe?m|Z zfn)Q7|M&N>G%YAiG?&aq0=I8C_=kDg_?&aq0=IHL`=I-X_?dIq2 z=I8C>C_?##^0=I8F><`($mq=)7;(R)YaF`&Cb-+*X8Ez*4EkI z;N{QI(ap`x-rwWW)6~+^)ZX6X<>u_r(9z@M>)qYr*?z=29E7SIL7jd zcYuf9G{N}q?hB5wvK&US;Wd8O4MyPqeY(IgHi9X3JeHeR;RyUr=Lg2v38L`&;o>%$ z!M*ziQv~>8*<X0vi-d~F$9o+H#@-)6jFss%vMmihpX)I&cK!@f9QwoJ zK$?5iW^gG`UmSTU_V*-&=3I=ubq~5?Yu7`e@`YARs`8xP_+blXxn zRp##I{QY5y@)k^KYr+*v(h+m^$sjjfffFLCoV2iWXF3`D`8$jvJ$A*3v=WiC!tuHo zgmXNCI1^SLY#hPZ14eN=f{->s>W6t~Jq*I(44cA6bKYoS_rV3i&m$QD(XxeTVXnxy z5Lsbjrk>P=>R=FA7os*XajiS%>~q%;MT)2)4D{_G`VfRur!pK8jDbN>qKbfM+j|16 z^r}=85JP*2AvPTa$_oPndx!xBk)xzAz|WhO*Chs#B-xFz1Q@-BL8Sf$gq#k*6YzB8 zge!mTDZs$YQ$av{*h7Fzv`AF}VOdRZba1n(P)R_1+j|1sw#!r(5HI!+U;=a7y<(%V zF02^CQhCi=)I8a`B8H+ymUmya5MW5~@=g}IpSBP&6uPS9w>tYU7DvfXvY~IeKET7z z+34_dEOVe$Xrjl!iTscj6vo{N9!2pSh)J~uERG&=wFXEwNq&qMNNi0KQthHQQ;PW7 zMWh;MhJ}BOjWgO+Qp>xEFVGg^o=*filFRhbq?!7PRk+TS1f(RN|JYXEo>Ch;4fa>f zrtUr3RGw+Dld;r*#-!r}NKj^?%PqP#9VbwLGLfII!1V0~bfEl1q%FjC!F<8jREQ8q zq$f%Cz}(Fd!X-(fgc5-GqXFV-9rwbhI4}8Qik{@L2A52lc*H6c?g2Cl}*dv;~F@U5jKJ1ym nHp-P^9{t2ASE!cik-z>QM86YO=Z=MW00000NkvXXu0mjfr9ZKm literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/icon_device_sleep_image.png b/app/src/main/res/drawable-xxhdpi/icon_device_sleep_image.png new file mode 100644 index 0000000000000000000000000000000000000000..3dfe291bd10db2562cad2095469361d457a8ac10 GIT binary patch literal 443 zcmV;s0Yv_ZP)_chg@u%+ zU(44ax_dI1A{D#H>m|I9;bI<&d^tl;s86Y?e(9GG@B}Ftc}n9=(w{gq`e_=fFOk7; z#Wz-I6LLx`w5!l^!UnTUaYcLTWPoKYc!?{^t^wuK&aVSbq|LG&@qa#4h=9D1> zrbGs=6OKlNIx4y|z&x}g)KzC-fEbLNk5SP=Jq!_*W^#21Lj8?#L;KAX7=p|;As`l_ zjo&P-U?RF5LNr!foV1G%D7GJiIf4czxP>C)M$@oLL$?7U=e`znHITzI5ZX(cx)Ts% z?kM8}5JP{nC<9D4`n!EH7JB>%n9VY=BiVhKYkf~3W;qX^m=K6+7Sd+%0ue{`ZjPI! lHTh|}HR1xIbhdx-d;lP32+V%NNcI2#002ovPDHLkV1jWHwJ!hw literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/gray_ico_switch_disable.png b/app/src/main/res/drawable-xxxhdpi/gray_ico_switch_disable.png new file mode 100644 index 0000000000000000000000000000000000000000..f4f1579cbc2e27922a10b2cfed5c548b3c9ed4c2 GIT binary patch literal 1487 zcmXX`dpOf;9RDGA9YRVM3#B7!CpqL0HkS$8SgEs;DXAQc$EBv*5uKqhlS`JPlu8ZR zK|FGcrH;kWjIr5$L%WD4JtwsD(>c%c{eIrd=kk1?_m4L(424*4w8aPjfc1xi{4wC# z2zIoA4v4po8~6c$mUdX^(Evnps8p(y&8TH^m26fmm#hA(wIf(Er9`fnnVFX?EXZfn z0>MY{5){Z}-}Q2(T&|SLKvZco8ZbwyR7%&3Y7nI|73c*MWHQjA{=Nb8L8J2jkQq=3 zvTC7F3EIDlRbqt#WW`{}j7ln3NTrIk*+8XC_5S^Pkov$H6NzVshew#q;pu5Hb9jW$ zmrPFaIg>oGQc`dW z3%{uc!ko0CA8!=|Gvni#6v|9AbqEYGOb)`P0)VmkT5FB+uCD;Vx_yWJVMhs3%F4Kt zqMyv(BD@|{P8;p9d(d!&|7ve*ZlYTAU~^a_A0y>fxYq%w&}Y z2a3sA7o&GXX4G%aL)>w6G^>DD`2RxenSJh3hB|we&|hBR#6;_`@iASl?i&_+M_uFU zUzST4^ zNhSWpQtiF*#Ln@=)_vixT2`>dge$4*-ez>CGK1bwIkWfe;hKMTW_Qq3ffq~~c+G6+ zc($I+!ZPU_-HFk#lr$IB%vOKi>MFUj(MNRc_*B6pA#y3H{tse@PZeQ=ll=K_NO@@+ z^^7gF(Ej45ssZ6&n5PGJc&9aE>)$QTUDjp1tBRtD1f51%jDaXyYmRtuDmmYD6D%Wr zRXc}}5mN$5x-C{?cU)>*KIY*Ei{jhBoQIN32L(&9ms}xXx$e9kY;|>0QHR6+!h$B0 zh)V;u4M6J7V_^F~g%81;8+QA3BtdO%F3J+~dZ<}gZPNLN-Qs*aRh!n>T}!;ek5a)a zU`qr+?H>L9H1UrJXN9{?9i+oXccA@@QkRh9K2QJQ_2nBPOHU>pz9Ph9OwWDsIh~*Q z%57d7cO^vkMZ+V-J;mK3Gg9#c?p@k5;%U(?20isE&)vni12fMa;v}Jzqy$RaryH`Yj<*G4z|}4#^Z9 zmA-tT>k%nh)NJ_vJ}&L3_9e5-7{IY>a(FpEe0wJXaKjWyo_8LNi$3)>x8LCg4!eg^ zro_jr<32Q#J9Cf43*EBNblcvs$p~X^08r>lrnWq_YRds4fdXm-2i`k(u>Te^+e`l{ zmEB7+u<{1FFfASJg+M}w)*^a#u=j~>=B5f0Q;)Gztp-*@#(k8B>uY(j`KOBYbWd0y z$kVJ){3kzr#$mh`G=Ur#WYb57x5^ zO?(fQgjlgkS=HzOL8NcUM|P>dfT6whQxY-w3};+<&9JFU4|Of&T9Y ze_%=UeNh4})=t+VivW&A+x|iwh-W~sFH%p>7kNQnQj_nCbT;xu78(mId%DeEFIKnK zR#IxV_3WK2x5OT*Ht3$PORu{C>2b_<&oA?5wGnN7Xk{$#xDB#wo=P21;q)#8&RU z%Et&~-q)u9!`=ZjwIcW?$KQ7~TPCpVz#%Ss3$VQr1Vr<`%e=P^+&2JFr`Y#1HhHii zJ`q=b#~&7;$=d-091t%HJA!E*k<>VVavcDMJxl?+*h32eCP&bo!HF8k!FA0<;1XbR zC^QUk3cnk%dz>43w8zZzD=kOjo;!Lr049m9)OQCYSd~X#$)-?L@$hctLJnY7Cm_M~ zf+=Nf!n<`XHYRT@LlJv8nPq@CqQ(|0HB8A11ncuwmN{u8gPoSQL6FNkfTS%Qg!5o@ zP8PufyhK2W9|D(R5oyS%UZh?Q6pGNSe*n>-Xj{gX5bORgPsFI*z0~h2P-~$zzS9VZ z#V1gIAyJWoLJx~SgfJ{HDoUBXlEeXgdk2MwFr2E!E|6QTbSZfnhW;XF(;XaY1?1L~ z5+5`!=X34LE;t2d5M&RUF4ll?(15eOT#B9PXiObN6^^l)0YIs@Z|m7TZdhI=eIBD% z|JBv=jT)F&z~AykH_vmEO + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape44_gray_border_white_bg.xml b/app/src/main/res/drawable/shape44_gray_border_white_bg.xml index 0a89905..3c94317 100644 --- a/app/src/main/res/drawable/shape44_gray_border_white_bg.xml +++ b/app/src/main/res/drawable/shape44_gray_border_white_bg.xml @@ -9,7 +9,7 @@ - + diff --git a/app/src/main/res/layout/activity_led_light.xml b/app/src/main/res/layout/activity_led_light.xml index 7020853..cb4ebf3 100644 --- a/app/src/main/res/layout/activity_led_light.xml +++ b/app/src/main/res/layout/activity_led_light.xml @@ -23,6 +23,7 @@ android:paddingHorizontal="@dimen/dp_14" android:paddingVertical="@dimen/dp_6" android:text="@string/acccount_btn_save" + android:visibility="gone" android:textColor="@color/btn_color" android:textSize="@dimen/textSize12" app:qmui_radius="@dimen/dp_100" diff --git a/app/src/main/res/layout/activity_power_saving_set.xml b/app/src/main/res/layout/activity_power_saving_set.xml index e326974..4bb2bfc 100644 --- a/app/src/main/res/layout/activity_power_saving_set.xml +++ b/app/src/main/res/layout/activity_power_saving_set.xml @@ -63,7 +63,7 @@ style="@style/my_TextView_style_v2" android:layout_marginHorizontal="@dimen/dp_6" android:layout_marginTop="@dimen/dp_12" - android:text="@string/txt_office" + android:text="@string/txt_home" android:textSize="@dimen/textSize14" app:typeface="@string/roboto_bold_font" /> diff --git a/app/src/main/res/layout/layout_led_btn_state.xml b/app/src/main/res/layout/layout_led_btn_state.xml index 402d0e1..3c28224 100644 --- a/app/src/main/res/layout/layout_led_btn_state.xml +++ b/app/src/main/res/layout/layout_led_btn_state.xml @@ -3,8 +3,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/shape32_grey_color_bg" - android:paddingHorizontal="@dimen/dp_16" - android:paddingVertical="@dimen/dp_4"> + android:paddingHorizontal="@dimen/dp_12" + android:paddingVertical="@dimen/dp_2"> Pet is close, try Radar Pull to load more Release to load - Fully charged + Fell asleep %s ago + Move %s to wake up \ No newline at end of file