diff --git a/app/src/main/java/com/idormy/sms/forwarder/entity/MsgInfo.kt b/app/src/main/java/com/idormy/sms/forwarder/entity/MsgInfo.kt index c7f09f19..c089ce67 100644 --- a/app/src/main/java/com/idormy/sms/forwarder/entity/MsgInfo.kt +++ b/app/src/main/java/com/idormy/sms/forwarder/entity/MsgInfo.kt @@ -221,13 +221,19 @@ data class MsgInfo( //替换 {{定位信息}} 标签 private fun replaceLocationTag(content: String, needJson: Boolean = false): String { if (TextUtils.isEmpty(content)) return content - if (content.indexOf(getString(R.string.tag_location)) == -1) return content + //if (content.indexOf(getString(R.string.tag_location)) == -1) return content - var location = HttpServerUtils.apiLocationCache.toString() + val location = HttpServerUtils.apiLocationCache + var locationStr = location.toString() + var address = location.address if (needJson) { - location = jsonInnerStr(location) + locationStr = jsonInnerStr(locationStr) + address = jsonInnerStr(address) } - return content.replace(getString(R.string.tag_location), location) + return content.replace(getString(R.string.tag_location), locationStr) + .replace(getString(R.string.tag_location_longitude), location.longitude.toString()) + .replace(getString(R.string.tag_location_latitude), location.latitude.toString()) + .replace(getString(R.string.tag_location_address), address) } private fun jsonInnerStr(string: String?): String { diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml index b0a2f79b..e4ab68b8 100644 --- a/app/src/main/res/values-en/strings.xml +++ b/app/src/main/res/values-en/strings.xml @@ -622,6 +622,9 @@ {{SCHEME}} {{CALL_TYPE}} {{LOCATION}} + {{LOCATION_LONGITUDE}} + {{LOCATION_LATITUDE}} + {{LOCATION_ADDRESS}} {{BATTERY_PCT}} {{BATTERY_STATUS}} {{BATTERY_PLUGGED}} diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index b0b2493f..ac035f04 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -623,6 +623,9 @@ {{通知Scheme}} {{通话类型}} {{定位信息}} + {{定位信息_经度}} + {{定位信息_纬度}} + {{定位信息_地址}} {{电池电量}} {{电池状态}} {{充电方式}} diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 18c75224..6e082363 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -623,6 +623,9 @@ {{通知Scheme}} {{通話類型}} {{定位信息}} + {{定位信息_經度}} + {{定位信息_緯度}} + {{定位信息_地址}} {{電池電量}} {{電池狀態}} {{充電方式}} diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 75ef00fc..71e87a03 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -623,6 +623,9 @@ {{通知Scheme}} {{通话类型}} {{定位信息}} + {{定位信息_经度}} + {{定位信息_纬度}} + {{定位信息_地址}} {{电池电量}} {{电池状态}} {{充电方式}}