Skip to content

Commit

Permalink
ALS-1702 Broken display on attribution bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shah272728 committed Oct 6, 2023
1 parent d1ef9de commit cc5733a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import com.aws.amazonlocation.ui.main.web_view.WebViewActivity
import com.aws.amazonlocation.utils.KEY_MAP_NAME
import com.aws.amazonlocation.utils.KEY_URL
import com.aws.amazonlocation.utils.MAP_STYLE_ATTRIBUTION
import com.aws.amazonlocation.utils.attributionPattern

class AttributionFragment : BaseFragment() {

Expand Down Expand Up @@ -46,10 +47,12 @@ class AttributionFragment : BaseFragment() {

private fun init() {
mBinding.apply {
tvAttribution.text = mPreferenceManager.getValue(MAP_STYLE_ATTRIBUTION, getString(R.string.esri))
tvAttribution.text =
mPreferenceManager.getValue(MAP_STYLE_ATTRIBUTION, getString(R.string.esri))
?.replace(Regex(attributionPattern), "") ?: ""

}
}

private fun initClick() {
mBinding.apply {
btnLearnMoreSa.setOnClickListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3367,6 +3367,7 @@ class ExploreFragment :
mBinding.apply {
bottomSheetAttribution.apply {
tvAttribution.text = mPreferenceManager.getValue(MAP_STYLE_ATTRIBUTION, getString(R.string.esri))
?.replace(Regex(attributionPattern), "") ?: ""
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ val regionDisplayName = arrayListOf("Automatic", "Europe (Ireland) eu-west-1", "
* eg 2> "49.281174, -123.116823" > Check LAT_LNG_REG_EXP > return true
*/
const val LAT_LNG_REG_EXP = "([+-]?\\d+\\.?\\d+)\\s*,\\s*([+-]?\\d+\\.?\\d+)"
const val attributionPattern = "<a[^>]*>|</a>"

const val GEOFENCE_NAME_REG_EXP = "^[-._\\p{L}\\p{N}]+\$"
const val userPoolIdPattern = "[\\w-]+_[0-9a-zA-Z]+"
Expand Down

0 comments on commit cc5733a

Please sign in to comment.