1.新增wifi列表g40根据手机系统wifi来显示wifi名字
2.新增map页地址显示当前wifizone名字
This commit is contained in:
@@ -36,6 +36,7 @@ data class MapDeviceBean(
|
||||
var startTime: String,
|
||||
var endTime: String,
|
||||
var deviceType: Int,
|
||||
var wifiZoneName: String,
|
||||
var notifyLocationFail: Boolean,
|
||||
var canShowBattery: Boolean,//是否可以显示电池提示布局
|
||||
var isCloseBattery: Boolean,//是否关闭电池提示
|
||||
@@ -72,6 +73,7 @@ data class MapDeviceBean(
|
||||
"",
|
||||
"",
|
||||
1,
|
||||
"",
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
|
||||
@@ -18,8 +18,9 @@ data class PayResultBean(
|
||||
var expirationTime: String,
|
||||
var deviceOutId: String,
|
||||
var deviceId: String,
|
||||
var deviceType: Int,
|
||||
//设备充值类型,0=首次设备充值激活,1=已添加设备再次添加设备充值,2=给当前的设备续费或者升级套餐
|
||||
var rechargeType: Int
|
||||
) : Parcelable {
|
||||
constructor() : this("", "", "", 0L, "", "", "", ConstantInt.Type1)
|
||||
constructor() : this("", "", "", 0L, "", "", "", 1, ConstantInt.Type1)
|
||||
}
|
||||
|
||||
@@ -51,6 +51,8 @@ class AddPairedSuccessActivity :
|
||||
private var mDeviceOutId = ""
|
||||
private var mDeviceId = ""
|
||||
private var mMac = ""
|
||||
|
||||
//设备类型
|
||||
private var mType = ConstantInt.Type1
|
||||
private var mPetBean: PetBean? = null
|
||||
|
||||
@@ -136,6 +138,7 @@ class AddPairedSuccessActivity :
|
||||
|
||||
val intent = Intent(mContext, SubscriptionPlanActivity::class.java)
|
||||
intent.putExtra(ConstantString.LkSetMeal, mSubscriptionsOrderBean)
|
||||
intent.putExtra(ConstantString.Type, mType)
|
||||
intent.putExtra(ConstantString.isFirstBind, isFirstBind)
|
||||
startActivityFinish(intent)
|
||||
}
|
||||
@@ -187,6 +190,7 @@ class AddPairedSuccessActivity :
|
||||
pet.petType = ConstantInt.DogPetType
|
||||
pet.gender = ConstantInt.WoMan
|
||||
pet.macID = mMac
|
||||
pet.deviceType = mType
|
||||
pet.birthdayDate = "2024-01-01"
|
||||
pet.height = Utils.formatDecimal(Util.inToCm(20.0), 1).toFloat()
|
||||
pet.weight = Utils.formatDecimal(Util.lbsToKg(25.0), 1).toFloat()
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.abbidot.tracker.ui.activity.device.wifi
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.wifi.WifiManager
|
||||
import android.provider.Settings
|
||||
import android.view.View
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.commit
|
||||
@@ -9,6 +12,7 @@ import com.abbidot.baselibrary.eventbus.XEventBus
|
||||
import com.abbidot.tracker.R
|
||||
import com.abbidot.tracker.base.BaseActivity
|
||||
import com.abbidot.tracker.bean.PetBean
|
||||
import com.abbidot.tracker.constant.ConstantInt
|
||||
import com.abbidot.tracker.constant.ConstantString
|
||||
import com.abbidot.tracker.databinding.ActivityAddWifiPowerZone2Binding
|
||||
import com.abbidot.tracker.ui.activity.HomeV2Activity
|
||||
@@ -73,15 +77,24 @@ class AddWifiPowerZone2Activity :
|
||||
val petAddressData = mWifiZone2MapCommon.getDecWiFiAddressData()
|
||||
if (null == petAddressData || petAddressData.latitude == 0.0 || petAddressData.longitude == 0.0) {
|
||||
} else {
|
||||
val intent = Intent(mContext, AddWifiPowerZone3Activity::class.java)
|
||||
mPetBean?.let { pet ->
|
||||
intent.putExtra(ConstantString.Pet, pet)
|
||||
mPetBean?.let {
|
||||
if (it.deviceType == ConstantInt.Type2) {
|
||||
val wifiManager =
|
||||
applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager
|
||||
if (!wifiManager.isWifiEnabled) {
|
||||
val intent = Intent(Settings.ACTION_WIFI_SETTINGS)
|
||||
startActivity(intent)
|
||||
return
|
||||
}
|
||||
}
|
||||
val intent = Intent(mContext, AddWifiPowerZone3Activity::class.java)
|
||||
intent.putExtra(ConstantString.Pet, it)
|
||||
intent.putExtra(ConstantString.Latitude, mPetCurrentLat)
|
||||
intent.putExtra(ConstantString.Longitude, mPetCurrentLon)
|
||||
intent.putExtra(ConstantString.isFirstBind, isFirstBind)
|
||||
intent.putExtra(ConstantString.HistoryDataBean, petAddressData)
|
||||
startActivity(intent)
|
||||
}
|
||||
intent.putExtra(ConstantString.Latitude, mPetCurrentLat)
|
||||
intent.putExtra(ConstantString.Longitude, mPetCurrentLon)
|
||||
intent.putExtra(ConstantString.isFirstBind, isFirstBind)
|
||||
intent.putExtra(ConstantString.HistoryDataBean, petAddressData)
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
package com.abbidot.tracker.ui.activity.device.wifi
|
||||
|
||||
import android.animation.AnimatorSet
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.wifi.ScanResult
|
||||
import android.net.wifi.WifiManager
|
||||
import android.os.Build
|
||||
import android.provider.Settings
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.activity.viewModels
|
||||
import com.abbidot.baselibrary.constant.ConState
|
||||
import com.abbidot.baselibrary.constant.EventName
|
||||
import com.abbidot.baselibrary.eventbus.XEventBus
|
||||
@@ -16,21 +24,27 @@ import com.abbidot.tracker.bean.BleTrackDeviceBean
|
||||
import com.abbidot.tracker.bean.HistoryDataBean
|
||||
import com.abbidot.tracker.bean.PetBean
|
||||
import com.abbidot.tracker.bean.ReceiveDeviceData
|
||||
import com.abbidot.tracker.bean.WiFiBean
|
||||
import com.abbidot.tracker.bean.WiFiBleListBean
|
||||
import com.abbidot.tracker.constant.ConstantInt
|
||||
import com.abbidot.tracker.constant.ConstantString
|
||||
import com.abbidot.tracker.databinding.ActivityAddWifiPowerZone3Binding
|
||||
import com.abbidot.tracker.util.Util
|
||||
import com.abbidot.tracker.util.ViewUtil
|
||||
import com.abbidot.tracker.util.bluetooth.SRBleCmdUtil
|
||||
import com.abbidot.tracker.util.bluetooth.SRBleUtil
|
||||
import com.abbidot.tracker.vm.CountDownTimerViewModel
|
||||
import com.clj.fastble.BleManager
|
||||
import com.google.gson.Gson
|
||||
import com.hjq.permissions.permission.PermissionLists
|
||||
import java.util.Locale
|
||||
|
||||
|
||||
class AddWifiPowerZone3Activity :
|
||||
BaseActivity<ActivityAddWifiPowerZone3Binding>(ActivityAddWifiPowerZone3Binding::inflate) {
|
||||
|
||||
// private lateinit var mWifiManager: WifiManager
|
||||
private val mCountDownTimerViewModel: CountDownTimerViewModel by viewModels()
|
||||
private lateinit var mWifiManager: WifiManager
|
||||
private lateinit var mWiFiListAdapter: WiFiListAdapter
|
||||
|
||||
//解析后json数据
|
||||
@@ -47,6 +61,7 @@ class AddWifiPowerZone3Activity :
|
||||
private var mPetCurrentLon = 0.0
|
||||
|
||||
private var mAnimatorSet: AnimatorSet? = null
|
||||
private var mWifiList = mutableListOf<WiFiBean>()
|
||||
|
||||
override fun getTopBar() = mViewBinding.ilAddWifiZone3TopBar.titleTopBar
|
||||
|
||||
@@ -69,7 +84,7 @@ class AddWifiPowerZone3Activity :
|
||||
if (null == mPetBean) finish()
|
||||
|
||||
mGson = Gson()
|
||||
// mWifiManager = applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager
|
||||
mWifiManager = applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager
|
||||
|
||||
mViewBinding.apply {
|
||||
mWiFiListAdapter = WiFiListAdapter(mContext, null).apply {
|
||||
@@ -108,6 +123,8 @@ class AddWifiPowerZone3Activity :
|
||||
showLoading(true, R.string.txt_please_wait)
|
||||
mRightImageButton?.let {
|
||||
it.isEnabled = false
|
||||
mCountDownTimerViewModel.stopCountDown()
|
||||
mCountDownTimerViewModel.startCountDown(15)
|
||||
mAnimatorSet = ViewUtil.instance.viewRotationAnimator(it, true)
|
||||
mViewBinding.rvAddWifiZone3WifiNetwork.visibility = View.GONE
|
||||
mViewBinding.lavAddWifiZone3Anim.playAnimation()
|
||||
@@ -122,6 +139,9 @@ class AddWifiPowerZone3Activity :
|
||||
}
|
||||
|
||||
override fun liveDataObserve() {
|
||||
mCountDownTimerViewModel.mCountDownEndLiveData.observe(this) {
|
||||
showToast(R.string.txt_time_out_try_again, true)
|
||||
}
|
||||
//添加成功结束页面
|
||||
XEventBus.observe(this, EventName.RefreshWiFiZone) {
|
||||
finish()
|
||||
@@ -206,12 +226,15 @@ class AddWifiPowerZone3Activity :
|
||||
val wifiList = mGson.fromJson(
|
||||
mReceiveWifiJsonData, WiFiBleListBean::class.java
|
||||
)
|
||||
mWiFiListAdapter.setData(wifiList.wifi, true)
|
||||
mPetBean?.let {
|
||||
mWifiList = wifiList.wifi
|
||||
if (it.deviceType == ConstantInt.Type2) {
|
||||
checkPermission()
|
||||
} else {
|
||||
showWifiData(mWifiList)
|
||||
}
|
||||
}
|
||||
|
||||
showLoading(false)
|
||||
mViewBinding.rvAddWifiZone3WifiNetwork.visibility = View.VISIBLE
|
||||
mViewBinding.lavAddWifiZone3Anim.cancelAnimation()
|
||||
mViewBinding.lavAddWifiZone3Anim.visibility = View.GONE
|
||||
} catch (_: Exception) {
|
||||
sendWiFiCmd()
|
||||
}
|
||||
@@ -219,12 +242,21 @@ class AddWifiPowerZone3Activity :
|
||||
} else {
|
||||
mAnimatorSet?.cancel()
|
||||
mRightImageButton?.isEnabled = true
|
||||
showToast(R.string.no_data)
|
||||
showToast(R.string.txt_time_out_try_again, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun showWifiData(list: MutableList<WiFiBean>) {
|
||||
mCountDownTimerViewModel.stopCountDown()
|
||||
mWiFiListAdapter.setData(list, true)
|
||||
showLoading(false)
|
||||
mViewBinding.rvAddWifiZone3WifiNetwork.visibility = View.VISIBLE
|
||||
mViewBinding.lavAddWifiZone3Anim.cancelAnimation()
|
||||
mViewBinding.lavAddWifiZone3Anim.visibility = View.GONE
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新设备连接状态
|
||||
*/
|
||||
@@ -237,25 +269,48 @@ class AddWifiPowerZone3Activity :
|
||||
}
|
||||
}
|
||||
|
||||
// private fun checkPermission() {
|
||||
// //从 Android 6.0(API 23)开始,定位权限现在被用于 Wi-Fi 扫描
|
||||
// Util.checkPermissions(mContext, object : Util.RequestPermissionCallback {
|
||||
// override fun onRequestPermissionSuccess() {
|
||||
// addListData()
|
||||
// }
|
||||
//
|
||||
// override fun onRequestPermissionFail() {
|
||||
// showToast(R.string.txt_wifi_permission)
|
||||
// }
|
||||
// }, getString(R.string.txt_wifi_permission), Manifest.permission.ACCESS_FINE_LOCATION)
|
||||
// }
|
||||
private fun checkPermission() {
|
||||
//从 Android 6.0(API 23)开始,定位权限现在被用于 Wi-Fi 扫描
|
||||
Util.checkPermissions(
|
||||
mContext, object : Util.RequestPermissionCallback {
|
||||
override fun onRequestPermissionSuccess() {
|
||||
addListData()
|
||||
}
|
||||
|
||||
override fun onRequestPermissionFail() {
|
||||
showToast(R.string.permissions_die_easy_photos)
|
||||
}
|
||||
}, "wifi", PermissionLists.getAccessFineLocationPermission()
|
||||
)
|
||||
}
|
||||
|
||||
private fun addListData() {
|
||||
val list = getConnectedWifiSSID()
|
||||
val wifiList = mutableListOf<WiFiBean>()
|
||||
if (!list.isNullOrEmpty()) {
|
||||
for (bleWifi in mWifiList) {
|
||||
for (wifi in list) {
|
||||
if (bleWifi.mac.uppercase(Locale.getDefault()) == wifi.BSSID.uppercase(Locale.getDefault())) {
|
||||
val wifiName = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
wifi.wifiSsid.toString()
|
||||
} else {
|
||||
wifi.SSID
|
||||
}
|
||||
bleWifi.name = wifiName.replace("\"", "")
|
||||
wifiList.add(bleWifi)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (wifiList.size > 0) {
|
||||
showWifiData(wifiList)
|
||||
} else {
|
||||
showToast(R.string.txt_time_out_try_again, true)
|
||||
}
|
||||
}
|
||||
|
||||
// private fun addListData() {
|
||||
// val list = getConnectedWifiSSID()
|
||||
// mWiFiListAdapter.setData(list, true)
|
||||
// }
|
||||
|
||||
/*
|
||||
/**
|
||||
* 接收开启wifi操作
|
||||
*/
|
||||
@@ -276,7 +331,6 @@ class AddWifiPowerZone3Activity :
|
||||
// val intent = Intent(Settings.Panel.ACTION_WIFI)
|
||||
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
// startActivity(intent)
|
||||
|
||||
val intent = Intent(Settings.Panel.ACTION_WIFI)
|
||||
launchActivity(mActivityResultLauncher, intent)
|
||||
} else {
|
||||
@@ -285,7 +339,7 @@ class AddWifiPowerZone3Activity :
|
||||
}
|
||||
return null
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
when (v!!) {
|
||||
|
||||
@@ -31,6 +31,8 @@ class ChoosePlanActivity :
|
||||
|
||||
//是否是升级套餐
|
||||
private var isUpgrade = false
|
||||
//设备类型
|
||||
private var mType = ConstantInt.Type1
|
||||
|
||||
//设备充值类型,0=首次设备充值激活,1=已添加设备再次添加设备充值,2=给当前的设备续费或者升级套餐
|
||||
private var mRechargeType = ConstantInt.Type1
|
||||
@@ -45,6 +47,7 @@ class ChoosePlanActivity :
|
||||
mOrderBean = Util.getParcelableAdaptive(
|
||||
intent, ConstantString.LkSetMeal, SubscriptionsOrderBean::class.java
|
||||
)
|
||||
mType = getInt(ConstantString.Type, ConstantInt.Type1)
|
||||
isUpgrade = getBoolean(ConstantString.Upgrade, false)
|
||||
mRechargeType = getInt(ConstantString.RechargeType, ConstantInt.Type1)
|
||||
}
|
||||
@@ -149,6 +152,7 @@ class ChoosePlanActivity :
|
||||
it.putExtra(ConstantString.SetMeal, cPlan)
|
||||
it.putExtra(ConstantString.Upgrade, isUpgrade)
|
||||
it.putExtra(ConstantString.LkSetMeal, mOrderBean)
|
||||
it.putExtra(ConstantString.Type, mType)
|
||||
it.putExtra(ConstantString.RechargeType, mRechargeType)
|
||||
startActivity(it)
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@ class PaymentMethodActivity :
|
||||
var mRechargeType = ConstantInt.Type1
|
||||
lateinit var mFragments: MutableList<Fragment>
|
||||
|
||||
//设备类型
|
||||
var mType = ConstantInt.Type1
|
||||
|
||||
override fun getTopBar() = mViewBinding.ilPaymentMethodTopBar.titleTopBar
|
||||
|
||||
override fun initData() {
|
||||
@@ -36,6 +39,7 @@ class PaymentMethodActivity :
|
||||
mOrderBean = Util.getParcelableAdaptive(
|
||||
intent, ConstantString.LkSetMeal, SubscriptionsOrderBean::class.java
|
||||
)
|
||||
mType = getInt(ConstantString.Type, ConstantInt.Type1)
|
||||
mRechargeType = getInt(ConstantString.RechargeType, ConstantInt.Type1)
|
||||
}
|
||||
|
||||
@@ -54,8 +58,8 @@ class PaymentMethodActivity :
|
||||
|
||||
vp2SwitchPaymentMethod.let {
|
||||
it.adapter = ViewPagerAdapter(mFragments, this@PaymentMethodActivity)
|
||||
ViewUtil.instance.setViewPager2Config(it,
|
||||
object : ViewPager2.OnPageChangeCallback() {
|
||||
ViewUtil.instance.setViewPager2Config(
|
||||
it, object : ViewPager2.OnPageChangeCallback() {
|
||||
override fun onPageSelected(position: Int) {
|
||||
super.onPageSelected(position)
|
||||
when (position) {
|
||||
|
||||
@@ -184,6 +184,9 @@ class PaymentSuccessActivity :
|
||||
pet.petType = ConstantInt.DogPetType
|
||||
pet.gender = ConstantInt.WoMan
|
||||
pet.macID = mMac
|
||||
mPayResult?.let { p ->
|
||||
pet.deviceType = p.deviceType
|
||||
}
|
||||
pet.birthdayDate = "2024-01-01"
|
||||
pet.height = Utils.formatDecimal(Util.inToCm(20.0), 1).toFloat()
|
||||
pet.weight = Utils.formatDecimal(Util.lbsToKg(25.0), 1).toFloat()
|
||||
|
||||
@@ -38,6 +38,9 @@ class SubscriptionPlanActivity :
|
||||
//设备充值类型,0=首次设备充值激活,1=已添加设备再次添加设备充值,2=给当前的设备续费或者升级套餐
|
||||
private var mRechargeType = ConstantInt.Type1
|
||||
|
||||
//设备类型
|
||||
private var mType = ConstantInt.Type1
|
||||
|
||||
override fun getTopBar() = mViewBinding.subscribePlanTopBar.titleTopBar
|
||||
|
||||
override fun initData() {
|
||||
@@ -49,6 +52,7 @@ class SubscriptionPlanActivity :
|
||||
mOrderBean = Util.getParcelableAdaptive(
|
||||
intent, ConstantString.LkSetMeal, SubscriptionsOrderBean::class.java
|
||||
)
|
||||
mType = getInt(ConstantString.Type, ConstantInt.Type1)
|
||||
val isFirstBind = getBoolean(ConstantString.isFirstBind, false)
|
||||
mRechargeType = getInt(ConstantString.RechargeType, ConstantInt.Type1)
|
||||
if (isFirstBind) mRechargeType = ConstantInt.Type0
|
||||
@@ -131,6 +135,7 @@ class SubscriptionPlanActivity :
|
||||
ConstantString.Title, mPlanAdapter.getData()[mSelectPlanIndex].name
|
||||
)
|
||||
it.putExtra(ConstantString.LkSetMeal, mOrderBean)
|
||||
it.putExtra(ConstantString.Type, mType)
|
||||
it.putExtra(ConstantString.RechargeType, mRechargeType)
|
||||
startActivity(it)
|
||||
}
|
||||
|
||||
@@ -62,6 +62,8 @@ class SureSubscriptionPlanActivity :
|
||||
|
||||
//升级套餐还剩下多少差价
|
||||
private var mResidualMoney = 0.0
|
||||
//设备类型
|
||||
private var mType = ConstantInt.Type1
|
||||
|
||||
private lateinit var mSummaryAdapter: SureSubscribeSummaryAdapter
|
||||
|
||||
@@ -78,6 +80,7 @@ class SureSubscriptionPlanActivity :
|
||||
mOrderBean = Util.getParcelableAdaptive(
|
||||
intent, ConstantString.LkSetMeal, SubscriptionsOrderBean::class.java
|
||||
)
|
||||
mType = getInt(ConstantString.Type, ConstantInt.Type1)
|
||||
isUpgrade = getBoolean(ConstantString.Upgrade, false)
|
||||
mRechargeType = getInt(ConstantString.RechargeType, ConstantInt.Type1)
|
||||
}
|
||||
@@ -467,6 +470,7 @@ class SureSubscriptionPlanActivity :
|
||||
totalAmountWithTax = Utils.formatDecimal(mTotalWithTaxMoney, 2).toDouble()
|
||||
Intent(mContext, PaymentMethodActivity::class.java).let {
|
||||
it.putExtra(ConstantString.LkSetMeal, this)
|
||||
it.putExtra(ConstantString.Type, mType)
|
||||
it.putExtra(ConstantString.RechargeType, mRechargeType)
|
||||
startActivity(it)
|
||||
}
|
||||
|
||||
@@ -448,7 +448,6 @@ class HomeTrackFragment :
|
||||
getHomeV2Activity()?.let {
|
||||
it.getPet()?.apply {
|
||||
if (isSwitchPet) {
|
||||
|
||||
isSwitchPet = false
|
||||
mTrackStateList[5].apply {
|
||||
state = ConstantInt.Type0
|
||||
@@ -575,7 +574,15 @@ class HomeTrackFragment :
|
||||
ble.bleDevice, SRBleCmdUtil.instance.getFirmwareVersion()
|
||||
)
|
||||
} else {
|
||||
|
||||
findItem(
|
||||
mTrackMenuList, getString(R.string.txt_firmware_version)
|
||||
)?.let { m ->
|
||||
if (TextUtils.isEmpty(m.menuValue)) {
|
||||
SRBleUtil.instance.writeData(
|
||||
ble.bleDevice, SRBleCmdUtil.instance.getFirmwareVersion()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.abbidot.tracker.ui.fragment.map.googlemap
|
||||
|
||||
import android.animation.ValueAnimator
|
||||
import android.content.Context
|
||||
import android.text.TextUtils
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.animation.LinearInterpolator
|
||||
@@ -100,11 +101,12 @@ class HomeMapGoogleMapFragmentV3 : BaseGoogleMapFragment() {
|
||||
// mMarker?.tag = history
|
||||
|
||||
// showMarkerInfoWindow(history)
|
||||
val address = if (inWifiZone == ConstantInt.Type1) {
|
||||
mContext!!.getString(R.string.txt_home) + " · $it"
|
||||
} else {
|
||||
String.format(mContext!!.getString(R.string.txt_near), it)
|
||||
}
|
||||
val address =
|
||||
if (inWifiZone == ConstantInt.Type1 && !TextUtils.isEmpty(wifiZoneName)) {
|
||||
"$wifiZoneName · $it"
|
||||
} else {
|
||||
String.format(mContext!!.getString(R.string.txt_near), it)
|
||||
}
|
||||
ViewUtil.instance.viewShow(mPetLocationLayoutBinding.root)
|
||||
mPetLocationLayoutBinding.let { layout ->
|
||||
layout.tvPetLocationReverseGeocode.text = address
|
||||
|
||||
@@ -133,10 +133,11 @@ class CreditCardPaymentFragment : BaseFragment<FragmentCreditCardPaymentBinding>
|
||||
override fun onResult(any: Any) {
|
||||
it.getOrNull()?.apply {
|
||||
val intent = Intent(mContext, PaymentSuccessActivity::class.java)
|
||||
this.rechargeType = mPaymentMethodActivity.mRechargeType
|
||||
rechargeType = mPaymentMethodActivity.mRechargeType
|
||||
mPaymentMethodActivity.mOrderBean?.let { o ->
|
||||
this.deviceId = o.deviceId
|
||||
deviceId = o.deviceId
|
||||
}
|
||||
deviceType = mPaymentMethodActivity.mType
|
||||
intent.putExtra(ConstantString.Amount, this)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
@@ -49,11 +49,13 @@ class PaypalPaymentFragment :
|
||||
ConstantString.Title, getString(R.string.txt_pay_order_payment_title)
|
||||
)
|
||||
intent.putExtra(ConstantString.Url, url)
|
||||
this.rechargeType = mPaymentMethodActivity.mRechargeType
|
||||
rechargeType = mPaymentMethodActivity.mRechargeType
|
||||
deviceType = mPaymentMethodActivity.mType
|
||||
mPaymentMethodActivity.mOrderBean?.let { o ->
|
||||
this.deviceId = o.deviceId
|
||||
deviceId = o.deviceId
|
||||
}
|
||||
intent.putExtra(ConstantString.Amount, this)
|
||||
|
||||
mPaymentMethodActivity.startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ class SRBleUtil private constructor() {
|
||||
UUID.fromString("6e400005-b5a3-f393-e0a9-e50e24dcca9e").toString()
|
||||
|
||||
//保存已连接成功设备的全局变量
|
||||
lateinit var mTrackDeviceList: MutableList<BleTrackDeviceBean>
|
||||
private val mTrackDeviceList = mutableListOf<BleTrackDeviceBean>()
|
||||
private var mContext: Context? = null
|
||||
|
||||
//SRBleUtil单例模式
|
||||
@@ -102,7 +102,6 @@ class SRBleUtil private constructor() {
|
||||
BleManager.getInstance().init(app)
|
||||
//是否显示框架内部日志,重连次数和重连时间间隔,以及操作超时时间。
|
||||
BleManager.getInstance().enableLog(AppUtils.isDebug()).operateTimeout = 5000
|
||||
mTrackDeviceList = mutableListOf()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -235,7 +234,9 @@ class SRBleUtil private constructor() {
|
||||
} else if (data0 == 0x24) {
|
||||
LogUtil.e("${bleDevice.mac},蓝牙透传消息")
|
||||
if (null == mSocketUtilManage) mSocketUtilManage = SocketUtilManageV2()
|
||||
mSocketUtilManage?.initEasySocket(mContext!!, bleDevice.mac, data)
|
||||
mContext?.let {
|
||||
mSocketUtilManage?.initEasySocket(it, bleDevice.mac, data)
|
||||
}
|
||||
} else {
|
||||
val deviceData = ReceiveDeviceData(bleDevice, data, bleDevice.mac)
|
||||
XEventBus.post(EventName.DeviceReceiveData, deviceData)
|
||||
|
||||
Reference in New Issue
Block a user