mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-08 13:27:57 +00:00
[android] Expected "Show on map" search button behaviour.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
committed by
Konstantin Pastbin
parent
bbb28107b8
commit
1151f0fb75
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -372,4 +372,10 @@ extern "C"
|
||||
{
|
||||
g_framework->NativeFramework()->GetSearchAPI().CancelAllSearches();
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_app_organicmaps_sdk_search_SearchEngine_nativeUpdateViewportWithLastResults(JNIEnv * env, jclass clazz)
|
||||
{
|
||||
g_framework->NativeFramework()->UpdateViewport(g_results);
|
||||
}
|
||||
} // extern "C"
|
||||
|
||||
Reference in New Issue
Block a user