diff --git a/gradle.properties b/gradle.properties
index 959943cd..fa5046fa 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -2,4 +2,4 @@ org.gradle.jvmargs=-Xmx2048m
org.gradle.configureondemand=false
android.useAndroidX=true
libGroup=com.adevinta.android
-libVersion=10.0.2
+libVersion=10.0.3
\ No newline at end of file
diff --git a/leku/src/main/java/com/adevinta/leku/LocationPickerActivity.kt b/leku/src/main/java/com/adevinta/leku/LocationPickerActivity.kt
index bbaeaa73..1ef137d3 100644
--- a/leku/src/main/java/com/adevinta/leku/LocationPickerActivity.kt
+++ b/leku/src/main/java/com/adevinta/leku/LocationPickerActivity.kt
@@ -170,6 +170,8 @@ class LocationPickerActivity :
private var clearLocationButton: ImageButton? = null
private var searchEditLayout: LinearLayout? = null
private var searchFrameLayout: FrameLayout? = null
+ private var suggestionsToast: Toast? = null
+ private var locationsToast: Toast? = null
private val locationList = ArrayList
()
private val suggestionList = ArrayList()
@@ -810,11 +812,15 @@ class LocationPickerActivity :
changeListResultVisibility(View.GONE)
}
+ private fun makeEmptyResultsToast(): Toast =
+ Toast.makeText(applicationContext, R.string.leku_no_search_results, Toast.LENGTH_LONG)
+
override fun showLocations(addresses: List) {
fillLocationList(addresses)
if (addresses.isEmpty()) {
- Toast.makeText(applicationContext, R.string.leku_no_search_results, Toast.LENGTH_LONG)
- .show()
+ locationsToast?.cancel()
+ locationsToast = makeEmptyResultsToast()
+ locationsToast!!.show()
} else {
updateLocationNameList(addresses)
if (hasWiderZoom) {
@@ -834,8 +840,9 @@ class LocationPickerActivity :
override fun showSuggestions(suggestions: List) {
fillSuggestionList(suggestions)
if (suggestions.isEmpty()) {
- Toast.makeText(applicationContext, R.string.leku_no_search_results, Toast.LENGTH_LONG)
- .show()
+ suggestionsToast?.cancel()
+ suggestionsToast = makeEmptyResultsToast()
+ suggestionsToast!!.show()
} else {
updateSuggestionNameList(suggestions)
if (hasWiderZoom) {