新增启动APP,wifi zone 未设置时,弹窗提示
This commit is contained in:
@@ -30,7 +30,7 @@ android {
|
||||
targetSdkVersion 35
|
||||
versionCode 2206
|
||||
// versionName "2.2.6"
|
||||
versionName "2.2.6-Beta1"
|
||||
versionName "2.2.6-Beta2"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
|
||||
@@ -34,13 +34,14 @@ data class PetBean(
|
||||
var deviceType: Int,
|
||||
var serviceVersion: String,//服务器上最新固件版本号
|
||||
var showDFUDialog: Boolean,//是否显示了固件升级弹窗
|
||||
var showNoWifiDialog: Boolean,//是否显示了没有设置wifi弹窗
|
||||
var availableOrder: Int,//判断套餐是否可用或过期,1是可用 0不可用
|
||||
var deviceId: String
|
||||
) : Parcelable, BaseDiffBean() {
|
||||
constructor() : this(
|
||||
"", "", "", "", 0, 1, MMKVUtil.getString(MMKVKey.UserId), "", 0, Utils.formatTime(
|
||||
System.currentTimeMillis(), Utils.DATE_FORMAT_PATTERN_CN
|
||||
), "", 0f, 0f, "", "", "", 1, 1, "",false, 1, ""
|
||||
), "", 0f, 0f, "", "", "", 1, 1, "", false, false, 1, ""
|
||||
)
|
||||
|
||||
override fun isSameObject(other: Any): Boolean {
|
||||
|
||||
@@ -454,7 +454,7 @@ class HomeV2Activity : BaseActivity<ActivityHomeV2Binding>(ActivityHomeV2Binding
|
||||
isFirst = false
|
||||
setSelectPetPos(mSelectPetPosition)
|
||||
//判断套餐有没有到期
|
||||
packageUnavailableState()
|
||||
checkPetState()
|
||||
//刚开始打开APP上传日志
|
||||
getPet(false)?.apply {
|
||||
mLogBleReportViewModel.uploadLog(mContext, macID, deviceOutId)
|
||||
@@ -547,9 +547,9 @@ class HomeV2Activity : BaseActivity<ActivityHomeV2Binding>(ActivityHomeV2Binding
|
||||
|
||||
|
||||
/**
|
||||
* 套餐不可用状态
|
||||
* 检测宠物状态,每次切都会执行
|
||||
*/
|
||||
private fun packageUnavailableState() {
|
||||
private fun checkPetState() {
|
||||
getPet(false)?.apply {
|
||||
//判断套餐有没有到期
|
||||
if (isCheckPackageExpire && shared == ConstantInt.NoShare && availableOrder == ConstantInt.Type0) {
|
||||
@@ -671,7 +671,7 @@ class HomeV2Activity : BaseActivity<ActivityHomeV2Binding>(ActivityHomeV2Binding
|
||||
3 -> (mFragments[3] as PetV2Fragment).showPetNameAndHead(position)
|
||||
}
|
||||
//判断套餐有没有到期
|
||||
packageUnavailableState()
|
||||
checkPetState()
|
||||
}
|
||||
|
||||
override fun onNavigationItemSelected(item: MenuItem): Boolean {
|
||||
|
||||
@@ -41,8 +41,10 @@ import com.abbidot.tracker.constant.ConstantString
|
||||
import com.abbidot.tracker.constant.GetResultCallback
|
||||
import com.abbidot.tracker.databinding.FragmentMapV3Binding
|
||||
import com.abbidot.tracker.dialog.CommonDialog1
|
||||
import com.abbidot.tracker.dialog.CommonDialog2
|
||||
import com.abbidot.tracker.dialog.SelectMapTypeDialog
|
||||
import com.abbidot.tracker.ui.activity.HomeV2Activity
|
||||
import com.abbidot.tracker.ui.activity.device.wifi.AddWifiPowerZone1Activity
|
||||
import com.abbidot.tracker.ui.activity.map.LiveActivityV3
|
||||
import com.abbidot.tracker.ui.common.map.HomeMapCommonV3
|
||||
import com.abbidot.tracker.util.LonAndLatUtil
|
||||
@@ -338,7 +340,7 @@ class MapV3Fragment : BaseFragment<FragmentMapV3Binding>(FragmentMapV3Binding::i
|
||||
XEventBus.observe(this, EventName.BleFirmwareVersion) { receiveData: ReceiveDeviceData ->
|
||||
getHomeV2Activity()?.let { home ->
|
||||
home.getPet(false)?.apply {
|
||||
if (macID == receiveData.mac && !showDFUDialog) {
|
||||
if (shared == ConstantInt.NoShare && availableOrder == ConstantInt.Type1 && macID == receiveData.mac && !showDFUDialog) {
|
||||
receiveData.data?.let { data ->
|
||||
val version = String(data.sliceArray(3..11))
|
||||
if (mDeviceDFUViewModel.checkVersionUpdate(version, serviceVersion)) {
|
||||
@@ -722,6 +724,46 @@ class MapV3Fragment : BaseFragment<FragmentMapV3Binding>(FragmentMapV3Binding::i
|
||||
val isOutOfChina = LonAndLatUtil.isLocationOutOfChina(latitude, longitude)
|
||||
MMKVUtil.putBoolean(MMKVKey.isGpsToGCJ02, !isOutOfChina)
|
||||
}
|
||||
|
||||
getHomeV2Activity()?.let {
|
||||
it.getPet(false)?.let { pet ->
|
||||
//检测没有设置wif就提示弹窗
|
||||
if (pet.shared == ConstantInt.NoShare && pet.availableOrder == ConstantInt.Type1 && inWifiZone == ConstantInt.Type2 && !pet.showNoWifiDialog) {
|
||||
pet.showNoWifiDialog = true
|
||||
CommonDialog2(
|
||||
mContext!!,
|
||||
getString(R.string.txt_edit_power_zone),
|
||||
getString(R.string.txt_sure),
|
||||
object : BaseDialog.OnDialogOkListener {
|
||||
override fun onOkClick(dialog: BaseDialog<*>) {
|
||||
Intent(
|
||||
mContext, AddWifiPowerZone1Activity::class.java
|
||||
).let { i ->
|
||||
//判断是否国内经纬度,需要坐标转换
|
||||
if (MMKVUtil.getBoolean(MMKVKey.isGpsToGCJ02)) {
|
||||
val convertLatLon =
|
||||
LonAndLatUtil.convertFromWGS84ToGCJ02(
|
||||
latitude, longitude
|
||||
)
|
||||
i.putExtra(
|
||||
ConstantString.Latitude, convertLatLon[0]
|
||||
)
|
||||
i.putExtra(
|
||||
ConstantString.Longitude, convertLatLon[1]
|
||||
)
|
||||
} else {
|
||||
i.putExtra(ConstantString.Latitude, latitude)
|
||||
i.putExtra(ConstantString.Longitude, longitude)
|
||||
}
|
||||
i.putExtra(ConstantString.Pet, pet)
|
||||
startActivity(i)
|
||||
}
|
||||
}
|
||||
}).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mHomeMapCommon.refreshPetCurrentLocation(latitude, longitude, isMoveCamera)
|
||||
isMoveCamera = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user