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