[android] Expected "Show on map" search button behaviour.

Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
Viktor Govako
2025-07-12 22:21:55 -03:00
committed by Konstantin Pastbin
parent bbb28107b8
commit 1151f0fb75
5 changed files with 29 additions and 40 deletions

View File

@@ -190,6 +190,12 @@ public enum SearchEngine implements SearchListener, MapSearchListener,
nativeShowResult(index);
}
@MainThread
public void updateViewportWithLastResults()
{
nativeUpdateViewportWithLastResults();
}
public void initialize()
{
nativeInit();
@@ -224,4 +230,6 @@ public enum SearchEngine implements SearchListener, MapSearchListener,
private static native void nativeCancelEverywhereSearch();
private static native void nativeCancelAllSearches();
private static native void nativeUpdateViewportWithLastResults();
}

View File

@@ -430,6 +430,8 @@ public class SearchFragment extends BaseMwmFragment implements SearchListener, C
void showAllResultsOnMap()
{
SearchEngine.INSTANCE.updateViewportWithLastResults();
// The previous search should be cancelled before the new one is started, since previous search
// results are no longer needed.
SearchEngine.INSTANCE.cancel();