修改被分享的账户权限:1. 应不可连接蓝牙;2. 应不可直播(隐藏按钮);3. 应不可重新开启自动订阅、不可充值; 4. 应不可设置开关灯、定位间隔、直播时长、固件升级、关机(全部隐藏)。
This commit is contained in:
@@ -30,7 +30,7 @@ android {
|
||||
targetSdkVersion 35
|
||||
versionCode 2103
|
||||
// versionName "2.1.3"
|
||||
versionName "2.1.3-Beta1"
|
||||
versionName "2.1.3-Beta2"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
|
||||
@@ -94,6 +94,7 @@ class MySubscriptionAdapter(
|
||||
)
|
||||
}
|
||||
|
||||
val userId = MMKVUtil.getString(MMKVKey.UserId)
|
||||
val expiresTitle = holder.getTextView(R.id.tv_my_subscription_expires_title)
|
||||
holder.getButton(R.id.btn_my_subscription_recharge).apply {
|
||||
visibility =
|
||||
@@ -109,6 +110,9 @@ class MySubscriptionAdapter(
|
||||
expiresTitle.setText(R.string.txt_expires_on1)
|
||||
View.GONE
|
||||
}
|
||||
|
||||
//UserId不一样就是共享设备的订单
|
||||
visibility = if (item.userId == userId) visibility else View.GONE
|
||||
}
|
||||
|
||||
holder.getView(R.id.il_my_subscription_count_down).apply {
|
||||
@@ -126,7 +130,6 @@ class MySubscriptionAdapter(
|
||||
holder.setText(R.id.tv_add_success_device_expires_min, times[2])
|
||||
|
||||
holder.getView(R.id.fl_my_subscription_btn_layout).apply {
|
||||
val userId = MMKVUtil.getString(MMKVKey.UserId)
|
||||
//UserId不一样就是共享设备的订单
|
||||
visibility = if (item.userId == userId) {
|
||||
setOnClickListener {
|
||||
|
||||
@@ -539,13 +539,13 @@ class HomeV2Activity : BaseActivity<ActivityHomeV2Binding>(ActivityHomeV2Binding
|
||||
* 套餐不可用状态
|
||||
*/
|
||||
private fun packageUnavailableState() {
|
||||
autoConnectDevice()
|
||||
getPet(false)?.apply {
|
||||
//判断套餐有没有到期
|
||||
if (shared == ConstantInt.NoShare && availableOrder == ConstantInt.Type0) {
|
||||
Util.checkPackageExpired(this@HomeV2Activity, deviceId)
|
||||
}
|
||||
}
|
||||
autoConnectDevice()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -616,14 +616,14 @@ class HomeV2Activity : BaseActivity<ActivityHomeV2Binding>(ActivityHomeV2Binding
|
||||
mChangePetDialog?.dismiss()
|
||||
mSelectPetPosition = position
|
||||
mChangePetListDialogAdapter.setSelectPetPos(mSelectPetPosition)
|
||||
//判断套餐有没有到期
|
||||
packageUnavailableState()
|
||||
when (mViewBinding.homeV2ViewPager2.currentItem) {
|
||||
0 -> (mFragments[0] as ActivityV2Fragment).showPetNameAndHead(position)
|
||||
1 -> (mFragments[1] as RouteV2Fragment).showPetNameAndHead(position)
|
||||
2 -> (mFragments[2] as MapV3Fragment).showPetNameAndHead(position)
|
||||
3 -> (mFragments[3] as PetV2Fragment).showPetNameAndHead(position)
|
||||
}
|
||||
//判断套餐有没有到期
|
||||
packageUnavailableState()
|
||||
}
|
||||
|
||||
override fun onNavigationItemSelected(item: MenuItem): Boolean {
|
||||
@@ -684,6 +684,11 @@ class HomeV2Activity : BaseActivity<ActivityHomeV2Binding>(ActivityHomeV2Binding
|
||||
* 自动连接设备
|
||||
*/
|
||||
private fun autoConnectDevice() {
|
||||
val share = MMKVUtil.getInt(MMKVKey.Shared)
|
||||
if (share != ConstantInt.NoShare) {
|
||||
LogUtil.e("分享的设备,不连接设备")
|
||||
return
|
||||
}
|
||||
getPet(false)?.apply {
|
||||
if (TextUtils.isEmpty(macID)) return@apply
|
||||
if (SRBleUtil.instance.isBleEnable(mContext)) {
|
||||
|
||||
@@ -121,8 +121,21 @@ class HomeTrackFragment :
|
||||
)
|
||||
}
|
||||
|
||||
4 -> connectionBtn(getData()[pos].menuValue)
|
||||
4 -> {
|
||||
val share = MMKVUtil.getInt(MMKVKey.Shared)
|
||||
if (share != ConstantInt.NoShare) {
|
||||
LogUtil.e("分享的设备,不可点击")
|
||||
return
|
||||
}
|
||||
connectionBtn(getData()[pos].menuValue)
|
||||
}
|
||||
|
||||
5 -> {
|
||||
val share = MMKVUtil.getInt(MMKVKey.Shared)
|
||||
if (share != ConstantInt.NoShare) {
|
||||
LogUtil.e("分享的设备,不可点击")
|
||||
return
|
||||
}
|
||||
if (mHomePetTrackStateAdapter.getData()[pos].type == ConstantInt.SpecialType) {
|
||||
return
|
||||
}
|
||||
@@ -516,7 +529,7 @@ class HomeTrackFragment :
|
||||
val eTime = Utils.stringToDate(
|
||||
endTime, Utils.DATE_FORMAT_PATTERN_CN, Utils.DATE_FORMAT_PATTERN_EN7
|
||||
)
|
||||
val endTime = "${getString(R.string.txt_expires_on1)}$eTime"
|
||||
val endTime = "${getString(R.string.txt_end_time)}:$eTime"
|
||||
val id = "ID:$deviceOutId"
|
||||
mViewBinding.let {
|
||||
it.tvHomePetTrackPetStartTime.text = startTime
|
||||
|
||||
@@ -534,6 +534,10 @@ class MapV3Fragment : BaseFragment<FragmentMapV3Binding>(FragmentMapV3Binding::i
|
||||
R.color.grey_color
|
||||
}
|
||||
tvHomeMapLiveTitle.setTextColor(ContextCompat.getColor(mContext!!, tColor))
|
||||
val share = MMKVUtil.getInt(MMKVKey.Shared)
|
||||
if (share != ConstantInt.NoShare) {
|
||||
homeMapLiveBtn.visibility = View.GONE
|
||||
}
|
||||
|
||||
ivHomeMapLiveImage.let {
|
||||
val bg = if (canLive) {
|
||||
|
||||
Reference in New Issue
Block a user