1.优化反地理编码逻辑,百度失败就用Mapbox,Mapbox失败就用百度

2.修复开启直播成功的提示被宠物在附近覆盖
3.优化注册页面隐私和条款多语言显示
This commit is contained in:
2026-09-21 10:22:35 +08:00
parent 2ad8d82cc0
commit d45315e6b8
10 changed files with 82 additions and 81 deletions

View File

@@ -59,6 +59,7 @@ data class SubscriptionsOrderBean(
var isRefundable: Int,//是否显示退款按钮 1:是 0:否
@MultipleEntity var menuType: Int,
var renewNum: String,
var paymentMethodInfo: String,
var createUserId: String,//这个订单是由哪个用户创建的
var isUpdateOrder: Int = 0//是否是升级订单 1:是 0:否
) : Parcelable, MultiItemEntity {
@@ -107,7 +108,7 @@ data class SubscriptionsOrderBean(
0L,
0,
0,
menuType, "", "",
menuType, "", "", "",
0
)
@@ -156,7 +157,7 @@ data class SubscriptionsOrderBean(
0L,
0,
0,
MultipleEntity.TEXT, "", "",
MultipleEntity.TEXT, "", "", "",
0
)

View File

@@ -86,6 +86,7 @@ class SplashActivity : QMUIActivity() {
// 清除所有通知,角标数字
notificationManager.cancelAll()
//获取服务器请求密钥
val encodedAppSecret = Util.getMetadata(applicationContext, KeyNames.HTTP_REQUEST_KEY)
val sb = StringBuilder(encodedAppSecret)
sb.deleteCharAt(5)
@@ -267,7 +268,6 @@ class SplashActivity : QMUIActivity() {
if (AppUtils.isChina()) {
regToWx()
} else {
initMapbox()
try {
//stripe支付
val stripeKey = ThirdPartyUtil.instance.getStripeKey(applicationContext)
@@ -277,17 +277,13 @@ class SplashActivity : QMUIActivity() {
}
}
if (AppUtils.isDebug()) {
//方便调试测试只使用谷歌地图情况
initMapbox()
}
//腾讯bugly初始化
// val buglyKey = Util.getMetadata(applicationContext, KeyNames.BUG_LY_KEY_NAME)
// CrashReport.initCrashReport(applicationContext, buglyKey, AppUtils.isDebug())
}
private fun initMapbox() {
// private fun initMapbox() {
// try {
// val mapboxAccessToken =
// Util.getMetadata(applicationContext, KeyNames.MAPBOX_ACCESS_TOKEN)
@@ -297,7 +293,7 @@ class SplashActivity : QMUIActivity() {
// } catch (e: Exception) {
// LogUtil.e("MapboxSearchSdk initialize多次初始化异常")
// }
}
// }
/**
* 注册到微信

View File

@@ -121,8 +121,8 @@ class LiveActivityV3 : BaseActivity<ActivityLiveV3Binding>(ActivityLiveV3Binding
//直播时间 分钟
private var mLiveTime = 5
private lateinit var mSpeedUnit: String
private lateinit var mDistanceUnit: String
private var mSpeedUnit: String = ""
private var mDistanceUnit: String = ""
//是否打开了找设备的声音
private var isOpenSound = false
@@ -173,6 +173,7 @@ class LiveActivityV3 : BaseActivity<ActivityLiveV3Binding>(ActivityLiveV3Binding
isLiveJump
) { mapLoadOk() }
//修改百度地图定位时间间隔15秒
if (AppUtils.isChina()) BaiduLocationManager.setScanSpan(15)
ViewUtil.instance.setMapSwitchLocationButtonImage(

View File

@@ -40,6 +40,7 @@ class RefundDetailsActivity :
mSetMealBean?.let {
tvRefundDetailsPlanName.text = it.mealName
tvRefundDetailsOrderId.text = it.renewNum
tvRefundDetailsPaidMethod.text = it.paymentMethodInfo
tvRefundDetailsRefundAmount.text =
String.format(getString(R.string.txt_money_unit), "${it.totalAmountWithTax}")
tvRefundDetailsOrderTime.text =

View File

@@ -58,54 +58,16 @@ class CreateAccountV2OneFragment : BaseFragment<FragmentCreateAccountV2OneBindin
mContext!!,
it.rlEtInputLayout,
tvEmailErrorTipCreateAccountV2,
it.etInputContent, true
it.etInputContent,
true
)
}
val privacyAndTerms = getString(R.string.txt_read_and_accept)
setSpannableClick(
setOnClickListenerViews(
btnCreateAccountV2Continue,
ilCreateAccountV2PolicyTermsCheck.tvLoginAgreePrivacyContent,
privacyAndTerms.substringBeforeLast("Te"),
privacyAndTerms.substringAfterLast("&")
ilCreateAccountV2PolicyTermsCheck.tvLoginAgreeTermsContent
)
setOnClickListenerViews(btnCreateAccountV2Continue)
}
}
private fun setSpannableClick(textView: TextView, str1: String, str2: String) {
try {
textView.apply {
val span1 = SpannableString(str1)
span1.setSpan(object : ClickableSpan() {
override fun onClick(v: View) {
ViewUtil.instance.goHtmlAssetContent(
mActivity!!,
getString(R.string.txt_privacy_policy),
getString(R.string.txt_privacy_html)
)
}
}, 7, 21, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
val span2 = SpannableString(str2)
span2.setSpan(object : ClickableSpan() {
override fun onClick(v: View) {
ViewUtil.instance.goHtmlAssetContent(
mActivity!!,
getString(R.string.txt_service_contract),
getString(R.string.txt_terms_html)
)
}
}, 1, 6, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
val spannableStringBuilder = SpannableStringBuilder()
spannableStringBuilder.append(span1)
spannableStringBuilder.append(span2)
text = spannableStringBuilder
movementMethod = LinkMovementMethod.getInstance()
}
} catch (e: Exception) {
LogUtil.e("解析同意隐私政策错误${e.message}")
}
}
@@ -174,9 +136,19 @@ class CreateAccountV2OneFragment : BaseFragment<FragmentCreateAccountV2OneBindin
override fun onClick(v: View?) {
mViewBinding.apply {
when (v!!) {
btnCreateAccountV2Continue -> {
continueClick()
}
btnCreateAccountV2Continue -> continueClick()
ilCreateAccountV2PolicyTermsCheck.tvLoginAgreePrivacyContent -> ViewUtil.instance.goHtmlAssetContent(
mActivity!!,
getString(R.string.txt_privacy_policy),
getString(R.string.txt_privacy_html)
)
ilCreateAccountV2PolicyTermsCheck.tvLoginAgreeTermsContent -> ViewUtil.instance.goHtmlAssetContent(
mActivity!!,
getString(R.string.txt_service_contract),
getString(R.string.txt_terms_html)
)
}
}
}

View File

@@ -423,10 +423,10 @@ class MapV3Fragment : BaseFragment<FragmentMapV3Binding>(FragmentMapV3Binding::i
val data1 = SRBleCmdUtil.instance.byteToInt(data[1])
// val data2 = SRBleCmdUtil.instance.byteToInt(data[2])
if (data0 == 0x2C && data1 == 1) {
stopRefreshLocation()
getHomeV2Activity()?.getPet(false)?.let {
mMapViewModel.getMapDeviceStatus(it.deviceId, false)
}
stopRefreshLocation()
}
}
}

View File

@@ -52,6 +52,9 @@ class GeoCoderViewModel : ViewModel() {
//是否显示详细地址信息
private var isShowDetailAddress = true
//百度反地理失败是否切换为mapbox反地理编码/mapbox反地理失败是否切换为百度反地理编码,默认切换
private var isChangeWayAgain = true
/**
* 反地理编码
* 使用原生gps(WGS84)坐标
@@ -69,7 +72,7 @@ class GeoCoderViewModel : ViewModel() {
}
mLon = longitude
mLat = latitude
isChangeWayAgain = true
if (AppUtils.isChina(AppUtils.SWITCH_MAP_TYPE)) {
baiduMapReverseGeocoder(latitude, longitude)
} else {
@@ -96,9 +99,11 @@ class GeoCoderViewModel : ViewModel() {
), object : SearchCallback {
override fun onError(e: Exception) {
LogUtil.e(" Mapbox反地理编码error,${e.message}")
// mLatLonAddressLiveData.value = ""
if (isChangeWayAgain) {
isChangeWayAgain = false
baiduMapReverseGeocoder(latitude, longitude)
}
}
override fun onResults(
results: List<SearchResult>, responseInfo: ResponseInfo
@@ -152,10 +157,12 @@ class GeoCoderViewModel : ViewModel() {
LogUtil.e("Mapbox反地理编码:$mAddress")
mLatLonAddressLiveData.value = mAddress
} else {
// mLatLonAddressLiveData.value = ""-
if (isChangeWayAgain) {
isChangeWayAgain = false
baiduMapReverseGeocoder(latitude, longitude)
}
}
}
})
}
@@ -174,6 +181,10 @@ class GeoCoderViewModel : ViewModel() {
override fun onGetReverseGeoCodeResult(result: ReverseGeoCodeResult?) {
if (null == result || result.error != com.baidu.mapapi.search.core.SearchResult.ERRORNO.NO_ERROR) {
LogUtil.e("百度地图反向地理编码没有找到检索结果,${result?.error}")
if (isChangeWayAgain) {
isChangeWayAgain = false
mapBoxReverseGeocoder(latitude, longitude)
}
//没有找到检索结果
return
} else {

View File

@@ -35,11 +35,20 @@
layout="@layout/layout_map_device_battery" />
</androidx.appcompat.widget.LinearLayoutCompat>
<include
android:id="@+id/il_live_v3_map_device_msg"
layout="@layout/item_home_map_device_msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_6"
android:visibility="gone" />
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout
android:id="@+id/ll_live_v2_state_layout"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_34"
android:layout_below="@id/il_live_v3_map_device_msg"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_8"
android:gravity="center_vertical"
@@ -66,15 +75,6 @@
</com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout>
<include
android:id="@+id/il_live_v3_map_device_msg"
layout="@layout/item_home_map_device_msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_6"
android:visibility="gone" />
<com.abbidot.tracker.widget.NonSwipeRecyclerView
android:id="@+id/rv_map_live_v2_device_state"
android:layout_width="match_parent"

View File

@@ -1,29 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatCheckBox
android:id="@+id/cb_login_agree_privacy_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="0dp"
android:minWidth="0dp"
android:minHeight="0dp"
android:text="@string/register_txt_agree1"
android:textColor="@color/select_color3"
android:textSize="0sp" />
android:textSize="@dimen/textSize12" />
<com.abbidot.tracker.widget.TypefaceTextView
android:id="@+id/tv_login_agree_privacy_content"
style="@style/my_TextView_style"
android:layout_width="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="@dimen/dp_32"
android:layout_marginEnd="@dimen/dp_2"
android:gravity="start"
android:text="@string/txt_read_and_accept"
android:layout_marginHorizontal="@dimen/dp_2"
android:text="@string/txt_privacy_policy"
android:textColor="@color/txt_policy_color"
android:textSize="@dimen/textSize12"
app:typeface="@string/roboto_regular_font" />
<com.abbidot.tracker.widget.TypefaceTextView
style="@style/my_TextView_style"
android:layout_width="wrap_content"
android:text="@string/register_txt_agree2"
android:textColor="@color/select_color3"
android:textSize="@dimen/textSize12"
app:typeface="@string/roboto_regular_font" />
</RelativeLayout>
<com.abbidot.tracker.widget.TypefaceTextView
android:id="@+id/tv_login_agree_terms_content"
style="@style/my_TextView_style"
android:layout_width="wrap_content"
android:layout_marginHorizontal="@dimen/dp_2"
android:text="@string/register_txt_terms"
android:textColor="@color/txt_policy_color"
android:textSize="@dimen/textSize12"
app:typeface="@string/roboto_regular_font" />
</androidx.appcompat.widget.LinearLayoutCompat>

View File

@@ -1032,4 +1032,5 @@
<string name="txt_refund_failed">Refund Failed</string>
<string name="txt_refund_declined">Refund Declined</string>
<string name="txt_refund_pending">Refund Pending</string>
</resources>