diff --git a/app/src/main/java/com/aws/amazonlocation/ui/main/attribution/AttributionFragment.kt b/app/src/main/java/com/aws/amazonlocation/ui/main/attribution/AttributionFragment.kt index 89011317..f412e5c1 100644 --- a/app/src/main/java/com/aws/amazonlocation/ui/main/attribution/AttributionFragment.kt +++ b/app/src/main/java/com/aws/amazonlocation/ui/main/attribution/AttributionFragment.kt @@ -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() { @@ -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 { diff --git a/app/src/main/java/com/aws/amazonlocation/ui/main/explore/ExploreFragment.kt b/app/src/main/java/com/aws/amazonlocation/ui/main/explore/ExploreFragment.kt index 05a09134..ae104d4c 100644 --- a/app/src/main/java/com/aws/amazonlocation/ui/main/explore/ExploreFragment.kt +++ b/app/src/main/java/com/aws/amazonlocation/ui/main/explore/ExploreFragment.kt @@ -3367,6 +3367,7 @@ class ExploreFragment : mBinding.apply { bottomSheetAttribution.apply { tvAttribution.text = mPreferenceManager.getValue(MAP_STYLE_ATTRIBUTION, getString(R.string.esri)) + ?.replace(Regex(attributionPattern), "") ?: "" } } } diff --git a/app/src/main/java/com/aws/amazonlocation/utils/Constants.kt b/app/src/main/java/com/aws/amazonlocation/utils/Constants.kt index 7415cdf1..fb9c4884 100644 --- a/app/src/main/java/com/aws/amazonlocation/utils/Constants.kt +++ b/app/src/main/java/com/aws/amazonlocation/utils/Constants.kt @@ -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 = "]*>|" const val GEOFENCE_NAME_REG_EXP = "^[-._\\p{L}\\p{N}]+\$" const val userPoolIdPattern = "[\\w-]+_[0-9a-zA-Z]+"