1. wifi zone定位点设置,改为拖动地图设置
2.添加被绑定设备增加提示被绑定的邮箱
This commit is contained in:
@@ -570,16 +570,24 @@ abstract class BaseActivity<T : ViewBinding>(val inflater: (inflater: LayoutInfl
|
||||
val exceptionMessage = it.exceptionOrNull()?.message
|
||||
//服务器返回错误code
|
||||
val exceptionCode: String? = it.exceptionOrNull()?.toString()
|
||||
LogUtil.d("Throwable?", "code=${exceptionCode},${exceptionMessage}")
|
||||
LogUtil.d("Throwable异常", "code=${exceptionCode},${exceptionMessage}")
|
||||
if (null != exceptionCode) {
|
||||
//处理注册用户已存在的情况
|
||||
if (exceptionCode == ErrorCode.USER_HAS_EXIST.toString()) {
|
||||
getResultCallback.onRequestError(exceptionCode)
|
||||
}
|
||||
|
||||
if (exceptionCode == ErrorCode.DEVICE_HAS_BIND.toString()) {
|
||||
val str =
|
||||
String.format(getString(R.string.txt_device_has_bind), exceptionMessage)
|
||||
showToast(str)
|
||||
getResultCallback.onInterceptCode()
|
||||
return
|
||||
}
|
||||
//拦截请求异常code
|
||||
if (netErrorCodeTips(exceptionCode, isShowCodeError)) {
|
||||
else if (netErrorCodeTips(exceptionCode, isShowCodeError)) {
|
||||
//已经处理相关错误码就直接返回
|
||||
getResultCallback.onErrorCode()
|
||||
getResultCallback.onInterceptCode()
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -685,10 +693,10 @@ abstract class BaseActivity<T : ViewBinding>(val inflater: (inflater: LayoutInfl
|
||||
return true
|
||||
}
|
||||
//该设备已被绑定
|
||||
ErrorCode.DEVICE_HAS_BIND.toString() -> {
|
||||
if (isShowCodeError) showToast(R.string.txt_device_has_bind)
|
||||
return true
|
||||
}
|
||||
// ErrorCode.DEVICE_HAS_BIND.toString() -> {
|
||||
// if (isShowCodeError) showToast(R.string.txt_device_has_bind)
|
||||
// return true
|
||||
// }
|
||||
//设备不存在
|
||||
ErrorCode.DEVICE_NOT_EXIST.toString() -> {
|
||||
if (isShowCodeError) showToast(R.string.txt_no_dfu)
|
||||
|
||||
@@ -9,12 +9,16 @@ import kotlinx.parcelize.Parcelize
|
||||
* @description:设备详情
|
||||
*/
|
||||
@Parcelize
|
||||
data class DeviceDetailBean(var deviceOutId: String,
|
||||
var deviceId: String,
|
||||
var macId: String,
|
||||
var pet: PetBean?,
|
||||
var fenceCount: Int,
|
||||
var surplusDays: Int,
|
||||
var familieCount: Int,var deviceInfo:DeviceInfoBean?) : Parcelable {
|
||||
constructor() : this("", "", "", null, 0, 0,0,null)
|
||||
data class DeviceDetailBean(
|
||||
var deviceOutId: String,
|
||||
var deviceId: String,
|
||||
var macId: String,
|
||||
var email: String,
|
||||
var pet: PetBean?,
|
||||
var fenceCount: Int,
|
||||
var surplusDays: Int,
|
||||
var familieCount: Int,
|
||||
var deviceInfo: DeviceInfoBean?
|
||||
) : Parcelable {
|
||||
constructor() : this("", "", "", "", null, 0, 0, 0, null)
|
||||
}
|
||||
|
||||
@@ -10,5 +10,6 @@ interface GetResultCallback {
|
||||
|
||||
//默认可以不重写,相当于java中的default修饰的
|
||||
fun onRequestError(exceptionCode: String?) {}
|
||||
fun onErrorCode() {}
|
||||
//已拦截的code
|
||||
fun onInterceptCode() {}
|
||||
}
|
||||
@@ -91,7 +91,7 @@ class NotificationV2Activity :
|
||||
}
|
||||
}
|
||||
|
||||
override fun onErrorCode() {
|
||||
override fun onInterceptCode() {
|
||||
mPullAction?.let { p ->
|
||||
mViewBinding.ilNotificationV2MessageLayout.pullRefreshAndLoadMoreLayout.finishActionRun(
|
||||
p
|
||||
|
||||
@@ -135,8 +135,8 @@ class AddNewTracker3Activity :
|
||||
}
|
||||
}
|
||||
|
||||
override fun onErrorCode() {
|
||||
super.onErrorCode()
|
||||
override fun onInterceptCode() {
|
||||
super.onInterceptCode()
|
||||
mViewBinding.ivAddNewTracker3RefreshBtn.isEnabled = true
|
||||
setNoConnectState()
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ class LedLightActivity : BaseActivity<ActivityLedLightBinding>(ActivityLedLightB
|
||||
setLedControlState()
|
||||
}
|
||||
|
||||
override fun onErrorCode() {
|
||||
override fun onInterceptCode() {
|
||||
setLedControlState()
|
||||
}
|
||||
})
|
||||
@@ -177,7 +177,7 @@ class LedLightActivity : BaseActivity<ActivityLedLightBinding>(ActivityLedLightB
|
||||
setLedModeControlState()
|
||||
}
|
||||
|
||||
override fun onErrorCode() {
|
||||
override fun onInterceptCode() {
|
||||
setLedModeControlState()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -377,7 +377,7 @@ class LiveActivityV3 : BaseActivity<ActivityLiveV3Binding>(ActivityLiveV3Binding
|
||||
}
|
||||
}
|
||||
|
||||
override fun onErrorCode() {
|
||||
override fun onInterceptCode() {
|
||||
setButtonEnabled(
|
||||
mViewBinding.ilLiveV2OperateLayout.llLiveV2StopLive, ConstantInt.Type1
|
||||
)
|
||||
@@ -468,7 +468,7 @@ class LiveActivityV3 : BaseActivity<ActivityLiveV3Binding>(ActivityLiveV3Binding
|
||||
}
|
||||
}
|
||||
|
||||
override fun onErrorCode() {
|
||||
override fun onInterceptCode() {
|
||||
setErrorLedState()
|
||||
}
|
||||
|
||||
|
||||
@@ -415,7 +415,7 @@ class HomeTrackFragment :
|
||||
}
|
||||
}
|
||||
|
||||
override fun onErrorCode() {
|
||||
override fun onInterceptCode() {
|
||||
setLedErrorState()
|
||||
}
|
||||
|
||||
|
||||
@@ -271,7 +271,7 @@ class MapV3Fragment : BaseFragment<FragmentMapV3Binding>(FragmentMapV3Binding::i
|
||||
mMapViewModel.updateMillisInFuture(0.05f)
|
||||
}
|
||||
|
||||
override fun onErrorCode() {
|
||||
override fun onInterceptCode() {
|
||||
stopRefreshLocation()
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.abbidot.tracker.bean.HistoryDataBean
|
||||
import com.abbidot.tracker.vm.GeoCoderViewModel
|
||||
import com.google.android.gms.maps.GoogleMap
|
||||
import com.google.android.gms.maps.model.LatLng
|
||||
import com.google.android.gms.maps.model.Marker
|
||||
|
||||
/**
|
||||
*Created by .yzq on 2024/6/4/004.
|
||||
@@ -34,26 +33,33 @@ class WiFiZone2GoogleMapFragment : BaseGoogleMapFragment() {
|
||||
mDecWifiAddressData = HistoryDataBean()
|
||||
|
||||
googleMap.apply {
|
||||
setOnMarkerDragListener(object : GoogleMap.OnMarkerDragListener {
|
||||
override fun onMarkerDrag(marker: Marker) {
|
||||
// setOnMarkerDragListener(object : GoogleMap.OnMarkerDragListener {
|
||||
// override fun onMarkerDrag(marker: Marker) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// override fun onMarkerDragEnd(marker: Marker) {
|
||||
// marker.position.let {
|
||||
// val newLatLng = toGpsLatLon(LatLng(it.latitude, it.longitude))
|
||||
// geoCoderLatLon(newLatLng.latitude, newLatLng.longitude)
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// override fun onMarkerDragStart(marker: Marker) {
|
||||
// }
|
||||
// })
|
||||
//
|
||||
// setOnMapLongClickListener { latLng ->
|
||||
// mMarker?.position = latLng
|
||||
// val newLatLng = toGpsLatLon(latLng)
|
||||
// geoCoderLatLon(newLatLng.latitude, newLatLng.longitude)
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
override fun onMarkerDragEnd(marker: Marker) {
|
||||
marker.position.let {
|
||||
val newLatLng = toGpsLatLon(LatLng(it.latitude, it.longitude))
|
||||
geoCoderLatLon(newLatLng.latitude, newLatLng.longitude)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMarkerDragStart(marker: Marker) {
|
||||
}
|
||||
})
|
||||
|
||||
setOnMapLongClickListener { latLng ->
|
||||
mMarker?.position = latLng
|
||||
val newLatLng = toGpsLatLon(latLng)
|
||||
geoCoderLatLon(newLatLng.latitude, newLatLng.longitude)
|
||||
setOnCameraIdleListener {
|
||||
getCameraCenterLatLng(this, true)
|
||||
}
|
||||
setOnCameraMoveListener {
|
||||
getCameraCenterLatLng(this)
|
||||
}
|
||||
|
||||
//点击地图任意地方都不消失自定义头部地点布局
|
||||
@@ -80,6 +86,16 @@ class WiFiZone2GoogleMapFragment : BaseGoogleMapFragment() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun getCameraCenterLatLng(googleMap: GoogleMap, isNeedGeoCoder: Boolean = false) {
|
||||
googleMap.cameraPosition.let {
|
||||
mMarker?.position = it.target
|
||||
if (isNeedGeoCoder) {
|
||||
val newLatLng = toGpsLatLon(it.target)
|
||||
geoCoderLatLon(newLatLng.latitude, newLatLng.longitude)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun geoCoderLatLon(latitude: Double, longitude: Double) {
|
||||
mDecWifiAddressData?.apply {
|
||||
this.latitude = latitude
|
||||
@@ -91,10 +107,10 @@ class WiFiZone2GoogleMapFragment : BaseGoogleMapFragment() {
|
||||
override fun locationSuccess(location: Location?) {
|
||||
location?.apply {
|
||||
val latLng = LatLng(latitude, longitude)
|
||||
moveCameraLocation(latLng, true)
|
||||
moveCameraLocation(latLng)
|
||||
if (null == mMarker) {
|
||||
mMarker = addImageMarker(
|
||||
latLng, R.drawable.icon_location_svg, anchorCenter = false, isDraggable = true
|
||||
latLng, R.drawable.icon_location_svg, anchorCenter = false
|
||||
)
|
||||
} else mMarker?.position = latLng
|
||||
geoCoderLatLon(latitude, longitude)
|
||||
|
||||
@@ -327,7 +327,7 @@ public final class BrowserView extends WebView {
|
||||
DialogUtils.Companion.showEditTextDialog(mWebView.getContext(), message, defaultValue
|
||||
, new GetResultCallback() {
|
||||
@Override
|
||||
public void onErrorCode() {
|
||||
public void onInterceptCode() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -398,7 +398,7 @@
|
||||
<string name="txt_upgrade_start">Vorbereitung des Updates</string>
|
||||
<string name="txt_device_connect_success">Gerät erfolgreich verbunden</string>
|
||||
<string name="txt_latest_version">Aktuell neueste Version</string>
|
||||
<string name="txt_device_has_bind">Tracker ist mit anderem Konto gekoppelt</string>
|
||||
<string name="txt_device_has_bind">Der Tracker ist mit %s gekoppelt.</string>
|
||||
<string name="txt_activity">Aktivität</string>
|
||||
<string name="txt_route">Route</string>
|
||||
<string name="txt_pet">Haustier</string>
|
||||
|
||||
@@ -442,7 +442,7 @@
|
||||
<string name="txt_upgrade_start">准备升级</string>
|
||||
<string name="txt_device_connect_success">设备连接成功</string>
|
||||
<string name="txt_latest_version">已是最新版本</string>
|
||||
<string name="txt_device_has_bind">该设备已被绑定</string>
|
||||
<string name="txt_device_has_bind">该设备已被%s绑定</string>
|
||||
<string name="txt_activity">活动</string>
|
||||
<string name="txt_route">路线</string>
|
||||
<string name="txt_pet">宠物</string>
|
||||
|
||||
@@ -500,7 +500,7 @@
|
||||
<string name="txt_upgrade_start">Preparing for Upgrade</string>
|
||||
<string name="txt_device_connect_success">Device successfully connected</string>
|
||||
<string name="txt_latest_version">Already latest version</string>
|
||||
<string name="txt_device_has_bind">The tracker is paired with another account</string>
|
||||
<string name="txt_device_has_bind">The tracker is paired with %s.</string>
|
||||
<string name="txt_activity">Activity</string>
|
||||
<string name="txt_route">Route</string>
|
||||
<string name="txt_pet">Pet</string>
|
||||
|
||||
Reference in New Issue
Block a user