From a582b6875769ae94218b16e2883550c1a9065727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=97=D0=B0=D1=86=D0=B5=D0=BF=D0=B8=D0=BD?= Date: Tue, 27 Feb 2018 15:18:05 +0300 Subject: [PATCH] [android] Fixed booking filtration in viewport on tablet --- android/jni/com/mapswithme/maps/SearchEngine.cpp | 3 +++ android/src/com/mapswithme/maps/MwmActivity.java | 3 +++ android/src/com/mapswithme/maps/search/SearchFragment.java | 2 ++ partners_api/booking_api.cpp | 2 +- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/android/jni/com/mapswithme/maps/SearchEngine.cpp b/android/jni/com/mapswithme/maps/SearchEngine.cpp index b27966ec55..53ab960921 100644 --- a/android/jni/com/mapswithme/maps/SearchEngine.cpp +++ b/android/jni/com/mapswithme/maps/SearchEngine.cpp @@ -572,6 +572,9 @@ extern "C" eparams.m_onResults = bind(&OnResults, _1, _2, timestamp, isMapAndTable, false /* hasPosition */, 0.0 /* lat */, 0.0 /* lon */); eparams.m_hotelsFilter = vparams.m_hotelsFilter; + eparams.m_bookingFilterParams.m_params = g_lastBookingFilterParams; + eparams.m_bookingFilterParams.m_callback = bind(&OnBookingFilterResults, _1, _2); + if (g_framework->NativeFramework()->SearchEverywhere(eparams)) g_queryTimestamp = timestamp; } diff --git a/android/src/com/mapswithme/maps/MwmActivity.java b/android/src/com/mapswithme/maps/MwmActivity.java index 004fa35f72..f1a123c5cf 100644 --- a/android/src/com/mapswithme/maps/MwmActivity.java +++ b/android/src/com/mapswithme/maps/MwmActivity.java @@ -610,7 +610,10 @@ public class MwmActivity extends BaseMwmFragmentActivity private void runSearch() { + // The previous search should be cancelled before the new one is started, since previous search + // results are no longer needed. SearchEngine.cancel(); + SearchEngine.searchInteractive(mSearchController.getQuery(), System.nanoTime(), false /* isMapAndTable */, mFilterController != null ? mFilterController.getFilter() : null, diff --git a/android/src/com/mapswithme/maps/search/SearchFragment.java b/android/src/com/mapswithme/maps/search/SearchFragment.java index fc44add663..f7b523fb54 100644 --- a/android/src/com/mapswithme/maps/search/SearchFragment.java +++ b/android/src/com/mapswithme/maps/search/SearchFragment.java @@ -610,6 +610,8 @@ public class SearchFragment extends BaseMwmFragment private void runSearch() { + // The previous search should be cancelled before the new one is started, since previous search + // results are no longer needed. SearchEngine.cancel(); HotelsFilter hotelsFilter = null; diff --git a/partners_api/booking_api.cpp b/partners_api/booking_api.cpp index fe209b6877..b0dd18efcd 100644 --- a/partners_api/booking_api.cpp +++ b/partners_api/booking_api.cpp @@ -432,7 +432,7 @@ void Api::GetHotelInfo(string const & hotelId, string const & lang, } catch (my::Json::Exception const & e) { - LOG(LERROR, ("Failed to parse json:", result, e.what())); + LOG(LERROR, ("Failed to parse json:", hotelId, result, e.what())); ClearHotelInfo(info); }