[android] Remove UGC, guides, booking, taxi

Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
Roman Tsisyk 2021-04-17 15:09:36 +03:00
parent c44f883621
commit 9ecde05d09
424 changed files with 1028 additions and 33142 deletions

View file

@ -2,7 +2,6 @@
<manifest
package="com.mapswithme.maps"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:installLocation="auto">
<uses-feature
@ -31,10 +30,6 @@
<uses-permission android:name="android.permission.BATTERY_STATS"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<!-- Temporary disable in-app purchases //-->
<uses-permission android:name="com.android.vending.BILLING" tools:node="remove" />
<!-- -->
<supports-screens
android:largeScreens="true"
@ -116,20 +111,6 @@
android:scheme="mapswithme"/>
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:host="dlink.maps.me"
android:scheme="https"/>
<data
android:host="dlink.mapsme.devmail.ru"
android:scheme="https"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
@ -198,11 +179,6 @@
android:configChanges="screenLayout|screenSize"
android:label="@string/app_name"/>
<activity
android:name="com.mapswithme.maps.bookmarks.BookmarksCatalogActivity"
android:configChanges="orientation|screenLayout|screenSize"
android:label="@string/guides_catalogue_title"/>
<activity-alias
android:name="com.mapswithme.maps.DownloadResourcesActivity"
android:label="@string/app_name"
@ -241,7 +217,7 @@
<activity
android:name="com.mapswithme.maps.bookmarks.BookmarkCategoriesActivity"
android:configChanges="orientation|screenLayout|screenSize"
android:label="@string/bookmarks_guides"
android:label="@string/bookmarks"
android:parentActivityName="com.mapswithme.maps.MwmActivity"
android:windowSoftInputMode="adjustResize" />
@ -275,69 +251,14 @@
android:parentActivityName="com.mapswithme.maps.MwmActivity" />
<activity
android:name="com.mapswithme.maps.gallery.GalleryActivity"
android:parentActivityName="com.mapswithme.maps.MwmActivity" />
<activity
android:name="com.mapswithme.maps.gallery.FullScreenGalleryActivity"
android:parentActivityName="com.mapswithme.maps.MwmActivity" />
<activity
android:name=".discovery.DiscoveryActivity"
android:parentActivityName=".MwmActivity" />
<activity
android:name="com.mapswithme.maps.auth.PhoneAuthActivity"
android:configChanges="orientation|screenLayout|screenSize|keyboardHidden"
android:label="@string/authorization_button_sign_in"/>
<activity
android:name="com.mapswithme.maps.gdpr.MwmOptOutActivity"
android:label="@string/subtittle_opt_out"
android:configChanges="keyboardHidden|orientation|screenSize">
</activity>
<activity
android:name="com.mapswithme.maps.ugc.routes.UgcRouteTagsActivity"
android:label="@string/ugc_route_tags_screen_label">
</activity>
<activity
android:name="com.mapswithme.maps.ugc.routes.UgcRouteSharingOptionsActivity"
android:label="@string/sharing_options"/>
<activity
android:name="com.mapswithme.maps.ugc.routes.UgcRouteEditSettingsActivity"
android:name="com.mapswithme.maps.bookmarks.BookmarkCategorySettingsActivity"
android:label="@string/list_settings"/>
<activity android:name=".purchase.BookmarkPaymentActivity"/>
<activity android:name="com.mapswithme.maps.ugc.routes.SendLinkPlaceholderActivity"/>
<activity
android:name="com.mapswithme.maps.ugc.routes.UgcRoutePropertiesActivity"
android:label="@string/select_properties"/>
<activity
android:name="com.mapswithme.maps.widget.placepage.PlaceDescriptionActivity"
android:label="@string/place_description_title"/>
<activity
android:name="com.mapswithme.maps.bookmarks.description.BookmarksDescriptionActivity"
android:label="@string/description_guide"/>
<activity
android:name="com.mapswithme.maps.ugc.routes.EditCategoryNameActivity"
android:label="@string/name"/>
<activity
android:name="com.mapswithme.maps.ugc.routes.EditCategoryDescriptionActivity"
android:label="@string/description_guide"/>
<activity
android:name="com.mapswithme.maps.settings.DrivingOptionsActivity"
android:label="@string/driving_options_title"/>
<activity
android:name="com.mapswithme.maps.purchase.BookmarkSubscriptionActivity"
android:screenOrientation="portrait"
android:configChanges="orientation|screenLayout|screenSize|keyboardHidden"/>
<activity
android:name="com.mapswithme.maps.purchase.BookmarksAllSubscriptionActivity"
android:screenOrientation="portrait"
android:configChanges="orientation|screenLayout|screenSize|keyboardHidden"/>
<activity
android:name="com.mapswithme.maps.purchase.BookmarksSightsSubscriptionActivity"
android:screenOrientation="portrait"
android:configChanges="orientation|screenLayout|screenSize|keyboardHidden"/>
<service
android:name="com.mapswithme.maps.background.WorkerService"
android:permission="android.permission.BIND_JOB_SERVICE"
@ -358,15 +279,6 @@
android:permission="android.permission.BIND_JOB_SERVICE"
android:exported="false"/>
<!-- our custom receiver, that will call Aloha & other handlers -->
<receiver
android:name="com.mapswithme.util.MultipleTrackerReferrerReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER"/>
</intent-filter>
</receiver>
<receiver
android:name="com.mapswithme.maps.bookmarks.SystemDownloadCompletedReceiver"
android:exported="true">

View file

@ -105,7 +105,6 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.work:work-runtime:2.2.0'
implementation 'com.android.billingclient:billing:1.1'
implementation('uk.co.samuelwall:material-tap-target-prompt:3.1.0', {
exclude group: 'androidx.lifecycle', module: 'lifecycle-extensions'
})

View file

@ -26,10 +26,7 @@ set(
com/mapswithme/core/logging.hpp
com/mapswithme/core/ScopedEnv.hpp
com/mapswithme/core/ScopedLocalRef.hpp
com/mapswithme/maps/discovery/Locals.hpp
com/mapswithme/maps/Framework.hpp
com/mapswithme/maps/guides/Guides.hpp
com/mapswithme/maps/promo/Promo.hpp
com/mapswithme/maps/SearchEngine.hpp
com/mapswithme/opengl/android_gl_utils.hpp
com/mapswithme/opengl/androidoglcontext.hpp
@ -44,16 +41,12 @@ set(
com/mapswithme/core/jni_helper.cpp
com/mapswithme/core/logging.cpp
com/mapswithme/maps/bookmarks/data/BookmarkManager.cpp
com/mapswithme/maps/discovery/DiscoveryManager.cpp
com/mapswithme/maps/discovery/Locals.cpp
com/mapswithme/maps/DisplayedCategories.cpp
com/mapswithme/maps/DownloadResourcesLegacyActivity.cpp
com/mapswithme/maps/editor/Editor.cpp
com/mapswithme/maps/editor/OpeningHours.cpp
com/mapswithme/maps/editor/OsmOAuth.cpp
com/mapswithme/maps/Framework.cpp
com/mapswithme/maps/guides/Guides.cpp
com/mapswithme/maps/guides/GuidesManager.cpp
com/mapswithme/maps/isolines/IsolinesManager.cpp
com/mapswithme/maps/LightFramework.cpp
com/mapswithme/maps/LocationHelper.cpp
@ -61,17 +54,13 @@ set(
com/mapswithme/maps/MapFragment.cpp
com/mapswithme/maps/MapManager.cpp
com/mapswithme/maps/MwmApplication.cpp
com/mapswithme/maps/onboarding/Onboarding.cpp
com/mapswithme/maps/PrivateVariables.cpp
com/mapswithme/maps/promo/Promo.cpp
com/mapswithme/maps/routing/RoutingOptions.cpp
com/mapswithme/maps/SearchEngine.cpp
com/mapswithme/maps/SearchRecents.cpp
com/mapswithme/maps/settings/UnitLocale.cpp
com/mapswithme/maps/sound/tts.cpp
com/mapswithme/maps/Sponsored.cpp
com/mapswithme/maps/subway/SubwayManager.cpp
com/mapswithme/maps/taxi/TaxiManager.cpp
com/mapswithme/maps/TrackRecorder.cpp
com/mapswithme/maps/TrafficState.cpp
com/mapswithme/maps/UserMarkHelper.cpp

View file

@ -21,7 +21,6 @@ jclass g_httpClientClazz;
jclass g_httpParamsClazz;
jclass g_platformSocketClazz;
jclass g_utilsClazz;
jclass g_ratingClazz;
jclass g_loggerFactoryClazz;
jclass g_keyValueClazz;
jclass g_httpUploaderClazz;
@ -49,7 +48,6 @@ JNI_OnLoad(JavaVM * jvm, void *)
g_httpParamsClazz = jni::GetGlobalClassRef(env, "com/mapswithme/util/HttpClient$Params");
g_platformSocketClazz = jni::GetGlobalClassRef(env, "com/mapswithme/maps/location/PlatformSocket");
g_utilsClazz = jni::GetGlobalClassRef(env, "com/mapswithme/util/Utils");
g_ratingClazz = jni::GetGlobalClassRef(env, "com/mapswithme/maps/ugc/UGC$Rating");
g_loggerFactoryClazz = jni::GetGlobalClassRef(env, "com/mapswithme/util/log/LoggerFactory");
g_keyValueClazz = jni::GetGlobalClassRef(env, "com/mapswithme/util/KeyValue");
g_httpUploaderClazz = jni::GetGlobalClassRef(env, "com/mapswithme/util/HttpUploader");
@ -76,7 +74,6 @@ JNI_OnUnload(JavaVM *, void *)
env->DeleteGlobalRef(g_httpParamsClazz);
env->DeleteGlobalRef(g_platformSocketClazz);
env->DeleteGlobalRef(g_utilsClazz);
env->DeleteGlobalRef(g_ratingClazz);
env->DeleteGlobalRef(g_loggerFactoryClazz);
env->DeleteGlobalRef(g_keyValueClazz);
env->DeleteGlobalRef(g_httpUploaderClazz);

View file

@ -22,7 +22,6 @@ extern jclass g_httpClientClazz;
extern jclass g_httpParamsClazz;
extern jclass g_platformSocketClazz;
extern jclass g_utilsClazz;
extern jclass g_ratingClazz;
extern jclass g_loggerFactoryClazz;
extern jclass g_keyValueClazz;
extern jclass g_httpUploaderClazz;

View file

@ -1,7 +1,6 @@
#include "com/mapswithme/maps/Framework.hpp"
#include "com/mapswithme/core/jni_helper.hpp"
#include "com/mapswithme/maps/guides/Guides.hpp"
#include "com/mapswithme/maps/UserMarkHelper.hpp"
#include "com/mapswithme/opengl/androidoglcontextfactory.hpp"
#include "com/mapswithme/platform/Platform.hpp"
@ -12,10 +11,6 @@
#include "map/chart_generator.hpp"
#include "map/everywhere_search_params.hpp"
#include "map/user_mark.hpp"
#include "map/purchase.hpp"
#include "web_api/utils.hpp"
#include "storage/storage_defines.hpp"
#include "storage/storage_helpers.hpp"
@ -118,7 +113,6 @@ Framework::Framework()
m_work.GetTrafficManager().SetStateListener(bind(&Framework::TrafficStateChanged, this, _1));
m_work.GetTransitManager().SetStateListener(bind(&Framework::TransitSchemeStateChanged, this, _1));
m_work.GetIsolinesManager().SetStateListener(bind(&Framework::IsolinesSchemeStateChanged, this, _1));
m_work.GetGuidesManager().SetStateListener(bind(&Framework::GuidesLayerStateChanged, this, _1));
m_work.GetPowerManager().Subscribe(this);
}
@ -170,12 +164,6 @@ void Framework::IsolinesSchemeStateChanged(IsolinesManager::IsolinesState state)
m_onIsolinesStateChangedFn(state);
}
void Framework::GuidesLayerStateChanged(GuidesManager::GuidesState state)
{
if (m_onGuidesStateChangedFn)
m_onGuidesStateChangedFn(state);
}
bool Framework::DestroySurfaceOnDetach()
{
if (m_vulkanContextFactory)
@ -624,11 +612,6 @@ void Framework::SetIsolinesListener(IsolinesManager::IsolinesStateChangedFn cons
m_onIsolinesStateChangedFn = function;
}
void Framework::SetGuidesListener(GuidesManager::GuidesStateChangedFn const & function)
{
m_onGuidesStateChangedFn = function;
}
bool Framework::IsTrafficEnabled()
{
return m_work.GetTrafficManager().IsEnabled();
@ -705,24 +688,6 @@ place_page::Info & Framework::GetPlacePageInfo()
return m_work.GetCurrentPlacePageInfo();
}
void Framework::RequestBookingMinPrice(JNIEnv * env, jobject policy,
booking::BlockParams && params,
booking::BlockAvailabilityCallback const & callback)
{
auto const bookingApi = m_work.GetBookingApi(ToNativeNetworkPolicy(env, policy));
if (bookingApi)
bookingApi->GetBlockAvailability(move(params), callback);
}
void Framework::RequestBookingInfo(JNIEnv * env, jobject policy,
string const & hotelId, string const & lang,
booking::GetHotelInfoCallback const & callback)
{
auto const bookingApi = m_work.GetBookingApi(ToNativeNetworkPolicy(env, policy));
if (bookingApi)
bookingApi->GetHotelInfo(hotelId, lang, callback);
}
bool Framework::IsAutoRetryDownloadFailed()
{
return m_work.GetDownloadingPolicy().IsAutoRetryDownloadFailed();
@ -738,89 +703,11 @@ void Framework::EnableDownloadOn3g()
m_work.GetDownloadingPolicy().EnableCellularDownload(true);
}
uint64_t Framework::RequestTaxiProducts(JNIEnv * env, jobject policy, ms::LatLon const & from,
ms::LatLon const & to,
taxi::SuccessCallback const & onSuccess,
taxi::ErrorCallback const & onError)
{
auto const taxiEngine = m_work.GetTaxiEngine(ToNativeNetworkPolicy(env, policy));
if (!taxiEngine)
return 0;
return taxiEngine->GetAvailableProducts(from, to, onSuccess, onError);
}
taxi::RideRequestLinks Framework::GetTaxiLinks(JNIEnv * env, jobject policy, taxi::Provider::Type type,
string const & productId, ms::LatLon const & from,
ms::LatLon const & to)
{
auto const taxiEngine = m_work.GetTaxiEngine(ToNativeNetworkPolicy(env, policy));
if (!taxiEngine)
return {};
return taxiEngine->GetRideRequestLinks(type, productId, from, to);
}
int Framework::ToDoAfterUpdate() const
{
return (int) m_work.ToDoAfterUpdate();
}
uint64_t Framework::GetLocals(JNIEnv * env, jobject policy, double lat, double lon,
locals::LocalsSuccessCallback const & successFn,
locals::LocalsErrorCallback const & errorFn)
{
auto api = NativeFramework()->GetLocalsApi(ToNativeNetworkPolicy(env, policy));
if (api == nullptr)
return 0;
std::string const langStr = languages::GetCurrentNorm();
size_t constexpr kResultsOnPage = 5;
size_t constexpr kPageNumber = 1;
return api->GetLocals(lat, lon, langStr, kResultsOnPage, kPageNumber, successFn, errorFn);
}
void Framework::GetPromoCityGallery(JNIEnv * env, jobject policy,
m2::PointD const & point, UTM utm,
promo::CityGalleryCallback const & onSuccess,
promo::OnError const & onError)
{
auto api = NativeFramework()->GetPromoApi(ToNativeNetworkPolicy(env, policy));
if (api == nullptr)
{
onError();
return;
}
api->GetCityGallery(point, languages::GetCurrentNorm(), utm, onSuccess, onError);
}
void Framework::GetPromoPoiGallery(JNIEnv * env, jobject policy,
m2::PointD const & point, promo::Tags const & tags,
bool useCoordinates, UTM utm,
promo::CityGalleryCallback const & onSuccess,
promo::OnError const & onError)
{
auto api = NativeFramework()->GetPromoApi(ToNativeNetworkPolicy(env, policy));
if (api == nullptr)
{
onError();
return;
}
api->GetPoiGallery(point, languages::GetCurrentNorm(), tags, useCoordinates, utm, onSuccess,
onError);
}
std::string Framework::GetPromoCityUrl(JNIEnv * env, jobject policy, jdouble lat, jdouble lon)
{
auto api = NativeFramework()->GetPromoApi(ToNativeNetworkPolicy(env, policy));
if (api == nullptr)
return {};
auto const point = mercator::FromLatLon(static_cast<double>(lat), static_cast<double>(lon));
return api->GetCityUrl(point);
}
void Framework::OnPowerFacilityChanged(power_management::Facility const facility, bool enabled)
{
// Dummy
@ -886,36 +773,6 @@ void CallSetRoutingLoadPointsListener(shared_ptr<jobject> listener, bool success
RoutingManager::LoadRouteHandler g_loadRouteHandler;
void CallPurchaseValidationListener(shared_ptr<jobject> listener, Purchase::ValidationCode code,
Purchase::ValidationResponse const & validationResponse)
{
JNIEnv * env = jni::GetEnv();
jmethodID const methodId = jni::GetMethodID(env, *listener, "onValidatePurchase",
"(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)V");
jni::TScopedLocalRef const serverId(env, jni::ToJavaString(env, validationResponse.m_info.m_serverId));
jni::TScopedLocalRef const vendorId(env, jni::ToJavaString(env, validationResponse.m_info.m_vendorId));
jni::TScopedLocalRef const receiptData(env, jni::ToJavaString(env, validationResponse.m_info.m_receiptData));
env->CallVoidMethod(*listener, methodId, static_cast<jint>(code), serverId.get(), vendorId.get(),
receiptData.get(), static_cast<jboolean>(validationResponse.m_isTrial));
}
void CallStartPurchaseTransactionListener(shared_ptr<jobject> listener, bool success,
std::string const & serverId,
std::string const & vendorId)
{
JNIEnv * env = jni::GetEnv();
jmethodID const methodId = jni::GetMethodID(env, *listener, "onStartTransaction",
"(ZLjava/lang/String;Ljava/lang/String;)V");
jni::TScopedLocalRef const serverIdStr(env, jni::ToJavaString(env, serverId));
jni::TScopedLocalRef const vendorIdStr(env, jni::ToJavaString(env, vendorId));
env->CallVoidMethod(*listener, methodId, static_cast<jboolean>(success),
serverIdStr.get(), vendorIdStr.get());
}
/// @name JNI EXPORTS
JNIEXPORT jstring JNICALL
Java_com_mapswithme_maps_Framework_nativeGetAddress(JNIEnv * env, jclass clazz, jdouble lat, jdouble lon)
@ -995,16 +852,8 @@ Java_com_mapswithme_maps_Framework_nativePlacePageActivationListener(JNIEnv *env
jni::TScopedLocalRef placePageDataRef(env, nullptr);
if (info.IsTrack())
{
auto const categoryId = info.GetBookmarkCategoryId();
auto const serverId = frm()->GetBookmarkManager().GetCategoryServerId(categoryId);
auto const elevationInfo = frm()->GetBookmarkManager().MakeElevationInfo(info.GetTrackId());
placePageDataRef.reset(usermark_helper::CreateElevationInfo(env, serverId, elevationInfo));
}
else if (info.IsGuide())
{
auto const & guidesManager = frm()->GetGuidesManager();
auto const gallery = guidesManager.GetGallery();
placePageDataRef.reset(guides::CreateGallery(env, gallery));
placePageDataRef.reset(usermark_helper::CreateElevationInfo(env, elevationInfo));
}
else
{
@ -1276,12 +1125,6 @@ Java_com_mapswithme_maps_Framework_nativeGetUserAgent(JNIEnv * env, jclass)
return jni::ToJavaString(env, GetPlatform().GetAppUserAgent());
}
JNIEXPORT jstring JNICALL
Java_com_mapswithme_maps_Framework_nativeGetDeviceId(JNIEnv * env, jclass)
{
return jni::ToJavaString(env, web_api::DeviceId());
}
JNIEXPORT jobjectArray JNICALL
Java_com_mapswithme_maps_Framework_nativeGenerateNotifications(JNIEnv * env, jclass)
{
@ -1740,19 +1583,6 @@ Java_com_mapswithme_maps_Framework_nativeIsIsolinesLayerEnabled(JNIEnv * env, jc
return static_cast<jboolean>(frm()->LoadIsolinesEnabled());
}
JNIEXPORT void JNICALL Java_com_mapswithme_maps_Framework_nativeSetGuidesLayerEnabled(
JNIEnv * env, jclass, jboolean enabled)
{
frm()->SaveGuidesEnabled(static_cast<bool>(enabled));
frm()->GetGuidesManager().SetEnabled(static_cast<bool>(enabled));
}
JNIEXPORT jboolean JNICALL
Java_com_mapswithme_maps_Framework_nativeIsGuidesLayerEnabled(JNIEnv * env, jclass)
{
return static_cast<jboolean>(frm()->LoadGuidesEnabled());
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_Framework_nativeSaveSettingSchemeEnabled(JNIEnv * env, jclass, jboolean enabled)
{
@ -1897,56 +1727,6 @@ Java_com_mapswithme_maps_Framework_nativeDeleteSavedRoutePoints()
frm()->GetRoutingManager().DeleteSavedRoutePoints();
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_Framework_nativeAuthenticateUser(JNIEnv * env, jclass, jstring socialToken,
jint socialTokenType,
jboolean privacyAccepted,
jboolean termsAccepted,
jboolean promoAccepted,
jobject listener)
{
std::shared_ptr<_jobject> gListener(env->NewGlobalRef(listener), [](jobject l)
{
jni::GetEnv()->DeleteGlobalRef(l);
});
auto const tokenStr = jni::ToNativeString(env, socialToken);
auto & user = frm()->GetUser();
auto s = make_unique<User::Subscriber>();
s->m_postCallAction = User::Subscriber::Action::RemoveSubscriber;
s->m_onAuthenticate = [gListener](bool success)
{
GetPlatform().RunTask(Platform::Thread::Gui, [gListener, success]
{
auto e = jni::GetEnv();
jmethodID const callback = jni::GetMethodID(e, gListener.get(), "onAuthorized", "(Z)V");
e->CallVoidMethod(gListener.get(), callback, success);
});
};
user.AddSubscriber(std::move(s));
user.Authenticate(tokenStr, static_cast<User::SocialTokenType>(socialTokenType),
static_cast<bool>(privacyAccepted), static_cast<bool>(termsAccepted),
static_cast<bool>(promoAccepted));
}
JNIEXPORT jboolean JNICALL
Java_com_mapswithme_maps_Framework_nativeIsUserAuthenticated()
{
return frm()->GetUser().IsAuthenticated();
}
JNIEXPORT jstring JNICALL
Java_com_mapswithme_maps_Framework_nativeGetPhoneAuthUrl(JNIEnv * env, jclass, jstring redirectUrl)
{
return jni::ToJavaString(env, User::GetPhoneAuthUrl(jni::ToNativeString(env, redirectUrl)));
}
JNIEXPORT jobjectArray JNICALL
Java_com_mapswithme_maps_Framework_nativeGetDefaultAuthHeaders(JNIEnv * env, jobject)
{
return jni::ToKeyValueArray(env, web_api::GetDefaultAuthHeaders());
}
JNIEXPORT jstring JNICALL
Java_com_mapswithme_maps_Framework_nativeGetPrivacyPolicyLink(JNIEnv * env, jclass)
{
@ -1968,120 +1748,12 @@ Java_com_mapswithme_maps_Framework_nativeShowFeature(JNIEnv * env, jclass, jobje
frm()->ShowFeature(f);
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_Framework_nativeShowBookmarkCategory(JNIEnv * env, jclass, jlong cat)
{
frm()->ShowBookmarkCategory(static_cast<kml::MarkGroupId>(cat));
}
JNIEXPORT jint JNICALL
Java_com_mapswithme_maps_Framework_nativeGetFilterRating(JNIEnv * env, jclass, jfloat rawRating)
{
return static_cast<jint>(place_page::rating::GetFilterRating(rawRating));
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_Framework_nativeMakeCrash(JNIEnv *env, jclass type)
{
CHECK(false, ("Diagnostic native crash!"));
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_Framework_nativeValidatePurchase(JNIEnv * env, jclass, jstring serverId,
jstring vendorId, jstring purchaseData)
{
auto const & purchase = frm()->GetPurchase();
if (purchase == nullptr)
return;
Purchase::ValidationInfo info;
info.m_serverId = jni::ToNativeString(env, serverId);
info.m_vendorId = jni::ToNativeString(env, vendorId);
info.m_receiptData = jni::ToNativeString(env, purchaseData);
purchase->Validate(info, frm()->GetUser().GetAccessToken());
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_Framework_nativeStartPurchaseTransaction(JNIEnv * env, jclass,
jstring serverId,
jstring vendorId)
{
auto const & purchase = frm()->GetPurchase();
if (purchase == nullptr)
return;
purchase->StartTransaction(jni::ToNativeString(env, serverId),
jni::ToNativeString(env, vendorId),
frm()->GetUser().GetAccessToken());
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_Framework_nativeSetPurchaseValidationListener(JNIEnv *, jclass,
jobject listener)
{
auto const & purchase = frm()->GetPurchase();
if (purchase == nullptr)
return;
if (listener != nullptr)
{
purchase->SetValidationCallback(bind(&CallPurchaseValidationListener,
jni::make_global_ref(listener), _1, _2));
}
else
{
purchase->SetValidationCallback(nullptr);
}
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_Framework_nativeStartPurchaseTransactionListener(JNIEnv *, jclass,
jobject listener)
{
auto const & purchase = frm()->GetPurchase();
if (purchase == nullptr)
return;
if (listener != nullptr)
{
purchase->SetStartTransactionCallback(bind(&CallStartPurchaseTransactionListener,
jni::make_global_ref(listener), _1, _2, _3));
}
else
{
purchase->SetStartTransactionCallback(nullptr);
}
}
JNIEXPORT jboolean JNICALL
Java_com_mapswithme_maps_Framework_nativeHasActiveSubscription(JNIEnv *, jclass, jint type)
{
auto const & purchase = frm()->GetPurchase();
return purchase != nullptr ?
static_cast<jboolean>(purchase->IsSubscriptionActive(static_cast<SubscriptionType>(type))) :
static_cast<jboolean>(false);
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_Framework_nativeSetActiveSubscription(JNIEnv *, jclass, jint type,
jboolean isActive, jboolean isTrial)
{
auto const & purchase = frm()->GetPurchase();
if (purchase == nullptr)
return;
purchase->SetSubscriptionEnabled(static_cast<SubscriptionType>(type), static_cast<bool>(isActive),
static_cast<bool>(isTrial));
}
JNIEXPORT jstring JNICALL
Java_com_mapswithme_maps_Framework_nativeGetAccessToken(JNIEnv * env, jclass)
{
auto & user = frm()->GetUser();
return jni::ToJavaString(env, user.GetAccessToken());
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_Framework_nativeSetPowerManagerFacility(JNIEnv *, jclass,
jint facilityType, jboolean state)

View file

@ -58,7 +58,6 @@ namespace android
void TrafficStateChanged(TrafficManager::TrafficState state);
void TransitSchemeStateChanged(TransitReadManager::TransitSchemeState state);
void IsolinesSchemeStateChanged(IsolinesManager::IsolinesState state);
void GuidesLayerStateChanged(GuidesManager::GuidesState state);
void MyPositionModeChanged(location::EMyPositionMode mode, bool routingActive);
@ -69,7 +68,6 @@ namespace android
TrafficManager::TrafficStateChangedFn m_onTrafficStateChangedFn;
TransitReadManager::TransitStateChangedFn m_onTransitStateChangedFn;
IsolinesManager::IsolinesStateChangedFn m_onIsolinesStateChangedFn;
GuidesManager::GuidesStateChangedFn m_onGuidesStateChangedFn;
bool m_isChoosePositionMode;
@ -160,7 +158,6 @@ namespace android
void SetTrafficStateListener(TrafficManager::TrafficStateChangedFn const & fn);
void SetTransitSchemeListener(TransitReadManager::TransitStateChangedFn const & fn);
void SetIsolinesListener(IsolinesManager::IsolinesStateChangedFn const & fn);
void SetGuidesListener(GuidesManager::GuidesStateChangedFn const & fn);
bool IsTrafficEnabled();
void EnableTraffic();
@ -185,20 +182,6 @@ namespace android
int ToDoAfterUpdate() const;
uint64_t GetLocals(JNIEnv * env, jobject policy, double lat, double lon,
locals::LocalsSuccessCallback const & successFn,
locals::LocalsErrorCallback const & errorFn);
void GetPromoCityGallery(JNIEnv * env, jobject policy, m2::PointD const & point, UTM utm,
promo::CityGalleryCallback const & onSuccess,
promo::OnError const & onError);
void GetPromoPoiGallery(JNIEnv * env, jobject policy, m2::PointD const & point,
promo::Tags const & tags, bool useCoordinates, UTM utm,
promo::CityGalleryCallback const & onSuccess,
promo::OnError const & onError);
promo::AfterBooking GetPromoAfterBooking(JNIEnv * env, jobject policy);
std::string GetPromoCityUrl(JNIEnv * env, jobject policy, jdouble lat, jdouble lon);
// PowerManager::Subscriber overrides:
void OnPowerFacilityChanged(power_management::Facility const facility, bool enabled) override;
void OnPowerSchemeChanged(power_management::Scheme const actualScheme) override;

View file

@ -15,13 +15,6 @@ Java_com_mapswithme_maps_LightFramework_nativeIsAuthenticated(JNIEnv * env, jcla
return static_cast<jboolean>(framework.IsUserAuthenticated());
}
JNIEXPORT jint JNICALL
Java_com_mapswithme_maps_LightFramework_nativeGetNumberUnsentUGC(JNIEnv * env, jclass clazz)
{
lightweight::Framework const framework(lightweight::REQUEST_TYPE_NUMBER_OF_UNSENT_UGC);
return static_cast<jint>(framework.GetNumberOfUnsentUGC());
}
JNIEXPORT jstring JNICALL
Java_com_mapswithme_maps_LightFramework_nativeMakeFeatureId(JNIEnv * env, jclass clazz,
jstring mwmName, jlong mwmVersion,

View file

@ -61,8 +61,6 @@ jmethodID g_mapResultCtor;
jmethodID g_updateBookmarksResultsId;
jmethodID g_endBookmarksResultsId;
booking::filter::Tasks g_lastBookingFilterTasks;
bool PopularityHasHigherPriority(bool hasPosition, double distanceInMeters)
{
return !hasPosition || distanceInMeters > search::Result::kPopularityHighPriorityMinDistance;
@ -125,19 +123,12 @@ jobject ToJavaResult(Result & result, search::ProductInfo const & productInfo, b
jni::TScopedLocalRef brand(env, jni::ToJavaString(env, result.GetBrand()));
jni::TScopedLocalRef airportIata(env, jni::ToJavaString(env, result.GetAirportIata()));
jni::TScopedLocalRef roadShields(env, jni::ToJavaString(env, result.GetRoadShields()));
jni::TScopedLocalRef pricing(env, jni::ToJavaString(env, result.GetHotelApproximatePricing()));
auto const hotelRating = result.GetHotelRating();
auto const ugcRating = productInfo.m_ugcRating;
auto const rating = static_cast<jfloat>(hotelRating == kInvalidRatingValue ? ugcRating
: hotelRating);
jni::TScopedLocalRef desc(env, env->NewObject(g_descriptionClass, g_descriptionConstructor,
featureId.get(), featureType.get(), address.get(),
dist.get(), cuisine.get(), brand.get(), airportIata.get(),
roadShields.get(), pricing.get(), rating,
result.GetStarsCount(),
roadShields.get(),
static_cast<jint>(result.IsOpenNow()),
static_cast<jboolean>(popularityHasHigherPriority)));
@ -167,14 +158,12 @@ void OnResults(Results const & results, vector<search::ProductInfo> const & prod
jni::TScopedLocalObjectArrayRef jResults(
env, BuildSearchResults(results, productInfo, hasPosition, lat, lon));
env->CallVoidMethod(g_javaListener, g_updateResultsId, jResults.get(),
static_cast<jlong>(timestamp),
static_cast<jboolean>(results.GetType() == Results::Type::Hotels));
static_cast<jlong>(timestamp));
}
if (results.IsEndMarker())
{
env->CallVoidMethod(g_javaListener, g_endResultsId, static_cast<jlong>(timestamp),
static_cast<jboolean>(results.GetType() == Results::Type::Hotels));
env->CallVoidMethod(g_javaListener, g_endResultsId, static_cast<jlong>(timestamp));
if (isMapAndTable && results.IsEndedNormal())
g_framework->NativeFramework()->GetSearchAPI().PokeSearchInViewport();
}
@ -235,181 +224,6 @@ void OnBookmarksSearchResults(search::BookmarksSearchParams::Results const & res
env->CallVoidMethod(g_javaListener, method, jResults.get(), static_cast<jlong>(timestamp));
}
void OnBookingFilterAvailabilityResults(shared_ptr<booking::ParamsBase> const & apiParams,
vector<FeatureID> const & featuresSorted)
{
auto const it = g_lastBookingFilterTasks.Find(booking::filter::Type::Availability);
if (it == g_lastBookingFilterTasks.end())
return;
// Ignore obsolete booking filter results.
if (!it->m_filterParams.m_apiParams->Equals(*apiParams))
return;
ASSERT(is_sorted(featuresSorted.cbegin(), featuresSorted.cend()), ());
JNIEnv * env = jni::GetEnv();
jni::TScopedLocalObjectArrayRef jResults(env,
usermark_helper::ToFeatureIdArray(env, featuresSorted));
env->CallVoidMethod(g_javaListener, g_onFilterHotels,
static_cast<jint>(booking::filter::Type::Availability), jResults.get());
}
void OnBookingFilterDealsResults(shared_ptr<booking::ParamsBase> const & apiParams,
vector<FeatureID> const & featuresSorted)
{
auto const it = g_lastBookingFilterTasks.Find(booking::filter::Type::Deals);
if (it == g_lastBookingFilterTasks.end())
return;
// Ignore obsolete booking filter results.
if (!it->m_filterParams.m_apiParams->Equals(*apiParams))
return;
ASSERT(is_sorted(featuresSorted.cbegin(), featuresSorted.cend()), ());
JNIEnv * env = jni::GetEnv();
jni::TScopedLocalObjectArrayRef jResults(env,
usermark_helper::ToFeatureIdArray(env, featuresSorted));
env->CallVoidMethod(g_javaListener, g_onFilterHotels,
static_cast<jint>(booking::filter::Type::Deals), jResults.get());
}
class BookingBuilder
{
public:
void Init(JNIEnv * env)
{
if (m_initialized)
return;
m_bookingFilterParamsClass =
jni::GetGlobalClassRef(env, "com/mapswithme/maps/search/BookingFilterParams");
m_roomClass =
jni::GetGlobalClassRef(env, "com/mapswithme/maps/search/BookingFilterParams$Room");
m_checkinMillisecId = env->GetFieldID(m_bookingFilterParamsClass, "mCheckinMillisec", "J");
m_checkoutMillisecId = env->GetFieldID(m_bookingFilterParamsClass, "mCheckoutMillisec", "J");
m_roomsId = env->GetFieldID(m_bookingFilterParamsClass, "mRooms",
"[Lcom/mapswithme/maps/search/BookingFilterParams$Room;");
m_roomAdultsCountId = env->GetFieldID(m_roomClass, "mAdultsCount", "I");
m_roomAgeOfChildrenId = env->GetMethodID(m_roomClass, "getAgeOfChildren", "()[I");
m_initialized = true;
}
booking::AvailabilityParams BuildAvailability(JNIEnv * env, jobject bookingFilterParams)
{
booking::AvailabilityParams result;
if (!m_initialized || bookingFilterParams == nullptr)
return result;
auto & orderingParams = result.m_orderingParams;
jlong const jcheckin = env->GetLongField(bookingFilterParams, m_checkinMillisecId) / 1000;
orderingParams.m_checkin =
booking::OrderingParams::Clock::from_time_t(static_cast<time_t>(jcheckin));
jlong const jcheckout = env->GetLongField(bookingFilterParams, m_checkoutMillisecId) / 1000;
orderingParams.m_checkout =
booking::OrderingParams::Clock::from_time_t(static_cast<time_t>(jcheckout));
jobjectArray const jrooms =
static_cast<jobjectArray>(env->GetObjectField(bookingFilterParams, m_roomsId));
ASSERT(jrooms, ("Rooms must be non-null!"));
auto const length = static_cast<size_t>(env->GetArrayLength(jrooms));
orderingParams.m_rooms.resize(length);
for (size_t i = 0; i < length; ++i)
{
jobject jroom = env->GetObjectArrayElement(jrooms, static_cast<jsize>(i));
auto & room = orderingParams.m_rooms[i];
room.SetAdultsCount(static_cast<uint8_t>(env->GetIntField(jroom, m_roomAdultsCountId)));
auto const childrenObject = env->CallObjectMethod(jroom, m_roomAgeOfChildrenId);
if (childrenObject != nullptr)
{
auto const children = static_cast<jintArray>(childrenObject);
auto const dtor = [children, env](jint * data) { env->ReleaseIntArrayElements(children, data, 0); };
std::unique_ptr<jint, decltype(dtor)> data{env->GetIntArrayElements(children, nullptr), dtor};
auto const childrenCount = env->GetArrayLength(children);
std::vector<int8_t> ageOfChildren;
for (jsize j = 0; j < childrenCount; ++j)
{
ageOfChildren.push_back(static_cast<int8_t>(data.get()[j]));
}
room.SetAgeOfChildren(ageOfChildren);
}
}
return result;
}
booking::AvailabilityParams BuildDeals(JNIEnv * env, jobject bookingFilterParams)
{
booking::AvailabilityParams result;
if (!m_initialized)
return result;
if (bookingFilterParams != nullptr)
{
result = BuildAvailability(env, bookingFilterParams);
}
else if (platform::GetCurrentNetworkPolicy().CanUse())
{
result = g_framework->NativeFramework()->GetLastBookingAvailabilityParams();
if (result.IsEmpty())
result = booking::AvailabilityParams::MakeDefault();
}
result.m_dealsOnly = true;
return result;
}
booking::filter::Tasks BuildTasks(JNIEnv * env, jobject bookingFilterParams)
{
booking::filter::Tasks tasks;
auto const availabilityParams = BuildAvailability(env, bookingFilterParams);
if (!availabilityParams.IsEmpty())
{
booking::filter::Params p(make_shared<booking::AvailabilityParams>(availabilityParams),
bind(&::OnBookingFilterAvailabilityResults, _1, _2));
tasks.EmplaceBack(booking::filter::Type::Availability, move(p));
}
auto const dealsParams = BuildDeals(env, bookingFilterParams);
if (!dealsParams.IsEmpty())
{
booking::filter::Params p(make_shared<booking::AvailabilityParams>(dealsParams),
bind(&::OnBookingFilterDealsResults, _1, _2));
tasks.EmplaceBack(booking::filter::Type::Deals, move(p));
}
return tasks;
}
private:
jclass m_bookingFilterParamsClass = nullptr;
jclass m_roomClass = nullptr;
jfieldID m_checkinMillisecId = nullptr;
jfieldID m_checkoutMillisecId = nullptr;
jfieldID m_roomsId = nullptr;
jfieldID m_roomAdultsCountId = nullptr;
jmethodID m_roomAgeOfChildrenId = nullptr;
bool m_initialized = false;
} g_bookingBuilder;
} // namespace
jobjectArray BuildSearchResults(Results const & results,
@ -438,9 +252,11 @@ extern "C"
Java_com_mapswithme_maps_search_SearchEngine_nativeInit(JNIEnv * env, jobject thiz)
{
g_javaListener = env->NewGlobalRef(thiz);
// public void onResultsUpdate(@NonNull SearchResult[] results, long timestamp)
g_updateResultsId = jni::GetMethodID(env, g_javaListener, "onResultsUpdate",
"([Lcom/mapswithme/maps/search/SearchResult;JZ)V");
g_endResultsId = jni::GetMethodID(env, g_javaListener, "onResultsEnd", "(JZ)V");
"([Lcom/mapswithme/maps/search/SearchResult;J)V");
// public void onResultsEnd(long timestamp)
g_endResultsId = jni::GetMethodID(env, g_javaListener, "onResultsEnd", "(J)V");
g_resultClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/search/SearchResult");
g_resultConstructor = jni::GetConstructorID(
env, g_resultClass,
@ -448,11 +264,16 @@ extern "C"
"Lcom/mapswithme/maps/search/Popularity;)V");
g_suggestConstructor = jni::GetConstructorID(env, g_resultClass, "(Ljava/lang/String;Ljava/lang/String;DD[I)V");
g_descriptionClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/search/SearchResult$Description");
/*
Description(FeatureId featureId, String featureType, String region, String distance,
String cuisine, String brand, String airportIata, String roadShields,
int openNow, boolean hasPopularityHigherPriority)
*/
g_descriptionConstructor = jni::GetConstructorID(env, g_descriptionClass,
"(Lcom/mapswithme/maps/bookmarks/data/FeatureId;"
"Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;"
"Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;"
"Ljava/lang/String;Ljava/lang/String;FIIZ)V");
"Ljava/lang/String;IZ)V");
g_popularityClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/search/Popularity");
g_popularityConstructor = jni::GetConstructorID(env, g_popularityClass, "(I)V");
@ -466,27 +287,16 @@ extern "C"
jni::GetMethodID(env, g_javaListener, "onBookmarkSearchResultsUpdate", "([JJ)V");
g_endBookmarksResultsId =
jni::GetMethodID(env, g_javaListener, "onBookmarkSearchResultsEnd", "([JJ)V");
g_onFilterHotels = jni::GetMethodID(env, g_javaListener, "onFilterHotels",
"(I[Lcom/mapswithme/maps/bookmarks/data/FeatureId;)V");
g_hotelsFilterBuilder.Init(env);
g_bookingBuilder.Init(env);
}
JNIEXPORT jboolean JNICALL Java_com_mapswithme_maps_search_SearchEngine_nativeRunSearch(
JNIEnv * env, jclass clazz, jbyteArray bytes, jstring lang, jlong timestamp,
jboolean hasPosition, jdouble lat, jdouble lon, jobject hotelsFilter,
jobject bookingFilterParams)
jboolean hasPosition, jdouble lat, jdouble lon)
{
search::EverywhereSearchParams params;
params.m_query = jni::ToNativeString(env, bytes);
params.m_inputLocale = jni::ToNativeString(env, lang);
params.m_onResults = bind(&OnResults, _1, _2, timestamp, false, hasPosition, lat, lon);
params.m_hotelsFilter = g_hotelsFilterBuilder.Build(env, hotelsFilter);
params.m_bookingFilterTasks = g_bookingBuilder.BuildTasks(env, bookingFilterParams);
g_lastBookingFilterTasks = params.m_bookingFilterTasks;
bool const searchStarted = g_framework->NativeFramework()->GetSearchAPI().SearchEverywhere(params);
if (searchStarted)
g_queryTimestamp = timestamp;
@ -495,15 +305,11 @@ extern "C"
JNIEXPORT void JNICALL Java_com_mapswithme_maps_search_SearchEngine_nativeRunInteractiveSearch(
JNIEnv * env, jclass clazz, jbyteArray bytes, jstring lang, jlong timestamp,
jboolean isMapAndTable, jobject hotelsFilter, jobject bookingFilterParams)
jboolean isMapAndTable)
{
search::ViewportSearchParams vparams;
vparams.m_query = jni::ToNativeString(env, bytes);
vparams.m_inputLocale = jni::ToNativeString(env, lang);
vparams.m_hotelsFilter = g_hotelsFilterBuilder.Build(env, hotelsFilter);
vparams.m_bookingFilterTasks = g_bookingBuilder.BuildTasks(env, bookingFilterParams);
g_lastBookingFilterTasks = vparams.m_bookingFilterTasks;
// TODO (@alexzatsepin): set up vparams.m_onCompleted here and use
// HotelsClassifier for hotel queries detection.
@ -516,8 +322,6 @@ extern "C"
eparams.m_inputLocale = vparams.m_inputLocale;
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_bookingFilterTasks = g_lastBookingFilterTasks;
if (g_framework->NativeFramework()->GetSearchAPI().SearchEverywhere(eparams))
g_queryTimestamp = timestamp;
@ -574,24 +378,4 @@ extern "C"
{
g_framework->NativeFramework()->GetSearchAPI().CancelAllSearches();
}
JNIEXPORT jobjectArray JNICALL
Java_com_mapswithme_maps_search_SearchEngine_nativeGetHotelTypes(JNIEnv * env, jclass clazz)
{
using Type = ftypes::IsHotelChecker::Type;
static jclass const hotelTypeClass =
jni::GetGlobalClassRef(env, "com/mapswithme/maps/search/HotelsFilter$HotelType");
static jmethodID const hotelTypeCtorId =
jni::GetConstructorID(env, hotelTypeClass, "(ILjava/lang/String;)V");
vector<Type> types;
for (size_t i = 0; i < static_cast<size_t>(Type::Count); i++)
types.push_back(static_cast<Type>(i));
return jni::ToJavaArray(env, hotelTypeClass, types, [](JNIEnv * env, Type const & item) {
auto const tag = ftypes::IsHotelChecker::GetHotelTypeTag(item);
return env->NewObject(hotelTypeClass, hotelTypeCtorId, static_cast<jint>(item),
jni::ToJavaString(env, tag));
});
}
} // extern "C"

View file

@ -1,214 +0,0 @@
#include "com/mapswithme/maps/Framework.hpp"
#include "com/mapswithme/core/jni_helper.hpp"
#include "com/mapswithme/platform/Platform.hpp"
#include "map/place_page_info.hpp"
#include <chrono>
#include <functional>
#include <utility>
namespace
{
using namespace booking;
jclass g_sponsoredClass;
jclass g_facilityTypeClass;
jclass g_nearbyObjectClass;
jclass g_imageClass;
jclass g_reviewClass;
jclass g_hotelInfoClass;
jclass g_priceInfoClass;
jmethodID g_priceInfoConstructor;
jmethodID g_facilityConstructor;
jmethodID g_nearbyConstructor;
jmethodID g_imageConstructor;
jmethodID g_reviewConstructor;
jmethodID g_hotelInfoConstructor;
jmethodID g_sponsoredClassConstructor;
jmethodID g_priceCallback;
jmethodID g_infoCallback;
std::string g_lastRequestedHotelId;
void PrepareClassRefs(JNIEnv * env, jclass sponsoredClass)
{
if (g_sponsoredClass)
return;
g_sponsoredClass = static_cast<jclass>(env->NewGlobalRef(sponsoredClass));
g_hotelInfoClass =
jni::GetGlobalClassRef(env, "com/mapswithme/maps/widget/placepage/Sponsored$HotelInfo");
g_facilityTypeClass = jni::GetGlobalClassRef(
env, "com/mapswithme/maps/widget/placepage/Sponsored$FacilityType");
g_nearbyObjectClass = jni::GetGlobalClassRef(
env, "com/mapswithme/maps/widget/placepage/Sponsored$NearbyObject");
g_reviewClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/review/Review");
g_imageClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/gallery/Image");
g_priceInfoClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/widget/placepage/HotelPriceInfo");
g_facilityConstructor =
jni::GetConstructorID(env, g_facilityTypeClass, "(Ljava/lang/String;Ljava/lang/String;)V");
g_nearbyConstructor = jni::GetConstructorID(
env, g_nearbyObjectClass, "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;DD)V");
g_imageConstructor =
jni::GetConstructorID(env, g_imageClass, "(Ljava/lang/String;Ljava/lang/String;)V");
g_reviewConstructor = jni::GetConstructorID(env, g_reviewClass,
"(JFLjava/lang/String;Ljava/lang/"
"String;Ljava/lang/String;)V");
g_priceInfoConstructor =
jni::GetConstructorID(env, g_priceInfoClass, "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZ)V");
g_hotelInfoConstructor = jni::GetConstructorID(
env, g_hotelInfoClass,
"(Ljava/lang/String;[Lcom/mapswithme/maps/gallery/Image;[Lcom/mapswithme/maps/widget/"
"placepage/Sponsored$FacilityType;[Lcom/mapswithme/maps/review/Review;[Lcom/mapswithme/"
"maps/widget/placepage/Sponsored$NearbyObject;J)V");
// Sponsored(String rating, int impress, String price, String url, String deepLink,
// String descriptionUrl, String moreUrl, String reviewUrl, int type,
// int partnerIndex, String partnerName)
g_sponsoredClassConstructor = jni::GetConstructorID(
env, g_sponsoredClass,
"(Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;"
"Ljava/lang/String;Ljava/lang/String;IILjava/lang/String;)V");
// static void onPriceReceived(final String id, final String price, final String currency)
g_priceCallback =
jni::GetStaticMethodID(env, g_sponsoredClass, "onPriceReceived",
"(Lcom/mapswithme/maps/widget/placepage/HotelPriceInfo;)V");
// static void onDescriptionReceived(final String id, final String description)
g_infoCallback = jni::GetStaticMethodID(
env, g_sponsoredClass, "onHotelInfoReceived",
"(Ljava/lang/String;Lcom/mapswithme/maps/widget/placepage/Sponsored$HotelInfo;)V");
}
jobjectArray ToPhotosArray(JNIEnv * env, std::vector<HotelPhotoUrls> const & photos)
{
return jni::ToJavaArray(env, g_imageClass, photos,
[](JNIEnv * env, HotelPhotoUrls const & item) {
return env->NewObject(g_imageClass, g_imageConstructor,
jni::ToJavaString(env, item.m_original),
jni::ToJavaString(env, item.m_small));
});
}
jobjectArray ToFacilitiesArray(JNIEnv * env, std::vector<HotelFacility> const & facilities)
{
return jni::ToJavaArray(env, g_facilityTypeClass, facilities,
[](JNIEnv * env, HotelFacility const & item) {
return env->NewObject(g_facilityTypeClass, g_facilityConstructor,
jni::ToJavaString(env, item.m_type),
jni::ToJavaString(env, item.m_name));
});
}
jobjectArray ToReviewsArray(JNIEnv * env, std::vector<HotelReview> const & reviews)
{
return jni::ToJavaArray(env, g_reviewClass, reviews,
[](JNIEnv * env, HotelReview const & item) {
return env->NewObject(
g_reviewClass, g_reviewConstructor,
std::chrono::time_point_cast<std::chrono::milliseconds>(item.m_date).time_since_epoch().count(),
item.m_score, jni::ToJavaString(env, item.m_author),
jni::ToJavaString(env, item.m_pros), jni::ToJavaString(env, item.m_cons));
});
}
} // namespace
extern "C"
{
// static Sponsored nativeGetCurrent();
JNIEXPORT jobject JNICALL Java_com_mapswithme_maps_widget_placepage_Sponsored_nativeGetCurrent(
JNIEnv * env, jclass clazz)
{
PrepareClassRefs(env, clazz);
if (!g_framework->NativeFramework()->HasPlacePageInfo())
return nullptr;
place_page::Info const & ppInfo = g_framework->GetPlacePageInfo();
if (!ppInfo.IsSponsored())
return nullptr;
std::string rating = place_page::rating::GetRatingFormatted(ppInfo.GetRatingRawValue());
return env->NewObject(g_sponsoredClass, g_sponsoredClassConstructor,
jni::ToJavaString(env, rating),
static_cast<jint>(place_page::rating::GetImpress(ppInfo.GetRatingRawValue())),
jni::ToJavaString(env, ppInfo.GetApproximatePricing()),
jni::ToJavaString(env, ppInfo.GetSponsoredUrl()),
jni::ToJavaString(env, ppInfo.GetSponsoredDeepLink()),
jni::ToJavaString(env, ppInfo.GetSponsoredDescriptionUrl()),
jni::ToJavaString(env, ppInfo.GetSponsoredMoreUrl()),
jni::ToJavaString(env, ppInfo.GetSponsoredReviewUrl()),
static_cast<jint>(ppInfo.GetSponsoredType()),
static_cast<jint>(ppInfo.GetPartnerIndex()),
jni::ToJavaString(env, ppInfo.GetPartnerName()));
}
// static void nativeRequestPrice(String id, String currencyCode);
JNIEXPORT void JNICALL Java_com_mapswithme_maps_widget_placepage_Sponsored_nativeRequestPrice(
JNIEnv * env, jclass clazz, jobject policy, jstring id, jstring currencyCode)
{
PrepareClassRefs(env, clazz);
std::string const hotelId = jni::ToNativeString(env, id);
g_lastRequestedHotelId = hotelId;
std::string const code = jni::ToNativeString(env, currencyCode);
auto params = booking::BlockParams::MakeDefault();
params.m_hotelId = hotelId;
params.m_currency = code;
g_framework->RequestBookingMinPrice(
env, policy, std::move(params),
[](std::string const & hotelId, booking::Blocks const & blocks) {
if (g_lastRequestedHotelId != hotelId)
return;
JNIEnv * env = jni::GetEnv();
auto const price = blocks.m_totalMinPrice == BlockInfo::kIncorrectPrice
? ""
: std::to_string(blocks.m_totalMinPrice);
auto const hotelPriceInfo = env->NewObject(g_priceInfoClass,
g_priceInfoConstructor,
jni::ToJavaString(env, hotelId),
jni::ToJavaString(env, price),
jni::ToJavaString(env, blocks.m_currency),
static_cast<jint>(blocks.m_maxDiscount),
static_cast<jboolean>(blocks.m_hasSmartDeal));
env->CallStaticVoidMethod(g_sponsoredClass, g_priceCallback, hotelPriceInfo);
});
}
// static void nativeRequestInfo(String id, String locale);
JNIEXPORT void JNICALL Java_com_mapswithme_maps_widget_placepage_Sponsored_nativeRequestHotelInfo(
JNIEnv * env, jclass clazz, jobject policy, jstring id, jstring locale)
{
PrepareClassRefs(env, clazz);
std::string const hotelId = jni::ToNativeString(env, id);
g_lastRequestedHotelId = hotelId;
std::string code = jni::ToNativeString(env, locale);
if (code.size() > 2) // 2 - number of characters in country code
code.resize(2);
g_framework->RequestBookingInfo(env, policy, hotelId, code, [hotelId](HotelInfo const hotelInfo) {
if (g_lastRequestedHotelId != hotelId)
return;
JNIEnv * env = jni::GetEnv();
auto description = jni::ToJavaString(env, hotelInfo.m_description);
auto photos = ToPhotosArray(env, hotelInfo.m_photos);
auto facilities = ToFacilitiesArray(env, hotelInfo.m_facilities);
auto reviews = ToReviewsArray(env, hotelInfo.m_reviews);
auto nearby = env->NewObjectArray(0, g_nearbyObjectClass, 0);
jlong reviewsCount = static_cast<jlong>(hotelInfo.m_scoreCount);
env->CallStaticVoidMethod(g_sponsoredClass, g_infoCallback, jni::ToJavaString(env, hotelId),
env->NewObject(g_hotelInfoClass, g_hotelInfoConstructor, description,
photos, facilities, reviews, nearby, reviewsCount));
});
}
} // extern "C"

View file

@ -24,14 +24,6 @@ void InjectMetadata(JNIEnv * env, jclass const clazz, jobject const mapObject, f
}
}
jobject CreateRating(JNIEnv * env, std::string const & name)
{
static jmethodID const ratingCtorId =
jni::GetConstructorID(env, g_ratingClazz, "(Ljava/lang/String;F)V");
jni::TScopedLocalRef nameRef(env, jni::ToJavaString(env, name));
return env->NewObject(g_ratingClazz, ratingCtorId, nameRef.get(), place_page::kIncorrectRating);
}
jobject CreatePopularity(JNIEnv * env, place_page::Info const & info)
{
static jclass const popularityClass =
@ -42,52 +34,38 @@ jobject CreatePopularity(JNIEnv * env, place_page::Info const & info)
return env->NewObject(popularityClass, popularityConstructor, static_cast<jint>(popularityValue));
}
jobject CreateHotelType(JNIEnv * env, place_page::Info const & info)
{
if (!info.GetHotelType())
return nullptr;
static jclass const hotelTypeClass =
jni::GetGlobalClassRef(env, "com/mapswithme/maps/search/HotelsFilter$HotelType");
static jmethodID const hotelTypeCtorId =
jni::GetConstructorID(env, hotelTypeClass, "(ILjava/lang/String;)V");
auto const tag = ftypes::IsHotelChecker::GetHotelTypeTag(*info.GetHotelType());
return env->NewObject(hotelTypeClass, hotelTypeCtorId, static_cast<jint>(*info.GetHotelType()),
jni::ToJavaString(env, tag));
}
jobject CreateMapObject(JNIEnv * env, std::string const & mwmName, int64_t mwmVersion,
uint32_t featureIndex, int mapObjectType, std::string const & title,
std::string const & secondaryTitle, std::string const & subtitle, double lat,
double lon, std::string const & address, Metadata const & metadata,
std::string const & apiId, jintArray jTaxiTypes,
std::string const & bookingSearchUrl,
std::string const & apiId,
jobject const & routingPointInfo, place_page::OpeningMode openingMode,
bool shouldShowUGC, bool canBeRated, bool canBeReviewed,
jobjectArray jratings, jobject const & hotelType, int priceRate,
jobject const & popularity, std::string const & description,
RoadWarningMarkType roadWarningMarkType, bool isTopChoice,
jobjectArray jrawTypes)
RoadWarningMarkType roadWarningMarkType, jobjectArray jrawTypes)
{
// public MapObject(@NonNull FeatureId featureId, @MapObjectType int mapObjectType, String title,
// @Nullable String secondaryTitle, String subtitle, String address,
// double lat, double lon, String apiId
// @Nullable int[] types, @Nullable String bookingSearchUrl,
// @Nullable RoutePointInfo routePointInfo,
// @OpeningMode int openingMode, boolean shouldShowUGC, boolean canBeRated,
// boolean canBeReviewed, @Nullable UGC.Rating[] ratings,
// @Nullable HotelsFilter.HotelType hotelType,
// @PriceFilterView.PriceDef int priceRate
// boolean isTopChoice)
// public MapObject(@NonNull FeatureId featureId, @MapObjectType int mapObjectType, String title,
// @Nullable String secondaryTitle, String subtitle, String address,
// double lat, double lon, String apiId, @Nullable RoutePointInfo routePointInfo,
// @OpeningMode int openingMode, @NonNull Popularity popularity, @NonNull String description,
// int roadWarningType, @Nullable String[] rawTypes)
static jmethodID const ctorId = jni::GetConstructorID(
env, g_mapObjectClazz,
"(Lcom/mapswithme/maps/bookmarks/data/FeatureId;ILjava/lang/String;Ljava/lang/"
"String;Ljava/lang/String;Ljava/lang/String;DDLjava/lang/"
"String;[ILjava/lang/String;"
"Lcom/mapswithme/maps/routing/RoutePointInfo;IZZZ[Lcom/mapswithme/maps/ugc/UGC$Rating;"
"Lcom/mapswithme/maps/search/HotelsFilter$HotelType;ILcom/mapswithme/maps/search/Popularity;"
"Ljava/lang/String;IZ[Ljava/lang/String;)V");
"("
"Lcom/mapswithme/maps/bookmarks/data/FeatureId;" // featureId
"I" // mapObjectType
"Ljava/lang/String;" // title
"Ljava/lang/String;" // secondaryTitle
"Ljava/lang/String;" // subtitle
"Ljava/lang/String;" // address
"DD" // lat, lon
"Ljava/lang/String;" // appId
"Lcom/mapswithme/maps/routing/RoutePointInfo;" // routePointInfo
"I" // openingMode
"Lcom/mapswithme/maps/search/Popularity;" // popularity
"Ljava/lang/String;" // description
"I" // roadWarnType
"[Ljava/lang/String;" // rawTypes
")V");
//public FeatureId(@NonNull String mwmName, long mwmVersion, int featureIndex)
static jmethodID const featureCtorId =
@ -102,53 +80,35 @@ jobject CreateMapObject(JNIEnv * env, std::string const & mwmName, int64_t mwmVe
jni::TScopedLocalRef jSubtitle(env, jni::ToJavaString(env, subtitle));
jni::TScopedLocalRef jAddress(env, jni::ToJavaString(env, address));
jni::TScopedLocalRef jApiId(env, jni::ToJavaString(env, apiId));
jni::TScopedLocalRef jBookingSearchUrl(env, jni::ToJavaString(env, bookingSearchUrl));
jni::TScopedLocalRef jDescription(env, jni::ToJavaString(env, description));
jobject mapObject =
env->NewObject(g_mapObjectClazz, ctorId, jFeatureId.get(), mapObjectType, jTitle.get(),
jSecondaryTitle.get(), jSubtitle.get(), jAddress.get(), lat, lon, jApiId.get(),
jTaxiTypes, jBookingSearchUrl.get(), routingPointInfo,
static_cast<jint>(openingMode), static_cast<jboolean>(shouldShowUGC),
static_cast<jboolean>(canBeRated), static_cast<jboolean>(canBeReviewed),
jratings, hotelType, priceRate, popularity, jDescription.get(),
static_cast<jint>(roadWarningMarkType), static_cast<jboolean>(isTopChoice),
jrawTypes);
routingPointInfo,
static_cast<jint>(openingMode), popularity, jDescription.get(),
static_cast<jint>(roadWarningMarkType), jrawTypes);
InjectMetadata(env, g_mapObjectClazz, mapObject, metadata);
return mapObject;
}
jobject CreateBookmark(JNIEnv *env, const place_page::Info &info,
const jni::TScopedLocalObjectArrayRef &jratings,
const jni::TScopedLocalIntArrayRef &jTaxiTypes,
const jni::TScopedLocalObjectArrayRef &jrawTypes,
const jni::TScopedLocalRef &routingPointInfo,
const jni::TScopedLocalRef &hotelType,
const jni::TScopedLocalRef &popularity, int priceRate)
const jni::TScopedLocalRef &popularity)
{
// public Bookmark(@NonNull FeatureId featureId, @IntRange(from = 0) long categoryId,
// @IntRange(from = 0) long bookmarkId, String title, @Nullable String secondaryTitle,
// @Nullable String subtitle, @Nullable String address,
// @Nullable int[] reachableByTaxiTypes, @Nullable String bookingSearchUrl,
// @Nullable RoutePointInfo routePointInfo,
// @OpeningMode int openingMode, boolean shouldShowUGC, boolean canBeRated,
// boolean canBeReviewed, @Nullable UGC.Rating[] ratings,
// @Nullable HotelsFilter.HotelType hotelType,
// @PriceFilterView.PriceDef int priceRate,
// @NotNull com.mapswithme.maps.search.Popularity entity
// @NotNull String description
// boolean isTopChoice)
//public Bookmark(@NonNull FeatureId featureId, @IntRange(from = 0) long categoryId,
// @IntRange(from = 0) long bookmarkId, String title, @Nullable String secondaryTitle,
// @Nullable String subtitle, @Nullable String address, @Nullable RoutePointInfo routePointInfo,
// @OpeningMode int openingMode, @NonNull Popularity popularity, @NonNull String description,
// @Nullable String[] rawTypes)
static jmethodID const ctorId =
jni::GetConstructorID(env, g_bookmarkClazz,
"(Lcom/mapswithme/maps/bookmarks/data/FeatureId;JJLjava/lang/String;"
"Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;"
"[ILjava/lang/String;"
"Lcom/mapswithme/maps/routing/RoutePointInfo;"
"IZZZ[Lcom/mapswithme/maps/ugc/UGC$Rating;"
"Lcom/mapswithme/maps/search/HotelsFilter$HotelType;"
"ILcom/mapswithme/maps/search/Popularity;Ljava/lang/String;"
"Z[Ljava/lang/String;)V");
// public FeatureId(@NonNull String mwmName, long mwmVersion, int featureIndex)
"[Ljava/lang/String;)V");
static jmethodID const featureCtorId =
jni::GetConstructorID(env, g_featureIdClazz, "(Ljava/lang/String;JI)V");
@ -163,14 +123,11 @@ jobject CreateBookmark(JNIEnv *env, const place_page::Info &info,
jni::TScopedLocalRef jSubtitle(env, jni::ToJavaString(env, info.GetSubtitle()));
jni::TScopedLocalRef jAddress(env, jni::ToJavaString(env, info.GetAddress()));
jni::TScopedLocalRef jDescription(env, jni::ToJavaString(env, info.GetDescription()));
jni::TScopedLocalRef jBookingSearchUrl(env, jni::ToJavaString(env, info.GetBookingSearchUrl()));
jobject mapObject = env->NewObject(
g_bookmarkClazz, ctorId, jFeatureId.get(), static_cast<jlong>(categoryId),
static_cast<jlong>(bookmarkId), jTitle.get(), jSecondaryTitle.get(), jSubtitle.get(),
jAddress.get(), jTaxiTypes.get(), jBookingSearchUrl.get(),
routingPointInfo.get(), info.GetOpeningMode(), info.ShouldShowUGC(),
info.CanBeRated(), info.CanBeReviewed(), jratings.get(), hotelType.get(), priceRate,
popularity.get(), jDescription.get(), info.IsTopChoice(), jrawTypes.get());
jAddress.get(), routingPointInfo.get(), info.GetOpeningMode(), popularity.get(),
jDescription.get(), jrawTypes.get());
if (info.HasMetadata())
InjectMetadata(env, g_mapObjectClazz, mapObject, info.GetMetadata());
@ -200,7 +157,7 @@ jobjectArray ToElevationPointArray(JNIEnv * env, ElevationInfo::Points const & p
});
}
jobject CreateElevationInfo(JNIEnv * env, std::string const & serverId, ElevationInfo const & info)
jobject CreateElevationInfo(JNIEnv * env, ElevationInfo const & info)
{
// public ElevationInfo(long trackId, @NonNull String name, @NonNull Point[] points,
// int ascent, int descent, int minAltitude, int maxAltitude, int difficulty,
@ -209,11 +166,10 @@ jobject CreateElevationInfo(JNIEnv * env, std::string const & serverId, Elevatio
jni::GetConstructorID(env, g_elevationInfoClazz, "(JLjava/lang/String;Ljava/lang/String;"
"[Lcom/mapswithme/maps/bookmarks/data/ElevationInfo$Point;"
"IIIIIJ)V");
jni::TScopedLocalRef jServerId(env, jni::ToJavaString(env, serverId));
jni::TScopedLocalRef jName(env, jni::ToJavaString(env, info.GetName()));
jni::TScopedLocalObjectArrayRef jPoints(env, ToElevationPointArray(env, info.GetPoints()));
return env->NewObject(g_elevationInfoClazz, ctorId, static_cast<jlong>(info.GetId()),
jServerId.get(), jName.get(), jPoints.get(),
jName.get(), jPoints.get(),
static_cast<jint>(info.GetAscent()),
static_cast<jint>(info.GetDescent()),
static_cast<jint>(info.GetMinAltitude()),
@ -224,25 +180,17 @@ jobject CreateElevationInfo(JNIEnv * env, std::string const & serverId, Elevatio
jobject CreateMapObject(JNIEnv * env, place_page::Info const & info)
{
jni::TScopedLocalObjectArrayRef jratings(env, ToRatingArray(env, info.GetRatingCategories()));
jni::TScopedLocalIntArrayRef jTaxiTypes(env, ToReachableByTaxiProvidersArray(env, info.ReachableByTaxiProviders()));
jni::TScopedLocalObjectArrayRef jrawTypes(env, jni::ToJavaStringArray(env, info.GetRawTypes()));
jni::TScopedLocalRef routingPointInfo(env, nullptr);
if (info.IsRoutePoint())
routingPointInfo.reset(CreateRoutePointInfo(env, info));
jni::TScopedLocalRef hotelType(env, CreateHotelType(env, info));
jni::TScopedLocalRef popularity(env, CreatePopularity(env, info));
int priceRate = info.GetRawApproximatePricing().value_or(kPriceRateUndefined);
if (info.IsBookmark())
{
return CreateBookmark(env, info, jratings, jTaxiTypes, jrawTypes,
routingPointInfo, hotelType, popularity, priceRate);
return CreateBookmark(env, info, jrawTypes, routingPointInfo, popularity);
}
ms::LatLon const ll = info.GetLatLon();
@ -253,12 +201,10 @@ jobject CreateMapObject(JNIEnv * env, place_page::Info const & info)
return CreateMapObject(env, info.GetID().GetMwmName(), info.GetID().GetMwmVersion(),
info.GetID().m_index, kMyPosition, info.GetTitle(),
info.GetSecondaryTitle(), info.GetSubtitle(), ll.m_lat, ll.m_lon,
info.GetAddress(), {}, "", jTaxiTypes.get(),
info.GetBookingSearchUrl(), routingPointInfo.get(),
info.GetOpeningMode(), info.ShouldShowUGC(), info.CanBeRated(),
info.CanBeReviewed(), jratings.get(), hotelType.get(), priceRate,
info.GetAddress(), {}, "",
routingPointInfo.get(), info.GetOpeningMode(),
popularity.get(), info.GetDescription(), info.GetRoadType(),
info.IsTopChoice(), jrawTypes.get());
jrawTypes.get());
}
if (info.HasApiUrl())
@ -266,50 +212,17 @@ jobject CreateMapObject(JNIEnv * env, place_page::Info const & info)
return CreateMapObject(
env, info.GetID().GetMwmName(), info.GetID().GetMwmVersion(), info.GetID().m_index,
kApiPoint, info.GetTitle(), info.GetSecondaryTitle(), info.GetSubtitle(), ll.m_lat, ll.m_lon,
info.GetAddress(), info.GetMetadata(), info.GetApiUrl(), jTaxiTypes.get(),
info.GetBookingSearchUrl(), routingPointInfo.get(), info.GetOpeningMode(),
info.ShouldShowUGC(), info.CanBeRated(), info.CanBeReviewed(), jratings.get(),
hotelType.get(), priceRate, popularity.get(), info.GetDescription(), info.GetRoadType(),
info.IsTopChoice(), jrawTypes.get());
info.GetAddress(), info.GetMetadata(), info.GetApiUrl(),
routingPointInfo.get(), info.GetOpeningMode(), popularity.get(), info.GetDescription(),
info.GetRoadType(), jrawTypes.get());
}
return CreateMapObject(
env, info.GetID().GetMwmName(), info.GetID().GetMwmVersion(), info.GetID().m_index, kPoi,
info.GetTitle(), info.GetSecondaryTitle(), info.GetSubtitle(), ll.m_lat, ll.m_lon,
info.GetAddress(), info.HasMetadata() ? info.GetMetadata() : Metadata(), "",
jTaxiTypes.get(), info.GetBookingSearchUrl(), routingPointInfo.get(),
info.GetOpeningMode(), info.ShouldShowUGC(), info.CanBeRated(), info.CanBeReviewed(),
jratings.get(), hotelType.get(), priceRate, popularity.get(), info.GetDescription(),
info.GetRoadType(), info.IsTopChoice(), jrawTypes.get());
}
jobjectArray ToRatingArray(JNIEnv * env, std::vector<std::string> const & ratingCategories)
{
if (ratingCategories.empty())
return nullptr;
return jni::ToJavaArray(env, g_ratingClazz, ratingCategories,
[](JNIEnv * env, std::string const & item) {
return CreateRating(env, item);
});
}
jintArray ToReachableByTaxiProvidersArray(JNIEnv * env, std::vector<taxi::Provider::Type> const & types)
{
auto const count = static_cast<jsize>(types.size());
if (count == 0)
return nullptr;
jint tmp[count];
for (size_t i = 0; i < count; ++i)
tmp[i] = static_cast<jint>(types[i]);
jintArray result = env->NewIntArray(count);
ASSERT(result, ());
env->SetIntArrayRegion(result, 0, count, tmp);
return result;
routingPointInfo.get(), info.GetOpeningMode(), popularity.get(), info.GetDescription(),
info.GetRoadType(), jrawTypes.get());
}
jobject CreateRoutePointInfo(JNIEnv * env, place_page::Info const & info)

View file

@ -34,13 +34,10 @@ void InjectMetadata(JNIEnv * env, jclass clazz, jobject const mapObject, feature
jobject CreateMapObject(JNIEnv * env, place_page::Info const & info);
jobject CreateElevationInfo(JNIEnv * env, std::string const & serverId, ElevationInfo const & info);
jobject CreateElevationInfo(JNIEnv * env, ElevationInfo const & info);
jobjectArray ToRatingArray(JNIEnv * env, std::vector<std::string> const & ratingCategories);
jintArray ToReachableByTaxiProvidersArray(JNIEnv * env,
std::vector<taxi::Provider::Type> const & types);
jobject CreateLocalAdInfo(JNIEnv * env, place_page::Info const & info);
jobject CreateRoutePointInfo(JNIEnv * env, place_page::Info const & info);

View file

@ -31,33 +31,10 @@ jmethodID g_onBookmarksLoadingFinishedMethod;
jmethodID g_onBookmarksFileLoadedMethod;
jmethodID g_onFinishKmlConversionMethod;
jmethodID g_onPreparedFileForSharingMethod;
jmethodID g_onSynchronizationStartedMethod;
jmethodID g_onSynchronizationFinishedMethod;
jmethodID g_onRestoreRequestedMethod;
jmethodID g_onRestoredFilesPreparedMethod;
jmethodID g_onImportStartedMethod;
jmethodID g_onImportFinishedMethod;
jmethodID g_onTagsReceivedMethod;
jmethodID g_onCustomPropertiesReceivedMethod;
jmethodID g_onUploadStartedMethod;
jmethodID g_onUploadFinishedMethod;
jmethodID g_onElevationActivePointChangedMethod;
jmethodID g_onElevationCurrentPositionChangedMethod;
jclass g_bookmarkCategoryClass;
jmethodID g_bookmarkCategoryConstructor;
jclass g_catalogTagClass;
jmethodID g_catalogTagConstructor;
jclass g_catalogTagsGroupClass;
jmethodID g_catalogTagsGroupConstructor;
jclass g_catalogCustomPropertyOptionClass;
jmethodID g_catalogCustomPropertyOptionConstructor;
jclass g_catalogCustomPropertyClass;
jmethodID g_catalogCustomPropertyConstructor;
jmethodID g_onPingFinishedMethod;
jmethodID g_onCheckExpiredCategoriesMethod;
jclass g_sortedBlockClass;
jmethodID g_sortedBlockConstructor;
@ -95,35 +72,6 @@ void PrepareClassRefs(JNIEnv * env)
g_onPreparedFileForSharingMethod =
jni::GetMethodID(env, bookmarkManagerInstance, "onPreparedFileForSharing",
"(Lcom/mapswithme/maps/bookmarks/data/BookmarkSharingResult;)V");
g_onSynchronizationStartedMethod =
jni::GetMethodID(env, bookmarkManagerInstance, "onSynchronizationStarted", "(I)V");
g_onSynchronizationFinishedMethod =
jni::GetMethodID(env, bookmarkManagerInstance,
"onSynchronizationFinished", "(IILjava/lang/String;)V");
g_onRestoreRequestedMethod =
jni::GetMethodID(env, bookmarkManagerInstance, "onRestoreRequested", "(ILjava/lang/String;J)V");
g_onRestoredFilesPreparedMethod =
jni::GetMethodID(env, bookmarkManagerInstance, "onRestoredFilesPrepared", "()V");
g_onImportStartedMethod =
jni::GetMethodID(env, bookmarkManagerInstance, "onImportStarted", "(Ljava/lang/String;)V");
g_onImportFinishedMethod =
jni::GetMethodID(env, bookmarkManagerInstance, "onImportFinished", "(Ljava/lang/String;JZ)V");
g_onTagsReceivedMethod =
jni::GetMethodID(env, bookmarkManagerInstance, "onTagsReceived",
"(Z[Lcom/mapswithme/maps/bookmarks/data/CatalogTagsGroup;I)V");
g_onCustomPropertiesReceivedMethod =
jni::GetMethodID(env, bookmarkManagerInstance, "onCustomPropertiesReceived",
"(Z[Lcom/mapswithme/maps/bookmarks/data/CatalogCustomProperty;)V");
g_onUploadStartedMethod =
jni::GetMethodID(env, bookmarkManagerInstance, "onUploadStarted", "(J)V");
g_onUploadFinishedMethod =
jni::GetMethodID(env, bookmarkManagerInstance, "onUploadFinished", "(ILjava/lang/String;JJ)V");
g_onPingFinishedMethod = jni::GetMethodID(env, bookmarkManagerInstance, "onPingFinished", "(Z)V");
g_onCheckExpiredCategoriesMethod = jni::GetMethodID(env, bookmarkManagerInstance,
"onCheckExpiredCategories", "(Z)V");
g_longClass = jni::GetGlobalClassRef(env,"java/lang/Long");
g_longConstructor = jni::GetConstructorID(env, g_longClass, "(J)V");
@ -147,49 +95,22 @@ void PrepareClassRefs(JNIEnv * env)
//public BookmarkCategory(long id,
// String name,
// String authorId,
// String authorName,
// String annotation,
// String desc,
// int tracksCount,
// int bookmarksCount,
// boolean fromCatalog,
// boolean isMyCategory,
// boolean isVisible,
// String mImageUrl)
// boolean isVisible)
g_bookmarkCategoryConstructor =
jni::GetConstructorID(env, g_bookmarkCategoryClass,
"(JLjava/lang/String;Ljava/lang/String;"
"Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;"
"IIZZZILjava/lang/String;Ljava/lang/String;)V");
g_catalogTagClass =
jni::GetGlobalClassRef(env, "com/mapswithme/maps/bookmarks/data/CatalogTag");
//public CatalogTag(@NonNull String id, @NonNull String localizedName, float r, float g, float b)
g_catalogTagConstructor =
jni::GetConstructorID(env, g_catalogTagClass, "(Ljava/lang/String;Ljava/lang/String;FFF)V");
g_catalogTagsGroupClass =
jni::GetGlobalClassRef(env, "com/mapswithme/maps/bookmarks/data/CatalogTagsGroup");
//public CatalogTagsGroup(@NonNull String localizedName, @NonNull CatalogTag[] tags)
g_catalogTagsGroupConstructor =
jni::GetConstructorID(env, g_catalogTagsGroupClass,
"(Ljava/lang/String;[Lcom/mapswithme/maps/bookmarks/data/CatalogTag;)V");
g_catalogCustomPropertyOptionClass =
jni::GetGlobalClassRef(env, "com/mapswithme/maps/bookmarks/data/CatalogCustomPropertyOption");
//public CatalogCustomPropertyOption(@NonNull String value, @NonNull String localizedName)
g_catalogCustomPropertyOptionConstructor =
jni::GetConstructorID(env, g_catalogCustomPropertyOptionClass,
"(Ljava/lang/String;Ljava/lang/String;)V");
g_catalogCustomPropertyClass =
jni::GetGlobalClassRef(env, "com/mapswithme/maps/bookmarks/data/CatalogCustomProperty");
//public CatalogCustomProperty(@NonNull String key, @NonNull String localizedName,
// boolean isRequired, @NonNull CatalogCustomPropertyOption[] options)
g_catalogCustomPropertyConstructor =
jni::GetConstructorID(env, g_catalogCustomPropertyClass,
"(Ljava/lang/String;Ljava/lang/String;Z"
"[Lcom/mapswithme/maps/bookmarks/data/CatalogCustomPropertyOption;)V");
"("
"J" // id
"Ljava/lang/String;" // name
"Ljava/lang/String;" // annotation
"Ljava/lang/String;" // desc
"I" // tracksCount
"I" // bookmarksCount
"Z" // isVisible
")V");
g_onElevationCurrentPositionChangedMethod =
jni::GetMethodID(env, bookmarkManagerInstance, "onElevationCurrentPositionChanged", "()V");
g_onElevationActivePointChangedMethod =
@ -297,194 +218,6 @@ void OnPreparedFileForSharing(JNIEnv * env, BookmarkManager::SharingResult const
jni::HandleJavaException(env);
}
void OnSynchronizationStarted(JNIEnv * env, Cloud::SynchronizationType type)
{
ASSERT(g_bookmarkManagerClass, ());
jobject bookmarkManagerInstance = env->GetStaticObjectField(g_bookmarkManagerClass,
g_bookmarkManagerInstanceField);
env->CallVoidMethod(bookmarkManagerInstance, g_onSynchronizationStartedMethod,
static_cast<jint>(type));
jni::HandleJavaException(env);
}
void OnSynchronizationFinished(JNIEnv * env, Cloud::SynchronizationType type,
Cloud::SynchronizationResult result,
std::string const & errorStr)
{
ASSERT(g_bookmarkManagerClass, ());
jobject bookmarkManagerInstance = env->GetStaticObjectField(g_bookmarkManagerClass,
g_bookmarkManagerInstanceField);
env->CallVoidMethod(bookmarkManagerInstance, g_onSynchronizationFinishedMethod,
static_cast<jint>(type), static_cast<jint>(result),
jni::ToJavaString(env, errorStr));
jni::HandleJavaException(env);
}
void OnRestoreRequested(JNIEnv * env, Cloud::RestoringRequestResult result,
std::string const & deviceName, uint64_t backupTimestampInMs)
{
ASSERT(g_bookmarkManagerClass, ());
jobject bookmarkManagerInstance = env->GetStaticObjectField(g_bookmarkManagerClass,
g_bookmarkManagerInstanceField);
env->CallVoidMethod(bookmarkManagerInstance, g_onRestoreRequestedMethod,
static_cast<jint>(result), jni::ToJavaString(env, deviceName),
static_cast<jlong>(backupTimestampInMs));
jni::HandleJavaException(env);
}
void OnRestoredFilesPrepared(JNIEnv * env)
{
ASSERT(g_bookmarkManagerClass, ());
jobject bookmarkManagerInstance = env->GetStaticObjectField(g_bookmarkManagerClass,
g_bookmarkManagerInstanceField);
env->CallVoidMethod(bookmarkManagerInstance, g_onRestoredFilesPreparedMethod);
jni::HandleJavaException(env);
}
void OnImportStarted(JNIEnv * env, std::string const & serverId)
{
ASSERT(g_bookmarkManagerClass, ());
jobject bookmarkManagerInstance = env->GetStaticObjectField(g_bookmarkManagerClass,
g_bookmarkManagerInstanceField);
env->CallVoidMethod(bookmarkManagerInstance, g_onImportStartedMethod,
jni::ToJavaString(env, serverId));
jni::HandleJavaException(env);
}
void OnImportFinished(JNIEnv * env, std::string const & serverId, kml::MarkGroupId categoryId,
bool successful)
{
ASSERT(g_bookmarkManagerClass, ());
jobject bookmarkManagerInstance = env->GetStaticObjectField(g_bookmarkManagerClass,
g_bookmarkManagerInstanceField);
env->CallVoidMethod(bookmarkManagerInstance, g_onImportFinishedMethod,
jni::ToJavaString(env, serverId), static_cast<jlong>(categoryId),
static_cast<jboolean>(successful));
jni::HandleJavaException(env);
}
void OnTagsReceived(JNIEnv * env, bool successful, BookmarkCatalog::TagGroups const & groups,
uint32_t maxTagsCount)
{
ASSERT(g_bookmarkManagerClass, ());
ASSERT(g_catalogTagClass, ());
ASSERT(g_catalogTagsGroupClass, ());
jobject bookmarkManagerInstance = env->GetStaticObjectField(g_bookmarkManagerClass,
g_bookmarkManagerInstanceField);
jni::TScopedLocalObjectArrayRef tagGroupsRef(env,
jni::ToJavaArray(env, g_catalogTagsGroupClass, groups,
[](JNIEnv * env, BookmarkCatalog::TagGroup const & tagGroup)
{
jni::TScopedLocalRef tagGroupNameRef(env, jni::ToJavaString(env, tagGroup.m_name));
jni::TScopedLocalObjectArrayRef tagsRef(env,
jni::ToJavaArray(env, g_catalogTagClass, tagGroup.m_tags,
[](JNIEnv * env, BookmarkCatalog::Tag const & tag)
{
jni::TScopedLocalRef tagIdRef(env, jni::ToJavaString(env, tag.m_id));
jni::TScopedLocalRef tagNameRef(env, jni::ToJavaString(env, tag.m_name));
return env->NewObject(g_catalogTagClass, g_catalogTagConstructor,
tagIdRef.get(), tagNameRef.get(),
static_cast<jfloat>(tag.m_color[0]),
static_cast<jfloat>(tag.m_color[1]),
static_cast<jfloat>(tag.m_color[2]));
}));
return env->NewObject(g_catalogTagsGroupClass, g_catalogTagsGroupConstructor,
tagGroupNameRef.get(), tagsRef.get());
}));
env->CallVoidMethod(bookmarkManagerInstance, g_onTagsReceivedMethod,
static_cast<jboolean>(successful), tagGroupsRef.get(),
static_cast<jint>(maxTagsCount));
jni::HandleJavaException(env);
}
void OnCustomPropertiesReceived(JNIEnv * env, bool successful,
BookmarkCatalog::CustomProperties const & properties)
{
ASSERT(g_bookmarkManagerClass, ());
ASSERT(g_catalogCustomPropertyOptionClass, ());
ASSERT(g_catalogCustomPropertyClass, ());
jni::TScopedLocalObjectArrayRef propsRef(env,
jni::ToJavaArray(env, g_catalogCustomPropertyClass, properties,
[](JNIEnv * env, BookmarkCatalog::CustomProperty const & customProperty)
{
jni::TScopedLocalRef nameRef(env, jni::ToJavaString(env, customProperty.m_name));
jni::TScopedLocalRef keyRef(env, jni::ToJavaString(env, customProperty.m_key));
jni::TScopedLocalObjectArrayRef optionsRef(env,
jni::ToJavaArray(env, g_catalogCustomPropertyOptionClass, customProperty.m_options,
[](JNIEnv * env, BookmarkCatalog::CustomProperty::Option const & option)
{
jni::TScopedLocalRef valueRef(env, jni::ToJavaString(env, option.m_value));
jni::TScopedLocalRef optNameRef(env, jni::ToJavaString(env, option.m_name));
return env->NewObject(g_catalogCustomPropertyOptionClass,
g_catalogCustomPropertyOptionConstructor,
valueRef.get(), optNameRef.get());
}));
return env->NewObject(g_catalogCustomPropertyClass,
g_catalogCustomPropertyConstructor,
keyRef.get(), nameRef.get(),
static_cast<jboolean>(customProperty.m_isRequired),
optionsRef.get());
}));
jobject bookmarkManagerInstance = env->GetStaticObjectField(g_bookmarkManagerClass,
g_bookmarkManagerInstanceField);
env->CallVoidMethod(bookmarkManagerInstance, g_onCustomPropertiesReceivedMethod,
static_cast<jboolean>(successful), propsRef.get());
jni::HandleJavaException(env);
}
void OnPingFinished(JNIEnv * env, bool isSuccessful)
{
ASSERT(g_bookmarkManagerClass, ());
auto bookmarkManagerInstance = env->GetStaticObjectField(g_bookmarkManagerClass,
g_bookmarkManagerInstanceField);
env->CallVoidMethod(bookmarkManagerInstance, g_onPingFinishedMethod,
static_cast<jboolean>(isSuccessful));
jni::HandleJavaException(env);
}
void OnCheckExpiredCategories(JNIEnv * env, bool hasExpiredCategories)
{
ASSERT(g_bookmarkManagerClass, ());
auto bookmarkManagerInstance = env->GetStaticObjectField(g_bookmarkManagerClass,
g_bookmarkManagerInstanceField);
env->CallVoidMethod(bookmarkManagerInstance, g_onCheckExpiredCategoriesMethod,
static_cast<jboolean>(hasExpiredCategories));
jni::HandleJavaException(env);
}
void OnUploadStarted(JNIEnv * env, kml::MarkGroupId originCategoryId)
{
ASSERT(g_bookmarkManagerClass, ());
jobject bookmarkManagerInstance = env->GetStaticObjectField(g_bookmarkManagerClass,
g_bookmarkManagerInstanceField);
env->CallVoidMethod(bookmarkManagerInstance, g_onUploadStartedMethod,
static_cast<jlong>(originCategoryId));
jni::HandleJavaException(env);
}
void OnUploadFinished(JNIEnv * env, BookmarkCatalog::UploadResult uploadResult,
std::string const & description, kml::MarkGroupId originCategoryId,
kml::MarkGroupId resultCategoryId)
{
ASSERT(g_bookmarkManagerClass, ());
jobject bookmarkManagerInstance = env->GetStaticObjectField(g_bookmarkManagerClass,
g_bookmarkManagerInstanceField);
jni::TScopedLocalRef const descriptionStr(env, jni::ToJavaString(env, description));
env->CallVoidMethod(bookmarkManagerInstance, g_onUploadFinishedMethod,
static_cast<jint>(uploadResult), descriptionStr.get(),
static_cast<jlong>(originCategoryId), static_cast<jlong>(resultCategoryId));
jni::HandleJavaException(env);
}
void OnCategorySortingResults(JNIEnv * env, long long timestamp,
BookmarkManager::SortedBlocksCollection && sortedBlocks,
BookmarkManager::SortParams::Status status)
@ -547,40 +280,26 @@ jobject MakeCategory(JNIEnv * env, kml::MarkGroupId id)
auto const & manager = frm()->GetBookmarkManager();
auto const & data = manager.GetCategoryData(id);
auto const isFromCatalog = manager.IsCategoryFromCatalog(data.m_id);
auto const tracksCount = manager.GetTrackIds(data.m_id).size();
auto const bookmarksCount = manager.GetUserMarkIds(data.m_id).size();
auto const isMyCategory = manager.IsMyCategory(data.m_id);
auto const isVisible = manager.IsVisible(data.m_id);
auto const preferBookmarkStr = GetPreferredBookmarkStr(data.m_name);
auto const annotation = GetPreferredBookmarkStr(data.m_annotation);
auto const description = GetPreferredBookmarkStr(data.m_description);
auto const serverId = manager.GetCategoryServerId(data.m_id);
jni::TScopedLocalRef preferBookmarkStrRef(env, jni::ToJavaString(env, preferBookmarkStr));
jni::TScopedLocalRef authorIdRef(env, jni::ToJavaString(env, data.m_authorId));
jni::TScopedLocalRef authorNameRef(env, jni::ToJavaString(env, data.m_authorName));
jni::TScopedLocalRef annotationRef(env, jni::ToJavaString(env, annotation));
jni::TScopedLocalRef descriptionRef(env, jni::ToJavaString(env, description));
jni::TScopedLocalRef serverIdRef(env, jni::ToJavaString(env, serverId));
jni::TScopedLocalRef imageUrlRef(env, jni::ToJavaString(env, data.m_imageUrl));
return env->NewObject(g_bookmarkCategoryClass,
g_bookmarkCategoryConstructor,
static_cast<jlong>(data.m_id),
preferBookmarkStrRef.get(),
authorIdRef.get(),
authorNameRef.get(),
annotationRef.get(),
descriptionRef.get(),
static_cast<jint>(tracksCount),
static_cast<jint>(bookmarksCount),
static_cast<jboolean>(isFromCatalog),
static_cast<jboolean>(isMyCategory),
static_cast<jboolean>(isVisible),
static_cast<jint>(data.m_accessRules),
serverIdRef.get(),
imageUrlRef.get());
static_cast<jboolean>(isVisible));
}
jobjectArray MakeCategories(JNIEnv * env, kml::GroupIdCollection const & ids)
@ -616,18 +335,6 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeLoadBookmarks(JNIE
callbacks.m_onFileError = std::bind(&OnAsyncLoadingFileError, env, _1, _2);
frm()->GetBookmarkManager().SetAsyncLoadingCallbacks(std::move(callbacks));
frm()->GetBookmarkManager().SetCloudHandlers(
std::bind(&OnSynchronizationStarted, env, _1),
std::bind(&OnSynchronizationFinished, env, _1, _2, _3),
std::bind(&OnRestoreRequested, env, _1, _2, _3),
std::bind(&OnRestoredFilesPrepared, env));
frm()->GetBookmarkManager().SetCatalogHandlers(nullptr, nullptr,
std::bind(&OnImportStarted, env, _1),
std::bind(&OnImportFinished, env, _1, _2, _3),
std::bind(&OnUploadStarted, env, _1),
std::bind(&OnUploadFinished, env, _1, _2, _3, _4));
frm()->GetBookmarkManager().SetBookmarksChangedCallback(std::bind(&OnBookmarksChanged, env));
frm()->LoadBookmarks();
@ -820,15 +527,6 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetCategoryName(
static_cast<kml::MarkGroupId>(catId)));
}
JNIEXPORT jstring JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetCategoryAuthor(
JNIEnv * env, jobject thiz, jlong catId)
{
auto const & data = frm()->GetBookmarkManager().GetCategoryData(
static_cast<kml::MarkGroupId>(catId));
return ToJavaString(env, data.m_authorName);
}
JNIEXPORT jint JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetBookmarksCount(
JNIEnv * env, jobject thiz, jlong catId)
@ -991,51 +689,23 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativePrepareForSearch(
JNIEXPORT jboolean JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeAreAllCategoriesInvisible(
JNIEnv * env, jobject thiz, jint type)
JNIEnv * env, jobject thiz)
{
auto const value = static_cast<BookmarkManager::CategoryFilterType>(type);
return static_cast<jboolean>(frm()->GetBookmarkManager().AreAllCategoriesInvisible(value));
return static_cast<jboolean>(frm()->GetBookmarkManager().AreAllCategoriesInvisible());
}
JNIEXPORT jboolean JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeAreAllCategoriesVisible(
JNIEnv * env, jobject thiz, jint type)
JNIEnv * env, jobject thiz)
{
auto const value = static_cast<BookmarkManager::CategoryFilterType>(type);
return static_cast<jboolean>(frm()->GetBookmarkManager().AreAllCategoriesVisible(value));
return static_cast<jboolean>(frm()->GetBookmarkManager().AreAllCategoriesVisible());
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeSetAllCategoriesVisibility(
JNIEnv * env, jobject thiz, jboolean visible, jint type)
JNIEnv * env, jobject thiz, jboolean visible)
{
auto const filter = static_cast<BookmarkManager::CategoryFilterType>(type);
frm()->GetBookmarkManager().SetAllCategoriesVisibility(filter, static_cast<bool>(visible));
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeSetChildCategoriesVisibility(
JNIEnv * env, jobject thiz, jlong categoryId, jint compilationType, jboolean visible)
{
frm()->GetBookmarkManager().SetChildCategoriesVisibility(static_cast<kml::MarkGroupId>(categoryId),
static_cast<kml::CompilationType>(compilationType),
static_cast<bool>(visible));
}
JNIEXPORT jboolean JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeAreAllCompilationsInvisible(
JNIEnv * env, jobject thiz, jlong categoryId, jint compilationType)
{
return static_cast<jboolean>(frm()->GetBookmarkManager().AreAllCompilationsInvisible(static_cast<kml::MarkGroupId>(categoryId),
static_cast<kml::CompilationType>(compilationType)));
}
JNIEXPORT jboolean JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeAreAllCompilationsVisible(
JNIEnv * env, jobject thiz, jlong categoryId, jint compilationType)
{
return static_cast<jboolean>(frm()->GetBookmarkManager().AreAllCompilationsVisible(static_cast<kml::MarkGroupId>(categoryId),
static_cast<kml::CompilationType>(compilationType)));
frm()->GetBookmarkManager().SetAllCategoriesVisibility(static_cast<bool>(visible));
}
JNIEXPORT jint JNICALL
@ -1109,163 +779,6 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeAreNotificationsEn
return static_cast<jboolean>(frm()->GetBookmarkManager().AreNotificationsEnabled());
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeImportFromCatalog(
JNIEnv * env, jobject, jstring serverId, jstring filePath)
{
auto & bm = frm()->GetBookmarkManager();
bm.ImportDownloadedFromCatalog(ToNativeString(env, serverId), ToNativeString(env, filePath));
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeUploadToCatalog(
JNIEnv * env, jobject, jint accessRules, jlong catId)
{
auto & bm = frm()->GetBookmarkManager();
bm.UploadToCatalog(static_cast<kml::MarkGroupId>(catId),
static_cast<kml::AccessRules>(accessRules));
}
JNIEXPORT jstring JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetCatalogDeeplink(
JNIEnv * env, jobject, jlong catId)
{
auto & bm = frm()->GetBookmarkManager();
return ToJavaString(env, bm.GetCategoryCatalogDeeplink(static_cast<kml::MarkGroupId>(catId)));
}
JNIEXPORT jstring JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetCatalogPublicLink(
JNIEnv * env, jobject, jlong catId)
{
auto & bm = frm()->GetBookmarkManager();
return ToJavaString(env, bm.GetCategoryCatalogPublicLink(static_cast<kml::MarkGroupId>(catId)));
}
JNIEXPORT jstring JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetCatalogDownloadUrl(
JNIEnv * env, jobject, jstring serverId)
{
auto & bm = frm()->GetBookmarkManager();
return ToJavaString(env, bm.GetCatalog().GetDownloadUrl(ToNativeString(env, serverId)));
}
JNIEXPORT jstring JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetWebEditorUrl(
JNIEnv * env, jobject, jstring serverId)
{
auto & bm = frm()->GetBookmarkManager();
return ToJavaString(env, bm.GetCatalog().GetWebEditorUrl(ToNativeString(env, serverId),
languages::GetCurrentNorm()));
}
JNIEXPORT jstring JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetCatalogFrontendUrl(
JNIEnv * env, jobject, jint utm)
{
auto & bm = frm()->GetBookmarkManager();
return ToJavaString(env, bm.GetCatalog().GetFrontendUrl(static_cast<UTM>(utm)));
}
JNIEXPORT jobjectArray JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetCatalogHeaders(JNIEnv * env,
jobject)
{
auto const & bm = frm()->GetBookmarkManager();
return jni::ToKeyValueArray(env, bm.GetCatalog().GetHeaders());
}
JNIEXPORT jstring JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeInjectCatalogUTMContent(JNIEnv * env,
jobject, jstring url, jint content)
{
return ToJavaString(env, InjectUTMContent(ToNativeString(env, url),
static_cast<UTMContent>(content)));
}
JNIEXPORT jboolean JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeIsCategoryFromCatalog(
JNIEnv *, jobject, jlong catId)
{
auto & bm = frm()->GetBookmarkManager();
return static_cast<jboolean>(bm.IsCategoryFromCatalog(static_cast<kml::MarkGroupId>(catId)));
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeRequestCatalogTags(
JNIEnv * env, jobject)
{
auto & bm = frm()->GetBookmarkManager();
bm.GetCatalog().RequestTagGroups(languages::GetCurrentNorm(),
[env](bool successful, BookmarkCatalog::TagGroups const & groups, uint32_t maxTagsCount)
{
OnTagsReceived(env, successful, groups, maxTagsCount);
});
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeRequestCatalogCustomProperties(
JNIEnv * env, jobject)
{
auto & bm = frm()->GetBookmarkManager();
bm.GetCatalog().RequestCustomProperties(languages::GetCurrentNorm(),
[env](bool successful, BookmarkCatalog::CustomProperties const & properties)
{
OnCustomPropertiesReceived(env, successful, properties);
});
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativePingBookmarkCatalog(
JNIEnv * env, jobject)
{
auto & bm = frm()->GetBookmarkManager();
bm.GetCatalog().Ping([env](bool isSuccessful)
{
OnPingFinished(env, isSuccessful);
});
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeCheckExpiredCategories(JNIEnv * env,
jobject)
{
frm()->GetBookmarkManager().CheckExpiredCategories([env](bool hasExpiredCategories)
{
OnCheckExpiredCategories(env, hasExpiredCategories);
});
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeDeleteExpiredCategories(JNIEnv * env,
jobject)
{
frm()->GetBookmarkManager().DeleteExpiredCategories();
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeResetExpiredCategories(JNIEnv * env,
jobject)
{
frm()->GetBookmarkManager().ResetExpiredCategories();
}
JNIEXPORT jstring JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGuidesIds(JNIEnv * env, jobject)
{
auto & bm = frm()->GetBookmarkManager();
auto const guides = bm.GetCategoriesFromCatalog(
std::bind(&BookmarkManager::IsGuide, std::placeholders::_1));
return ToJavaString(env, strings::JoinStrings(guides.begin(), guides.end(), ','));
}
JNIEXPORT jboolean JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeIsGuide(JNIEnv * env, jobject,
jint accessRulesIndex)
{
return static_cast<jboolean>(BookmarkManager::IsGuide(static_cast<kml::AccessRules>(accessRulesIndex)));
}
JNIEXPORT jobject JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetBookmarkCategory(JNIEnv *env,
jobject,
@ -1306,22 +819,6 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetChildrenCollect
return MakeCategories(env, ids);
}
JNIEXPORT jboolean JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeIsCompilation(JNIEnv *env, jobject,
jlong id)
{
auto const & bm = frm()->GetBookmarkManager();
return static_cast<jboolean>(bm.IsCompilation(static_cast<kml::MarkGroupId>(id)));
}
JNIEXPORT jint JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetCompilationType(JNIEnv *env,
jobject, jlong id)
{
auto const & bm = frm()->GetBookmarkManager();
return static_cast<jint>(bm.GetCompilationType(static_cast<kml::MarkGroupId>(id)));
}
JNIEXPORT jboolean JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeHasLastSortingType(
JNIEnv *, jobject, jlong catId)

View file

@ -1,189 +0,0 @@
#include "com/mapswithme/core/jni_helper.hpp"
#include "com/mapswithme/maps/Framework.hpp"
#include "com/mapswithme/maps/SearchEngine.hpp"
#include "com/mapswithme/maps/discovery/Locals.hpp"
#include "com/mapswithme/maps/promo/Promo.hpp"
#include "map/discovery/discovery_manager.hpp"
#include "map/search_product_info.hpp"
#include "search/result.hpp"
#include "geometry/mercator.hpp"
#include "platform/preferred_languages.hpp"
#include <memory>
#include <utility>
#include <vector>
using namespace std::placeholders;
namespace
{
jclass g_discoveryManagerClass = nullptr;
jfieldID g_discoveryManagerInstanceField;
jmethodID g_onResultReceivedMethod;
jmethodID g_onLocalExpertsReceivedMethod;
jmethodID g_onCityGalleryReceivedMethod;
jmethodID g_onErrorMethod;
uint32_t g_lastRequestId = 0;
void PrepareClassRefs(JNIEnv * env)
{
if (g_discoveryManagerClass != nullptr)
return;
g_discoveryManagerClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/discovery/DiscoveryManager");
g_discoveryManagerInstanceField = jni::GetStaticFieldID(env, g_discoveryManagerClass, "INSTANCE",
"Lcom/mapswithme/maps/discovery/DiscoveryManager;");
jobject discoveryManagerInstance = env->GetStaticObjectField(g_discoveryManagerClass,
g_discoveryManagerInstanceField);
g_onResultReceivedMethod = jni::GetMethodID(env, discoveryManagerInstance, "onResultReceived",
"([Lcom/mapswithme/maps/search/SearchResult;I)V");
g_onLocalExpertsReceivedMethod = jni::GetMethodID(env, discoveryManagerInstance,
"onLocalExpertsReceived",
"([Lcom/mapswithme/maps/discovery/LocalExpert;)V");
g_onCityGalleryReceivedMethod = jni::GetMethodID(env, discoveryManagerInstance,
"onPromoCityGalleryReceived",
"(Lcom/mapswithme/maps/promo/PromoCityGallery;)V");
g_onErrorMethod = jni::GetMethodID(env, discoveryManagerInstance, "onError", "(I)V");
}
struct DiscoveryCallback
{
void operator()(uint32_t const requestId, search::Results const & results,
std::vector<search::ProductInfo> const & productInfo,
discovery::ItemType const type, m2::PointD const & viewportCenter) const
{
if (g_lastRequestId != requestId)
return;
ASSERT(g_discoveryManagerClass != nullptr, ());
JNIEnv * env = jni::GetEnv();
auto const lat = mercator::YToLat(viewportCenter.y);
auto const lon = mercator::XToLon(viewportCenter.x);
jni::TScopedLocalObjectArrayRef jResults(
env, BuildSearchResults(results, productInfo, true /* hasPosition */, lat, lon));
jobject discoveryManagerInstance = env->GetStaticObjectField(g_discoveryManagerClass,
g_discoveryManagerInstanceField);
env->CallVoidMethod(discoveryManagerInstance, g_onResultReceivedMethod,
jResults.get(), static_cast<jint>(type));
jni::HandleJavaException(env);
}
void operator()(uint32_t const requestId, std::vector<locals::LocalExpert> const & experts) const
{
if (g_lastRequestId != requestId)
return;
ASSERT(g_discoveryManagerClass != nullptr, ());
JNIEnv * env = jni::GetEnv();
jni::TScopedLocalObjectArrayRef jLocals(env, ToLocalExpertsArray(experts));
jobject discoveryManagerInstance = env->GetStaticObjectField(g_discoveryManagerClass,
g_discoveryManagerInstanceField);
env->CallVoidMethod(discoveryManagerInstance, g_onLocalExpertsReceivedMethod, jLocals.get());
jni::HandleJavaException(env);
}
void operator()(uint32_t const requestId, promo::CityGallery const & cityGallery) const
{
if (g_lastRequestId != requestId)
return;
ASSERT(g_discoveryManagerClass != nullptr, ());
JNIEnv * env = jni::GetEnv();
jni::TScopedLocalRef gallery(env, promo::MakeCityGallery(env, cityGallery));
jobject discoveryManagerInstance =
env->GetStaticObjectField(g_discoveryManagerClass, g_discoveryManagerInstanceField);
env->CallVoidMethod(discoveryManagerInstance, g_onCityGalleryReceivedMethod, gallery.get());
jni::HandleJavaException(env);
}
};
void OnDiscoveryError(uint32_t const requestId, discovery::ItemType const type)
{
if (g_lastRequestId != requestId)
return;
ASSERT(g_discoveryManagerClass != nullptr, ());
JNIEnv * env = jni::GetEnv();
jobject discoveryManagerInstance = env->GetStaticObjectField(g_discoveryManagerClass,
g_discoveryManagerInstanceField);
env->CallVoidMethod(discoveryManagerInstance, g_onErrorMethod, static_cast<jint>(type));
jni::HandleJavaException(env);
}
} // namespace
extern "C" {
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_discovery_DiscoveryManager_nativeDiscover(JNIEnv * env, jclass,
jobject params)
{
PrepareClassRefs(env);
discovery::ClientParams p;
auto const paramsClass = env->GetObjectClass(params);
static auto const currencyField = env->GetFieldID(paramsClass, "mCurrency", "Ljava/lang/String;");
{
auto const currency = static_cast<jstring>(env->GetObjectField(params, currencyField));
std::string const res = jni::ToNativeString(env, currency);
if (!res.empty())
p.m_currency = res;
}
static auto const langField = env->GetFieldID(paramsClass, "mLang", "Ljava/lang/String;");
{
auto const lang = static_cast<jstring>(env->GetObjectField(params, langField));
std::string const res = languages::Normalize(jni::ToNativeString(env, lang));
if (!res.empty())
p.m_lang = res;
}
static auto const itemsCountField = env->GetFieldID(paramsClass, "mItemsCount", "I");
{
auto const count = env->GetIntField(params, itemsCountField);
ASSERT_GREATER(count, 0, ());
p.m_itemsCount = static_cast<size_t>(count);
}
static auto const itemTypesField = env->GetFieldID(paramsClass, "mItemTypes", "[I");
{
auto const array = static_cast<jintArray>(env->GetObjectField(params, itemTypesField));
auto const length = env->GetArrayLength(array);
ASSERT_GREATER(length, 0, ());
auto const dtor = [array, env](jint * data) { env->ReleaseIntArrayElements(array, data, 0); };
std::unique_ptr<jint, decltype(dtor)> data{env->GetIntArrayElements(array, nullptr), dtor};
std::vector<discovery::ItemType> itemTypes;
for (jsize i = 0; i < length; ++i)
itemTypes.emplace_back(static_cast<discovery::ItemType>(data.get()[i]));
p.m_itemTypes = std::move(itemTypes);
}
g_lastRequestId = g_framework->NativeFramework()->Discover(std::move(p), DiscoveryCallback(),
std::bind(&OnDiscoveryError, _1, _2));
}
JNIEXPORT jstring JNICALL
Java_com_mapswithme_maps_discovery_DiscoveryManager_nativeGetLocalExpertsUrl(JNIEnv * env, jclass)
{
return jni::ToJavaString(env, g_framework->NativeFramework()->GetDiscoveryLocalExpertsUrl());
}
} // extern "C"

View file

@ -1,121 +0,0 @@
#include "com/mapswithme/maps/discovery/Locals.hpp"
#include "com/mapswithme/maps/Framework.hpp"
#include <string>
namespace
{
jclass g_localsClass = nullptr;
jobject g_localsInstance;
jmethodID g_onLocalsReceivedMethod;
jmethodID g_onLocalsErrorReceivedMethod;
jclass g_localExpertClass;
jmethodID g_localExpertConstructor;
jclass g_localErrorClass;
jmethodID g_localErrorConstructor;
uint64_t g_lastRequestId = 0;
void PrepareClassRefs(JNIEnv * env)
{
if (g_localsClass != nullptr)
return;
g_localsClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/discovery/Locals");
static jfieldID const localsInstanceField = jni::GetStaticFieldID(env, g_localsClass, "INSTANCE",
"Lcom/mapswithme/maps/discovery/Locals;");
g_localsInstance = env->GetStaticObjectField(g_localsClass, localsInstanceField);
g_onLocalsReceivedMethod = jni::GetMethodID(env, g_localsInstance, "onLocalsReceived",
"([Lcom/mapswithme/maps/discovery/LocalExpert;)V");
g_onLocalsErrorReceivedMethod = jni::GetMethodID(env, g_localsInstance,
"onLocalsErrorReceived",
"(Lcom/mapswithme/maps/discovery/LocalsError;)V");
// int id, @NonNull String name, @NonNull String country,
// @NonNull String city, double rating, int reviewCount,
// double price, @NonNull String currency, @NonNull String motto,
// @NonNull String about, @NonNull String offer, @NonNull String pageUrl,
// @NonNull String photoUrl
g_localExpertClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/discovery/LocalExpert");
g_localExpertConstructor =
jni::GetConstructorID(env, g_localExpertClass,
"(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;DID"
"Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;"
"Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
// @ErrorCode int code, @NonNull String message
g_localErrorClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/discovery/LocalsError");
g_localErrorConstructor = jni::GetConstructorID(env, g_localErrorClass,
"(ILjava/lang/String;)V");
}
} // namespace
jobjectArray ToLocalExpertsArray(std::vector<locals::LocalExpert> const & locals)
{
JNIEnv * env = jni::GetEnv();
PrepareClassRefs(env);
auto const localExpertBuilder = [](JNIEnv * env, locals::LocalExpert const & expert)
{
jni::TScopedLocalRef jName(env, jni::ToJavaString(env, expert.m_name));
jni::TScopedLocalRef jCountry(env, jni::ToJavaString(env, expert.m_country));
jni::TScopedLocalRef jCity(env, jni::ToJavaString(env, expert.m_city));
jni::TScopedLocalRef jCurrency(env, jni::ToJavaString(env, expert.m_currency));
jni::TScopedLocalRef jMotto(env, jni::ToJavaString(env, expert.m_motto));
jni::TScopedLocalRef jAboutExpert(env, jni::ToJavaString(env, expert.m_aboutExpert));
jni::TScopedLocalRef jOfferDescription(env, jni::ToJavaString(env, expert.m_offerDescription));
jni::TScopedLocalRef jPageUrl(env, jni::ToJavaString(env, expert.m_pageUrl));
jni::TScopedLocalRef jPhotoUrl(env, jni::ToJavaString(env, expert.m_photoUrl));
return env->NewObject(g_localExpertClass, g_localExpertConstructor,
expert.m_id, jName.get(), jCountry.get(), jCity.get(),
expert.m_rating, expert.m_reviewCount, expert.m_pricePerHour,
jCurrency.get(), jMotto.get(), jAboutExpert.get(),
jOfferDescription.get(), jPageUrl.get(), jPhotoUrl.get());
};
return jni::ToJavaArray(env, g_localExpertClass, locals, localExpertBuilder);
}
void OnLocalsSuccess(uint64_t requestId, std::vector<locals::LocalExpert> const & locals,
size_t pageNumber, size_t countPerPage, bool hasPreviousPage,
bool hasNextPage)
{
if (g_lastRequestId != requestId)
return;
JNIEnv * env = jni::GetEnv();
jni::TScopedLocalObjectArrayRef jLocals(env, ToLocalExpertsArray(locals));
env->CallVoidMethod(g_localsInstance, g_onLocalsReceivedMethod, jLocals.get());
jni::HandleJavaException(env);
}
void OnLocalsError(uint64_t requestId, int errorCode, std::string const & errorMessage)
{
if (g_lastRequestId != requestId)
return;
JNIEnv * env = jni::GetEnv();
jni::TScopedLocalRef errorStr(env, jni::ToJavaString(env, errorMessage));
jni::TScopedLocalRef errorObj(env, env->NewObject(g_localErrorClass, g_localErrorConstructor,
errorCode, errorStr.get()));
env->CallVoidMethod(g_localsInstance, g_onLocalsErrorReceivedMethod, errorObj.get());
jni::HandleJavaException(env);
}
extern "C" {
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_discovery_Locals_nativeRequestLocals(JNIEnv * env, jclass clazz,
jobject policy, jdouble lat,
jdouble lon)
{
PrepareClassRefs(env);
g_lastRequestId = g_framework->GetLocals(env, policy, lat, lon, &OnLocalsSuccess,
&OnLocalsError);
}
} // extern "C"

View file

@ -1,8 +0,0 @@
#pragma once
#include "com/mapswithme/core/jni_helper.hpp"
#include <vector>
extern jobjectArray ToLocalExpertsArray(std::vector<locals::LocalExpert> const & locals);

View file

@ -1,116 +0,0 @@
#include "android/jni/com/mapswithme/maps/guides/Guides.hpp"
#include "android/jni/com/mapswithme/platform/Platform.hpp"
namespace
{
jclass g_galleryClass = nullptr;
jclass g_itemClass = nullptr;
jclass g_cityParamsClass = nullptr;
jclass g_outdoorParamsClass = nullptr;
jmethodID g_galleryConstructor = nullptr;
jmethodID g_itemConstructor = nullptr;
jmethodID g_cityParamsConstructor = nullptr;
jmethodID g_outdoorParamsConstructor = nullptr;
void PrepareClassRefs(JNIEnv *env)
{
if (g_galleryClass != nullptr)
return;
g_galleryClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/guides/GuidesGallery");
g_galleryConstructor = jni::GetConstructorID(env, g_galleryClass,
"([Lcom/mapswithme/maps/guides/GuidesGallery$Item;)V");
g_itemClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/guides/GuidesGallery$Item");
// public Item(@NonNull String guideId, @NonNull String url, @NonNull String imageUrl,
// @NonNull String title, @NonNull String subTitle, int type,
// boolean downloaded, @Nullable CityParams cityParams,
// @Nullable OutdoorParams outdoorParams)
g_itemConstructor
= jni::GetConstructorID(env, g_itemClass, "(Ljava/lang/String;Ljava/lang/String;"
"Ljava/lang/String;Ljava/lang/String;"
"IZLcom/mapswithme/maps/guides/GuidesGallery$CityParams;"
"Lcom/mapswithme/maps/guides/GuidesGallery$OutdoorParams;)"
"V");
g_cityParamsClass
= jni::GetGlobalClassRef(env, "com/mapswithme/maps/guides/GuidesGallery$CityParams");
// public CityParams(int bookmarksCount, boolean isTrackAvailable)
g_cityParamsConstructor = jni::GetConstructorID(env, g_cityParamsClass, "(IZ)V");
g_outdoorParamsClass
= jni::GetGlobalClassRef(env, "com/mapswithme/maps/guides/GuidesGallery$OutdoorParams");
// public OutdoorParams(double distance, long duration, int ascent)
g_outdoorParamsConstructor
= jni::GetConstructorID(env, g_outdoorParamsClass, "(Ljava/lang/String;DJI)V");
jni::HandleJavaException(env);
}
} // namespace
namespace guides
{
jobject CreateGallery(JNIEnv *env, GuidesManager::GuidesGallery const & gallery)
{
PrepareClassRefs(env);
auto const itemBuilder = [](JNIEnv *env, GuidesManager::GuidesGallery::Item const & item)
{
jni::TScopedLocalRef guideId(env, jni::ToJavaString(env, item.m_guideId));
jni::TScopedLocalRef url(env, jni::ToJavaString(env, item.m_url));
jni::TScopedLocalRef imageUrl(env, jni::ToJavaString(env, item.m_imageUrl));
jni::TScopedLocalRef title(env, jni::ToJavaString(env, item.m_title));
auto const type = static_cast<jint>(item.m_type);
auto const downloaded = static_cast<jboolean>(item.m_downloaded);
jni::TScopedLocalRef cityParams(env, nullptr);
jni::TScopedLocalRef outdoorParams(env, nullptr);
if (item.m_type == GuidesManager::GuidesGallery::Item::Type::City)
{
cityParams.reset(env->NewObject(g_cityParamsClass, g_cityParamsConstructor,
static_cast<jint>(item.m_cityParams.m_bookmarksCount),
static_cast<jboolean>(item.m_cityParams.m_trackIsAvailable)));
} else if (item.m_type == GuidesManager::GuidesGallery::Item::Type::Outdoor)
{
outdoorParams.reset(env->NewObject(g_outdoorParamsClass, g_outdoorParamsConstructor,
jni::ToJavaString(env, item.m_outdoorsParams.m_tag),
static_cast<jdouble>(item.m_outdoorsParams.m_distance),
static_cast<jlong>(item.m_outdoorsParams.m_duration),
static_cast<jint>(item.m_outdoorsParams.m_ascent)));
}
return env->NewObject(g_itemClass, g_itemConstructor, guideId.get(), url.get(), imageUrl.get(),
title.get(), type, downloaded, cityParams.get(),
outdoorParams.get());
};
jni::TScopedLocalObjectArrayRef items(env, jni::ToJavaArray(env, g_itemClass, gallery.m_items,
itemBuilder));
return env->NewObject(g_galleryClass, g_galleryConstructor, items.get());
}
} // namespace guides
namespace platform
{
bool IsGuidesLayerFirstLaunch()
{
JNIEnv * env = jni::GetEnv();
static const jclass sharedPropertiesClass = jni::GetGlobalClassRef(env, "com/mapswithme/util/SharedPropertiesUtils");
static const jmethodID getter = jni::GetStaticMethodID(env, sharedPropertiesClass,
"shouldShowNewMarkerForLayerMode",
"(Landroid/content/Context;Ljava/lang/String;)Z");
jobject context = android::Platform::Instance().GetContext();
jni::ScopedLocalRef mode(env, jni::ToJavaString(env, "GUIDES"));
return env->CallStaticBooleanMethod(sharedPropertiesClass, getter, context, mode.get());
}
void SetGuidesLayerFirstLaunch(bool /* isFirstLaunch */)
{
JNIEnv * env = jni::GetEnv();
static const jclass sharedPropertiesClass = jni::GetGlobalClassRef(env, "com/mapswithme/util/SharedPropertiesUtils");
static const jmethodID setter = jni::GetStaticMethodID(env, sharedPropertiesClass,
"setLayerMarkerShownForLayerMode",
"(Landroid/content/Context;Ljava/lang/String;)V");
jobject context = android::Platform::Instance().GetContext();
jni::ScopedLocalRef mode(env, jni::ToJavaString(env, "GUIDES"));
env->CallStaticVoidMethod(sharedPropertiesClass, setter, context, mode.get());
}
} // namespace platform

View file

@ -1,15 +0,0 @@
#pragma once
#include "com/mapswithme/core/jni_helper.hpp"
#include "map/guides_manager.hpp"
namespace guides
{
jobject CreateGallery(JNIEnv * env, GuidesManager::GuidesGallery const & gallery);
} // namespace
namespace platform
{
bool IsGuidesLayerFirstLaunch();
void SetGuidesLayerFirstLaunch(bool isFirstLaunch);
} // namespace platform

View file

@ -1,113 +0,0 @@
#include "com/mapswithme/core/jni_helper.hpp"
#include "com/mapswithme/maps/Framework.hpp"
#include "com/mapswithme/maps/guides/Guides.hpp"
#include "com/mapswithme/platform/Platform.hpp"
#include <jni.h>
namespace
{
jclass g_guidesManagerClass = nullptr;
jmethodID g_guidesManagerFromMethod = nullptr;
jmethodID g_onGalleryChangedMethod = nullptr;
std::shared_ptr<jobject> g_guidesManager = nullptr;
void PrepareClassRefs(JNIEnv *env)
{
if (g_guidesManagerClass != nullptr)
return;
g_guidesManagerClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/maplayer/guides/GuidesManager");
g_guidesManagerFromMethod = jni::GetStaticMethodID(
env, g_guidesManagerClass, "from",
"(Landroid/content/Context;)Lcom/mapswithme/maps/maplayer/guides/GuidesManager;");
auto context = android::Platform::Instance().GetContext();
g_guidesManager = jni::make_global_ref(env->CallStaticObjectMethod(g_guidesManagerClass,
g_guidesManagerFromMethod,
context));
g_onGalleryChangedMethod = jni::GetMethodID(env, *g_guidesManager, "onGalleryChanged", "(Z)V");
jni::HandleJavaException(env);
}
static void GuidesStateChanged(GuidesManager::GuidesState state,
std::shared_ptr<jobject> const & listener)
{
JNIEnv * env = jni::GetEnv();
env->CallVoidMethod(*listener, jni::GetMethodID(env, *listener, "onStateChanged", "(I)V"),
static_cast<jint>(state));
jni::HandleJavaException(env);
}
static void GalleryChanged(bool reload)
{
JNIEnv * env = jni::GetEnv();
PrepareClassRefs(env);
env->CallVoidMethod(*g_guidesManager, g_onGalleryChangedMethod, static_cast<jboolean>(reload));
jni::HandleJavaException(env);
}
} // namespace
extern "C"
{
using namespace std::placeholders;
JNIEXPORT void JNICALL Java_com_mapswithme_maps_maplayer_guides_GuidesManager_nativeSetGuidesStateChangedListener(
JNIEnv * env, jclass clazz, jobject listener)
{
CHECK(g_framework, ("Framework isn't created yet!"));
g_framework->SetGuidesListener(
std::bind(&GuidesStateChanged, std::placeholders::_1, jni::make_global_ref(listener)));
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_maplayer_guides_GuidesManager_nativeRemoveGuidesStateChangedListener(
JNIEnv * env, jclass clazz)
{
CHECK(g_framework, ("Framework isn't created yet!"));
g_framework->SetGuidesListener(nullptr);
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_maplayer_guides_GuidesManager_nativeSetActiveGuide(
JNIEnv * env, jclass clazz, jstring guideId)
{
CHECK(g_framework, ("Framework isn't created yet!"));
auto & manager = g_framework->NativeFramework()->GetGuidesManager();
manager.SetActiveGuide(jni::ToNativeString(env, guideId));
}
JNIEXPORT jstring JNICALL
Java_com_mapswithme_maps_maplayer_guides_GuidesManager_nativeGetActiveGuide(
JNIEnv * env, jclass clazz)
{
CHECK(g_framework, ("Framework isn't created yet!"));
auto & manager = g_framework->NativeFramework()->GetGuidesManager();
return jni::ToJavaString(env, manager.GetActiveGuide());
}
JNIEXPORT jobject JNICALL
Java_com_mapswithme_maps_maplayer_guides_GuidesManager_nativeGetGallery(
JNIEnv * env, jclass clazz)
{
CHECK(g_framework, ("Framework isn't created yet!"));
auto & manager = g_framework->NativeFramework()->GetGuidesManager();
auto const gallery = manager.GetGallery();
return guides::CreateGallery(env, gallery);
}
JNIEXPORT void JNICALL Java_com_mapswithme_maps_maplayer_guides_GuidesManager_nativeSetGalleryChangedListener(
JNIEnv * env, jclass clazz)
{
CHECK(g_framework, ("Framework isn't created yet!"));
auto & manager = g_framework->NativeFramework()->GetGuidesManager();
manager.SetGalleryListener(std::bind(&GalleryChanged, std::placeholders::_1));
}
JNIEXPORT void JNICALL Java_com_mapswithme_maps_maplayer_guides_GuidesManager_nativeRemoveGalleryChangedListener(
JNIEnv * env, jclass clazz)
{
CHECK(g_framework, ("Framework isn't created yet!"));
auto & manager = g_framework->NativeFramework()->GetGuidesManager();
manager.SetGalleryListener(nullptr);
}
}

View file

@ -1,24 +0,0 @@
#include "com/mapswithme/core/jni_helper.hpp"
#include "map/onboarding.hpp"
extern "C"
{
JNIEXPORT jobject JNICALL
Java_com_mapswithme_maps_onboarding_OnboardingTip_nativeGetTip(JNIEnv * env, jclass)
{
if (!onboarding::CanShowTipButton())
return nullptr;
static jclass g_tipClass =
jni::GetGlobalClassRef(env, "com/mapswithme/maps/onboarding/OnboardingTip");
static jmethodID g_tipConstructor =
jni::GetConstructorID(env, g_tipClass, "(ILjava/lang/String;)V");
auto const tip = onboarding::GetTip();
jni::TScopedLocalRef url(env, jni::ToJavaString(env, tip.m_url));
return env->NewObject(g_tipClass, g_tipConstructor, static_cast<jint>(tip.m_type), url.get());
}
} // extern "C"

View file

@ -1,197 +0,0 @@
#include "com/mapswithme/maps/promo/Promo.hpp"
#include "com/mapswithme/maps/Framework.hpp"
#include "geometry/mercator.hpp"
#include <utility>
using namespace std::placeholders;
namespace
{
jclass g_galleryClass = nullptr;
jclass g_itemClass = nullptr;
jclass g_placeClass = nullptr;
jclass g_authorClass = nullptr;
jclass g_categoryClass = nullptr;
jmethodID g_galleryConstructor = nullptr;
jmethodID g_itemConstructor = nullptr;
jmethodID g_placeConstructor = nullptr;
jmethodID g_authorConstructor = nullptr;
jmethodID g_categoryConstructor = nullptr;
jclass g_promoClass = nullptr;
jfieldID g_promoInstanceField = nullptr;
jmethodID g_onGalleryReceived = nullptr;
jmethodID g_onErrorReceived = nullptr;
jclass g_afterBooking = nullptr;
jmethodID g_afterBookingConstructor = nullptr;
uint64_t g_lastRequestId = 0;
void PrepareClassRefs(JNIEnv * env)
{
if (g_galleryClass != nullptr)
return;
g_galleryClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/promo/PromoCityGallery");
g_galleryConstructor =
jni::GetConstructorID(env, g_galleryClass,
"([Lcom/mapswithme/maps/promo/PromoCityGallery$Item;"
"Ljava/lang/String;Ljava/lang/String;)V");
g_itemClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/promo/PromoCityGallery$Item");
g_itemConstructor =
jni::GetConstructorID(env, g_itemClass,
"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;"
"Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;"
"Lcom/mapswithme/maps/promo/PromoCityGallery$Place;"
"Lcom/mapswithme/maps/promo/PromoCityGallery$Author;"
"Lcom/mapswithme/maps/promo/PromoCityGallery$LuxCategory;)V");
g_placeClass =
jni::GetGlobalClassRef(env, "com/mapswithme/maps/promo/PromoCityGallery$Place");
g_placeConstructor =
jni::GetConstructorID(env, g_placeClass, "(Ljava/lang/String;Ljava/lang/String;)V");
g_authorClass =
jni::GetGlobalClassRef(env, "com/mapswithme/maps/promo/PromoCityGallery$Author");
g_authorConstructor =
jni::GetConstructorID(env, g_authorClass, "(Ljava/lang/String;Ljava/lang/String;)V");
g_categoryClass =
jni::GetGlobalClassRef(env, "com/mapswithme/maps/promo/PromoCityGallery$LuxCategory");
g_categoryConstructor =
jni::GetConstructorID(env, g_categoryClass, "(Ljava/lang/String;Ljava/lang/String;)V");
g_promoClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/promo/Promo");
g_promoInstanceField =
jni::GetStaticFieldID(env, g_promoClass, "INSTANCE", "Lcom/mapswithme/maps/promo/Promo;");
jobject promoInstance = env->GetStaticObjectField(g_promoClass, g_promoInstanceField);
g_onGalleryReceived = jni::GetMethodID(env, promoInstance, "onCityGalleryReceived",
"(Lcom/mapswithme/maps/promo/PromoCityGallery;)V");
g_onErrorReceived = jni::GetMethodID(env, promoInstance, "onErrorReceived", "()V");
g_afterBooking = jni::GetGlobalClassRef(env, "com/mapswithme/maps/promo/PromoAfterBooking");
g_afterBookingConstructor =
jni::GetConstructorID(env, g_afterBooking,
"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
jni::HandleJavaException(env);
}
void OnSuccess(uint64_t requestId, promo::CityGallery const & gallery)
{
if (g_lastRequestId != requestId)
return;
JNIEnv * env = jni::GetEnv();
jni::TScopedLocalRef cityGallery(env, promo::MakeCityGallery(env, gallery));
jobject promoInstance = env->GetStaticObjectField(g_promoClass, g_promoInstanceField);
env->CallVoidMethod(promoInstance, g_onGalleryReceived, cityGallery.get());
jni::HandleJavaException(env);
}
void OnError(uint64_t requestId)
{
if (g_lastRequestId != requestId)
return;
JNIEnv * env = jni::GetEnv();
jobject promoInstance = env->GetStaticObjectField(g_promoClass, g_promoInstanceField);
env->CallVoidMethod(promoInstance, g_onErrorReceived);
jni::HandleJavaException(env);
}
} // namespace
namespace promo
{
jobject MakeCityGallery(JNIEnv * env, promo::CityGallery const & gallery)
{
PrepareClassRefs(env);
auto const itemBuilder = [](JNIEnv * env, promo::CityGallery::Item const & item)
{
jni::TScopedLocalRef name(env, jni::ToJavaString(env, item.m_name));
jni::TScopedLocalRef url(env, jni::ToJavaString(env, item.m_url));
jni::TScopedLocalRef imageUrl(env, jni::ToJavaString(env, item.m_imageUrl));
jni::TScopedLocalRef access(env, jni::ToJavaString(env, item.m_access));
jni::TScopedLocalRef tier(env, jni::ToJavaString(env, item.m_tier));
jni::TScopedLocalRef tourCategory(env, jni::ToJavaString(env, item.m_tourCategory));
jni::TScopedLocalRef placeName(env, jni::ToJavaString(env, item.m_place.m_name));
jni::TScopedLocalRef placeDescription(env, jni::ToJavaString(env, item.m_place.m_description));
jni::TScopedLocalRef authorId(env, jni::ToJavaString(env, item.m_author.m_id));
jni::TScopedLocalRef authorName(env, jni::ToJavaString(env, item.m_author.m_name));
jni::TScopedLocalRef luxCategoryName(env, jni::ToJavaString(env, item.m_luxCategory.m_name));
jni::TScopedLocalRef luxCategoryColor(env, jni::ToJavaString(env, item.m_luxCategory.m_color));
jni::TScopedLocalRef place(
env, env->NewObject(g_placeClass, g_placeConstructor, placeName.get(), placeDescription.get()));
jni::TScopedLocalRef author(
env, env->NewObject(g_authorClass, g_authorConstructor, authorId.get(), authorName.get()));
jni::TScopedLocalRef luxCategory(
env, env->NewObject(g_categoryClass, g_categoryConstructor, luxCategoryName.get(),
luxCategoryColor.get()));
return env->NewObject(g_itemClass, g_itemConstructor, name.get(), url.get(), imageUrl.get(),
access.get(), tier.get(), tourCategory.get(), place.get(), author.get(),
luxCategory.get());
};
jni::TScopedLocalObjectArrayRef items(env, jni::ToJavaArray(env, g_itemClass, gallery.m_items,
itemBuilder));
jni::TScopedLocalRef moreUrl(env, jni::ToJavaString(env, gallery.m_moreUrl));
jni::TScopedLocalRef category(env, jni::ToJavaString(env, gallery.m_category));
return env->NewObject(g_galleryClass, g_galleryConstructor, items.get(), moreUrl.get(),
category.get());
}
}
extern "C" {
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_promo_Promo_nativeRequestCityGallery(JNIEnv * env, jclass,
jobject policy, jdouble lat,
jdouble lon, jint utm)
{
PrepareClassRefs(env);
auto const point = mercator::FromLatLon(static_cast<double>(lat), static_cast<double>(lon));
++g_lastRequestId;
g_framework->GetPromoCityGallery(env, policy, point, static_cast<UTM>(utm),
std::bind(OnSuccess, g_lastRequestId, _1),
std::bind(OnError, g_lastRequestId));
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_promo_Promo_nativeRequestPoiGallery(JNIEnv * env, jclass,
jobject policy, jdouble lat,
jdouble lon, jobjectArray tags,
jint utm)
{
PrepareClassRefs(env);
auto const point = mercator::FromLatLon(static_cast<double>(lat), static_cast<double>(lon));
jsize const size = env->GetArrayLength(tags);
promo::Tags nativeTags;
for (jsize i = 0; i < size; ++i)
{
auto tag = jni::ToNativeString(env, static_cast<jstring>(env->GetObjectArrayElement(tags, i)));
nativeTags.emplace_back(std::move(tag));
}
bool useCoordinates =
GetPlatform().ConnectionStatus() == Platform::EConnectionType::CONNECTION_WIFI;
++g_lastRequestId;
g_framework->GetPromoPoiGallery(env, policy, point, nativeTags, useCoordinates,
static_cast<UTM>(utm), std::bind(OnSuccess, g_lastRequestId, _1),
std::bind(OnError, g_lastRequestId));
}
JNIEXPORT jstring JNICALL
Java_com_mapswithme_maps_promo_Promo_nativeGetCityUrl(JNIEnv * env, jclass, jobject policy,
jdouble lat, jdouble lon)
{
PrepareClassRefs(env);
auto const cityUrl = g_framework->GetPromoCityUrl(env, policy, lat, lon);
if (cityUrl.empty())
return nullptr;
return jni::ToJavaString(env, cityUrl);
}
} // extern "C"

View file

@ -1,10 +0,0 @@
#pragma once
#include "com/mapswithme/core/jni_helper.hpp"
namespace promo
{
struct CityGallery;
jobject MakeCityGallery(JNIEnv * env, promo::CityGallery const & gallery);
} // namespace promo

View file

@ -1,145 +0,0 @@
#include "com/mapswithme/maps/Framework.hpp"
#include "com/mapswithme/core/jni_helper.hpp"
namespace
{
jclass g_productClass;
jclass g_taxiManagerClass;
jclass g_taxiInfoClass;
jclass g_taxiInfoErrorClass;
jmethodID g_taxiInfoConstructor;
jmethodID g_taxiInfoErrorConstructor;
jobject g_taxiManagerInstance;
jmethodID g_productConstructor;
jfieldID g_taxiManagerInstanceField;
jmethodID g_taxiInfoCallbackMethod;
jmethodID g_taxiErrorCallbackMethod;
jclass g_taxiLinksClass;
jmethodID g_taxiLinksConstructor;
uint64_t g_lastRequestId;
void PrepareClassRefs(JNIEnv * env)
{
if (g_taxiManagerClass)
return;
g_taxiManagerClass =
jni::GetGlobalClassRef(env, "com/mapswithme/maps/taxi/TaxiManager");
g_productClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/taxi/TaxiInfo$Product");
g_productConstructor = jni::GetConstructorID(
env, g_productClass,
"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
g_taxiInfoClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/taxi/TaxiInfo");
g_taxiInfoErrorClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/taxi/TaxiInfoError");
g_taxiManagerInstanceField = jni::GetStaticFieldID(
env, g_taxiManagerClass, "INSTANCE", "Lcom/mapswithme/maps/taxi/TaxiManager;");
g_taxiManagerInstance =
env->GetStaticObjectField(g_taxiManagerClass, g_taxiManagerInstanceField);
g_taxiInfoCallbackMethod =
jni::GetMethodID(env, g_taxiManagerInstance, "onTaxiProvidersReceived",
"([Lcom/mapswithme/maps/taxi/TaxiInfo;)V");
g_taxiErrorCallbackMethod = jni::GetMethodID(env, g_taxiManagerInstance,
"onTaxiErrorsReceived", "([Lcom/mapswithme/maps/taxi/TaxiInfoError;)V");
g_taxiInfoConstructor = jni::GetConstructorID(env, g_taxiInfoClass,
"(I[Lcom/mapswithme/maps/taxi/TaxiInfo$Product;)V");
g_taxiInfoErrorConstructor = jni::GetConstructorID(env, g_taxiInfoErrorClass,
"(ILjava/lang/String;)V");
g_taxiLinksClass = jni::GetGlobalClassRef(env, "com/mapswithme/util/SponsoredLinks");
g_taxiLinksConstructor =
jni::GetConstructorID(env, g_taxiLinksClass, "(Ljava/lang/String;Ljava/lang/String;)V");
}
void OnTaxiInfoReceived(taxi::ProvidersContainer const & providers, uint64_t const requestId)
{
if (g_lastRequestId != requestId)
return;
JNIEnv * env = jni::GetEnv();
auto const productBuilder = [](JNIEnv * env, taxi::Product const & item)
{
jni::TScopedLocalRef jProductId(env, jni::ToJavaString(env, item.m_productId));
jni::TScopedLocalRef jName(env, jni::ToJavaString(env, item.m_name));
jni::TScopedLocalRef jTime(env, jni::ToJavaString(env, item.m_time));
jni::TScopedLocalRef jPrice(env, jni::ToJavaString(env, item.m_price));
jni::TScopedLocalRef jCurrency(env, jni::ToJavaString(env, item.m_currency));
return env->NewObject(g_productClass, g_productConstructor, jProductId.get(), jName.get(),
jTime.get(), jPrice.get(), jCurrency.get());
};
auto const providerBuilder = [productBuilder](JNIEnv * env, taxi::Provider const & item)
{
return env->NewObject(g_taxiInfoClass, g_taxiInfoConstructor, item.GetType(),
jni::ToJavaArray(env, g_productClass, item.GetProducts(), productBuilder));
};
jni::TScopedLocalObjectArrayRef jProviders(env, jni::ToJavaArray(env, g_taxiInfoClass, providers,
providerBuilder));
jobject const taxiManagerInstance = env->GetStaticObjectField(g_taxiManagerClass,
g_taxiManagerInstanceField);
env->CallVoidMethod(taxiManagerInstance, g_taxiInfoCallbackMethod, jProviders.get());
jni::HandleJavaException(env);
}
void OnTaxiError(taxi::ErrorsContainer const & errors, uint64_t const requestId)
{
if (g_lastRequestId != requestId)
return;
JNIEnv * env = jni::GetEnv();
jobject const taxiManagerInstance = env->GetStaticObjectField(g_taxiManagerClass,
g_taxiManagerInstanceField);
auto const errorBuilder = [](JNIEnv * env, taxi::ProviderError const & error)
{
jni::TScopedLocalRef jErrorCode(env, jni::ToJavaString(env, taxi::DebugPrint(error.m_code)));
return env->NewObject(g_taxiInfoErrorClass, g_taxiInfoErrorConstructor, error.m_type,
jErrorCode.get());
};
jni::TScopedLocalObjectArrayRef jErrors(env, jni::ToJavaArray(env, g_taxiInfoErrorClass, errors, errorBuilder));
env->CallVoidMethod(taxiManagerInstance, g_taxiErrorCallbackMethod, jErrors.get());
jni::HandleJavaException(env);
}
} // namespace
extern "C" {
JNIEXPORT void JNICALL Java_com_mapswithme_maps_taxi_TaxiManager_nativeRequestTaxiProducts(
JNIEnv * env, jclass clazz, jobject policy, jdouble srcLat, jdouble srcLon, jdouble dstLat,
jdouble dstLon)
{
PrepareClassRefs(env);
ms::LatLon const from(srcLat, srcLon);
ms::LatLon const to(dstLat, dstLon);
g_lastRequestId =
g_framework->RequestTaxiProducts(env, policy, from, to, &OnTaxiInfoReceived, &OnTaxiError);
}
JNIEXPORT jobject JNICALL Java_com_mapswithme_maps_taxi_TaxiManager_nativeGetTaxiLinks(
JNIEnv * env, jclass clazz, jobject policy, jint providerType, jstring productId, jdouble srcLat,
jdouble srcLon, jdouble dstLat, jdouble dstLon)
{
PrepareClassRefs(env);
ms::LatLon const from(srcLat, srcLon);
ms::LatLon const to(dstLat, dstLon);
taxi::Provider::Type type = static_cast<taxi::Provider::Type>(providerType);
taxi::RideRequestLinks const links =
g_framework->GetTaxiLinks(env, policy, type, jni::ToNativeString(env, productId), from, to);
return env->NewObject(g_taxiLinksClass, g_taxiLinksConstructor,
jni::ToJavaString(env, links.m_deepLink),
jni::ToJavaString(env, links.m_universalLink));
}
} // extern "C"

View file

@ -1,14 +1,11 @@
com/google/firebase/iid/Registrar.class
com/mapswithme/maps/ads/Banner.class
com/mapswithme/maps/api/ParsingResult.class
com/mapswithme/maps/bookmarks/data/Bookmark.class
com/mapswithme/maps/bookmarks/data/ElevationInfo.class
com/mapswithme/maps/bookmarks/data/FeatureId.class
com/mapswithme/maps/bookmarks/data/MapObject.class
com/mapswithme/maps/location/PlatformSocket.class
com/mapswithme/maps/onboarding/OnboardingTip.class
com/mapswithme/maps/search/PopularityProvider.class
com/mapswithme/maps/ugc/UGC$Rating.class
com/mapswithme/maps/widget/placepage/PlacePageData.class
com/mapswithme/util/AbstractHttpUploader.class
com/mapswithme/util/HttpBackgroundUploader.class

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:color="@color/turquoise"/>
<item android:color="@color/cardview_light_background" />
</selector>

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:color="@color/turquoise"/>
<item android:color="@color/cardview_dark_background" />
</selector>

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:color="@color/base_accent"/>
<item android:color="@color/black_secondary" />
</selector>

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:color="@color/base_accent_night"/>
<item android:color="@color/white_secondary" />
</selector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 573 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 560 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 958 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 935 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:bottomRightRadius="@dimen/margin_half"
android:topRightRadius="@dimen/margin_half" />
<solid android:color="@color/white_60" />
</shape>

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="@dimen/margin_eighth"/>
<stroke android:color="@color/base_accent" android:width="@dimen/divider_height"/>
</shape>

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="@dimen/margin_eighth"/>
<stroke android:color="@color/base_accent_night" android:width="@dimen/divider_height" />
</shape>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/bg_guides_light_pressed" android:state_pressed="true"/>
<item android:drawable="@drawable/bg_guides_light_selected" android:state_selected="true"/>
<item android:drawable="@drawable/bg_guides_light_default"/>
</selector>

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/bg_circle"/>
<item
android:drawable="@drawable/ic_layers_light_on"
android:left="@dimen/margin_base_plus_quarter"
android:right="@dimen/margin_base_plus_quarter"
android:top="@dimen/margin_base_plus_quarter"
android:bottom="@dimen/margin_base_plus_quarter"/>
</layer-list>

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/bg_circle_pressed"/>
<item
android:drawable="@drawable/ic_layers_light_on"
android:left="@dimen/margin_base_plus_quarter"
android:right="@dimen/margin_base_plus_quarter"
android:top="@dimen/margin_base_plus_quarter"
android:bottom="@dimen/margin_base_plus_quarter"/>
</layer-list>

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/bg_circle"/>
<item
android:drawable="@drawable/ic_layers_off"
android:left="@dimen/margin_base_plus_quarter"
android:right="@dimen/margin_base_plus_quarter"
android:top="@dimen/margin_base_plus_quarter"
android:bottom="@dimen/margin_base_plus_quarter"/>
</layer-list>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/bg_guides_night_pressed" android:state_pressed="true"/>
<item android:drawable="@drawable/bg_guides_night_selected" android:state_selected="true"/>
<item android:drawable="@drawable/bg_guides_night_default"/>
</selector>

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/bg_circle_night"/>
<item
android:drawable="@drawable/ic_layers_light_on"
android:left="@dimen/margin_base_plus_quarter"
android:right="@dimen/margin_base_plus_quarter"
android:top="@dimen/margin_base_plus_quarter"
android:bottom="@dimen/margin_base_plus_quarter"/>
</layer-list>

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/bg_circle_pressed_night"/>
<item
android:drawable="@drawable/ic_layers_dark_on"
android:left="@dimen/margin_base_plus_quarter"
android:right="@dimen/margin_base_plus_quarter"
android:top="@dimen/margin_base_plus_quarter"
android:bottom="@dimen/margin_base_plus_quarter"/>
</layer-list>

View file

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="@drawable/bg_circle_night"/>
<item
android:drawable="@drawable/ic_layers_off_night"
android:left="@dimen/margin_base_plus_quarter"
android:right="@dimen/margin_base_plus_quarter"
android:top="@dimen/margin_base_plus_quarter"
android:bottom="@dimen/margin_base_plus_quarter"/>
</layer-list>

View file

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/bg_tag_pressed_night"
android:state_pressed="true"/>
<item android:drawable="@drawable/bg_tag_selected_night"
android:state_selected="true"/>
<item android:drawable="@drawable/bg_tag_normal_night"/>
</selector>

View file

@ -1,6 +0,0 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<gradient
android:angle="270"
android:startColor="#b4d0ebff"
android:endColor="#00ffffff" />
</shape>

View file

@ -1,3 +0,0 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#383C40"/>
</shape>

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/black_primary"/>
<corners android:radius="@dimen/routing_selector_wheel_size"/>
</shape>

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/bookmarks_sightseeing_subs_central_content_bg"/>
<corners android:radius="@dimen/routing_selector_wheel_size"/>
</shape>

View file

@ -1,55 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="54dp"
android:height="54dp"
android:viewportWidth="54"
android:viewportHeight="54">
<path
android:pathData="M7,0H47C48.8565,0 50.637,0.7375 51.9497,2.0503C53.2625,3.363 54,5.1435 54,7V47C54,48.8565 53.2625,50.637 51.9497,51.9497C50.637,53.2625 48.8565,54 47,54H7C5.1435,54 3.363,53.2625 2.0503,51.9497C0.7375,50.637 0,48.8565 0,47L0,7C0,5.1435 0.7375,3.363 2.0503,2.0503C3.363,0.7375 5.1435,0 7,0V0Z"
android:fillColor="#249CF2"/>
<path
android:pathData="M47,2H7C4.2386,2 2,4.2386 2,7V47C2,49.7614 4.2386,52 7,52H47C49.7614,52 52,49.7614 52,47V7C52,4.2386 49.7614,2 47,2Z"
android:fillColor="#E0DCD5"/>
<group>
<clip-path
android:pathData="M2,7C2,4.2386 4.2386,2 7,2H47C49.7614,2 52,4.2386 52,7V47C52,49.7614 49.7614,52 47,52H7C4.2386,52 2,49.7614 2,47V7Z"/>
<path
android:pathData="M2,7C2,4.2386 4.2386,2 7,2H47C49.7614,2 52,4.2386 52,7V47C52,49.7614 49.7614,52 47,52H7C4.2386,52 2,49.7614 2,47V7Z"
android:fillColor="#E4E8EB"/>
<path
android:pathData="M36.25,-9l-23,23l12.625,12.625l23,-23z"
android:fillColor="#D6DBA5"/>
<path
android:pathData="M53.625,3.625l-22.875,22.875l24.375,24.375l22.875,-22.875z"
android:fillColor="#A2CBDB"/>
<path
android:pathData="M0.625,5.125l-10.1875,10.1875l11.875,11.875l10.1875,-10.1875z"
android:fillColor="#A2CBDB"/>
<path
android:pathData="M4.5,52.75l21.375,-21.375l18.625,18.625l-21.375,21.375z"
android:fillColor="#D6DBA5"/>
<path
android:pathData="M34.7668,64.1845l-4.5052,1.9048l-12.6325,-29.8777l4.5052,-1.9048z"
android:fillColor="#ffffff"/>
<path
android:pathData="M48,-2l8.4853,8.4853l-50.3327,50.3327l-8.4853,-8.4853z"
android:fillColor="#ffffff"/>
<path
android:pathData="M28.1663,-3.8337l3.4587,3.4587l-31.875,31.875l-3.4587,-3.4587z"
android:fillColor="#ffffff"/>
<path
android:pathData="M-3,5l8.4853,-8.4853l50.9117,50.9117l-8.4853,8.4853z"
android:fillColor="#ffffff"/>
<path
android:pathData="M13,26m-5,0a5,5 0,1 1,10 0a5,5 0,1 1,-10 0"
android:fillColor="#ffffff"/>
<path
android:pathData="M13,18C8.6066,18 5.0324,21.5742 5.0324,25.9675C5.0324,31.4197 12.1626,39.4239 12.4662,39.762C12.7513,40.0796 13.2492,40.079 13.5338,39.762C13.8374,39.4239 20.9675,31.4197 20.9675,25.9675C20.9675,21.5742 17.3933,18 13,18ZM13,29.9762C10.7896,29.9762 8.9913,28.1779 8.9913,25.9675C8.9913,23.7571 10.7896,21.9589 13,21.9589C15.2103,21.9589 17.0086,23.7572 17.0086,25.9676C17.0086,28.178 15.2103,29.9762 13,29.9762Z"
android:fillColor="#06AAFA"/>
<path
android:pathData="M41,14m-5,0a5,5 0,1 1,10 0a5,5 0,1 1,-10 0"
android:fillColor="#ffffff"/>
<path
android:pathData="M41,6C36.6066,6 33.0324,9.5742 33.0324,13.9675C33.0324,19.4197 40.1626,27.4239 40.4662,27.762C40.7513,28.0796 41.2492,28.079 41.5338,27.762C41.8374,27.4239 48.9675,19.4197 48.9675,13.9675C48.9675,9.5742 45.3933,6 41,6ZM41,17.9762C38.7896,17.9762 36.9913,16.1779 36.9913,13.9675C36.9913,11.7571 38.7896,9.9589 41,9.9589C43.2103,9.9589 45.0086,11.7572 45.0086,13.9676C45.0086,16.178 43.2103,17.9762 41,17.9762Z"
android:fillColor="#FFB90B"/>
</group>
</vector>

View file

@ -1,55 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="54dp"
android:height="54dp"
android:viewportWidth="54"
android:viewportHeight="54">
<path
android:pathData="M7,0H47C48.8565,0 50.637,0.7375 51.9497,2.0503C53.2625,3.363 54,5.1435 54,7V47C54,48.8565 53.2625,50.637 51.9497,51.9497C50.637,53.2625 48.8565,54 47,54H7C5.1435,54 3.363,53.2625 2.0503,51.9497C0.7375,50.637 0,48.8565 0,47L0,7C0,5.1435 0.7375,3.363 2.0503,2.0503C3.363,0.7375 5.1435,0 7,0V0Z"
android:fillColor="#4BB9E6"/>
<path
android:pathData="M47,2H7C4.2386,2 2,4.2386 2,7V47C2,49.7614 4.2386,52 7,52H47C49.7614,52 52,49.7614 52,47V7C52,4.2386 49.7614,2 47,2Z"
android:fillColor="#E0DCD5"/>
<group>
<clip-path
android:pathData="M2,7C2,4.2386 4.2386,2 7,2H47C49.7614,2 52,4.2386 52,7V47C52,49.7614 49.7614,52 47,52H7C4.2386,52 2,49.7614 2,47V7Z"/>
<path
android:pathData="M2,7C2,4.2386 4.2386,2 7,2H47C49.7614,2 52,4.2386 52,7V47C52,49.7614 49.7614,52 47,52H7C4.2386,52 2,49.7614 2,47V7Z"
android:fillColor="#E4E8EB"/>
<path
android:pathData="M36.25,-9l-23,23l12.625,12.625l23,-23z"
android:fillColor="#D6DBA5"/>
<path
android:pathData="M53.625,3.625l-22.875,22.875l24.375,24.375l22.875,-22.875z"
android:fillColor="#A2CBDB"/>
<path
android:pathData="M0.625,5.125l-10.1875,10.1875l11.875,11.875l10.1875,-10.1875z"
android:fillColor="#A2CBDB"/>
<path
android:pathData="M4.5,52.75l21.375,-21.375l18.625,18.625l-21.375,21.375z"
android:fillColor="#D6DBA5"/>
<path
android:pathData="M34.7668,64.1845l-4.5052,1.9048l-12.6325,-29.8777l4.5052,-1.9048z"
android:fillColor="#ffffff"/>
<path
android:pathData="M48,-2l8.4853,8.4853l-50.3327,50.3327l-8.4853,-8.4853z"
android:fillColor="#ffffff"/>
<path
android:pathData="M28.1663,-3.8337l3.4587,3.4587l-31.875,31.875l-3.4587,-3.4587z"
android:fillColor="#ffffff"/>
<path
android:pathData="M-3,5l8.4853,-8.4853l50.9117,50.9117l-8.4853,8.4853z"
android:fillColor="#ffffff"/>
<path
android:pathData="M13,26m-5,0a5,5 0,1 1,10 0a5,5 0,1 1,-10 0"
android:fillColor="#ffffff"/>
<path
android:pathData="M13,18C8.6066,18 5.0324,21.5742 5.0324,25.9675C5.0324,31.4197 12.1626,39.4239 12.4662,39.762C12.7513,40.0796 13.2492,40.079 13.5338,39.762C13.8374,39.4239 20.9675,31.4197 20.9675,25.9675C20.9675,21.5742 17.3933,18 13,18ZM13,29.9762C10.7896,29.9762 8.9913,28.1779 8.9913,25.9675C8.9913,23.7571 10.7896,21.9589 13,21.9589C15.2103,21.9589 17.0086,23.7572 17.0086,25.9676C17.0086,28.178 15.2103,29.9762 13,29.9762Z"
android:fillColor="#06AAFA"/>
<path
android:pathData="M41,14m-5,0a5,5 0,1 1,10 0a5,5 0,1 1,-10 0"
android:fillColor="#ffffff"/>
<path
android:pathData="M41,6C36.6066,6 33.0324,9.5742 33.0324,13.9675C33.0324,19.4197 40.1626,27.4239 40.4662,27.762C40.7513,28.0796 41.2492,28.079 41.5338,27.762C41.8374,27.4239 48.9675,19.4197 48.9675,13.9675C48.9675,9.5742 45.3933,6 41,6ZM41,17.9762C38.7896,17.9762 36.9913,16.1779 36.9913,13.9675C36.9913,11.7571 38.7896,9.9589 41,9.9589C43.2103,9.9589 45.0086,11.7572 45.0086,13.9676C45.0086,16.178 43.2103,17.9762 41,17.9762Z"
android:fillColor="#FFB90B"/>
</group>
</vector>

View file

@ -1,52 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="54dp"
android:height="54dp"
android:viewportWidth="54"
android:viewportHeight="54">
<path
android:pathData="M47,2H7C4.2386,2 2,4.2386 2,7V47C2,49.7614 4.2386,52 7,52H47C49.7614,52 52,49.7614 52,47V7C52,4.2386 49.7614,2 47,2Z"
android:fillColor="#E0DCD5"/>
<group>
<clip-path
android:pathData="M2,7C2,4.2386 4.2386,2 7,2H47C49.7614,2 52,4.2386 52,7V47C52,49.7614 49.7614,52 47,52H7C4.2386,52 2,49.7614 2,47V7Z"/>
<path
android:pathData="M2,7C2,4.2386 4.2386,2 7,2H47C49.7614,2 52,4.2386 52,7V47C52,49.7614 49.7614,52 47,52H7C4.2386,52 2,49.7614 2,47V7Z"
android:fillColor="#E4E8EB"/>
<path
android:pathData="M36.25,-9l-23,23l12.625,12.625l23,-23z"
android:fillColor="#D6DBA5"/>
<path
android:pathData="M53.625,3.625l-22.875,22.875l24.375,24.375l22.875,-22.875z"
android:fillColor="#A2CBDB"/>
<path
android:pathData="M0.625,5.125l-10.1875,10.1875l11.875,11.875l10.1875,-10.1875z"
android:fillColor="#A2CBDB"/>
<path
android:pathData="M4.5,52.75l21.375,-21.375l18.625,18.625l-21.375,21.375z"
android:fillColor="#D6DBA5"/>
<path
android:pathData="M34.7669,64.1845l-4.5052,1.9048l-12.6325,-29.8777l4.5052,-1.9048z"
android:fillColor="#ffffff"/>
<path
android:pathData="M48,-2l8.4853,8.4853l-50.3327,50.3327l-8.4853,-8.4853z"
android:fillColor="#ffffff"/>
<path
android:pathData="M28.1663,-3.8337l3.4587,3.4587l-31.875,31.875l-3.4587,-3.4587z"
android:fillColor="#ffffff"/>
<path
android:pathData="M-3,5l8.4853,-8.4853l50.9117,50.9117l-8.4853,8.4853z"
android:fillColor="#ffffff"/>
<path
android:pathData="M13,26m-5,0a5,5 0,1 1,10 0a5,5 0,1 1,-10 0"
android:fillColor="#ffffff"/>
<path
android:pathData="M13,18C8.6067,18 5.0324,21.5742 5.0324,25.9675C5.0324,31.4197 12.1626,39.4239 12.4662,39.762C12.7513,40.0796 13.2492,40.079 13.5338,39.762C13.8374,39.4239 20.9676,31.4197 20.9676,25.9675C20.9675,21.5742 17.3933,18 13,18ZM13,29.9762C10.7896,29.9762 8.9914,28.1779 8.9914,25.9675C8.9914,23.7571 10.7897,21.9589 13,21.9589C15.2104,21.9589 17.0086,23.7572 17.0086,25.9676C17.0086,28.178 15.2104,29.9762 13,29.9762Z"
android:fillColor="#06AAFA"/>
<path
android:pathData="M41,14m-5,0a5,5 0,1 1,10 0a5,5 0,1 1,-10 0"
android:fillColor="#ffffff"/>
<path
android:pathData="M41,6C36.6067,6 33.0324,9.5742 33.0324,13.9675C33.0324,19.4197 40.1626,27.4239 40.4662,27.762C40.7513,28.0796 41.2492,28.079 41.5338,27.762C41.8374,27.4239 48.9676,19.4197 48.9676,13.9675C48.9675,9.5742 45.3933,6 41,6ZM41,17.9762C38.7896,17.9762 36.9914,16.1779 36.9914,13.9675C36.9914,11.7571 38.7897,9.9589 41,9.9589C43.2104,9.9589 45.0086,11.7572 45.0086,13.9676C45.0086,16.178 43.2104,17.9762 41,17.9762Z"
android:fillColor="#FFB90B"/>
</group>
</vector>

View file

@ -1,15 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<group
android:pivotX="24"
android:pivotY="24"
android:scaleX="0.75"
android:scaleY="0.75">
<path
android:fillColor="#fff"
android:pathData="M24,4c-7.72,0 -14,6.28 -14,14 0,10.5 14,26 14,26 0,0 14,-15.5 14,-26 0,-7.72 -6.28,-14 -14,-14ZM20.88,24h-2.88v-2.88l6.7,-6.68 2.86,2.86 -6.68,6.7ZM29.78,15.1l-1.4,1.4 -2.88,-2.88 1.4,-1.4c0.3,-0.3 0.78,-0.3 1.08,0l1.8,1.8c0.3,0.3 0.3,0.78 0,1.08Z" />
</group>
</vector>

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/sightseeing_subs_sale_view_bg"/>
<corners android:radius="@dimen/margin_quarter_plus"/>
</shape>

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/subscription_card_edge_selected" android:state_selected="true"/>
<item android:drawable="@drawable/subscription_card_edge_default"/>
</selector>

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@android:color/transparent"/>
<stroke
android:color="#8caeb8be"
android:width="@dimen/divider_width"/>
<corners
android:topLeftRadius="@dimen/bookmarks_subs_card_corner_radius"
android:bottomLeftRadius="@dimen/bookmarks_subs_card_corner_radius"
android:topRightRadius="@dimen/bookmarks_subs_card_corner_radius"
android:bottomRightRadius="@dimen/bookmarks_subs_card_corner_radius"/>
</shape>

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@android:color/transparent"/>
<stroke
android:color="@color/white_primary"
android:width="3dp"/>
<corners
android:topLeftRadius="@dimen/margin_quarter_plus"
android:bottomLeftRadius="@dimen/margin_quarter_plus"
android:topRightRadius="@dimen/margin_quarter_plus"
android:bottomRightRadius="@dimen/margin_quarter_plus"/>
</shape>

View file

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/image"
android:layout_width="@dimen/bookmark_purchase_img_width"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:scaleType="centerCrop" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toRightOf="@id/image"
android:layout_toEndOf="@id/image"
android:layout_alignParentTop="true"
android:fillViewport="true">
<include layout="@layout/bookmark_payment_layout"/>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>

View file

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
layout="@layout/info_page"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>

View file

@ -1,60 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false"
android:orientation="horizontal">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:padding="@dimen/margin_base_plus">
<ImageView
android:id="@+id/iv__image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
tools:src="@drawable/img_welcome" />
</FrameLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="@dimen/margin_base_plus"
android:layout_weight="1"
android:gravity="center_horizontal"
android:orientation="vertical">
<include
android:id="@+id/bottom_container"
layout="@layout/info_page_horizontal_bottom_container"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</include>
<LinearLayout
android:id="@+id/text_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/bottom_container"
android:orientation="vertical">
<TextView
android:id="@+id/tv__title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_half_double_plus"
android:fontFamily="@string/robotoMedium"
android:textSize="@dimen/text_size_toolbar"
android:textAppearance="@style/MwmTextAppearance.Title"
tools:targetApi="jelly_bean"
tools:text="@string/onboarding_welcome_title" />
<TextView
android:id="@+id/tv__subtitle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base"
android:textSize="@dimen/text_size_body_3"
android:textAppearance="@style/MwmTextAppearance.Body1.Secondary"
tools:text="@string/onboarding_welcome_first_subtitle" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>

View file

@ -30,14 +30,6 @@
android:background="?nav_bg_isolines"
android:visibility="invisible"/>
<ImageButton
android:id="@+id/guides"
style="@style/MwmWidget.MapButton.Traffic"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="?guidesIcon"
android:visibility="invisible"/>
<ImageButton
android:id="@+id/nav_zoom_in"
style="@style/MwmWidget.MapButton"

View file

@ -1,84 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:gravity="center">
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_double_plus"
android:layout_gravity="center_vertical"/>
<ScrollView
android:layout_width="wrap_content"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/margin_double_plus"
android:layout_marginStart="@dimen/margin_base"
android:layout_gravity="center_vertical"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal"
android:layout_gravity="center">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Title"
android:gravity="center_horizontal"
android:fontFamily="@string/robotoMedium"
tools:text="Whats new feature!"/>
<TextView
android:id="@+id/subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/MwmTextAppearance.Body1.Secondary"
android:gravity="center_horizontal"
tools:text="We\'ve made some cool stuff!\nSit down and be happy now, man."/>
<include layout="@layout/whats_new_promo_button"/>
</LinearLayout>
<LinearLayout
android:id="@+id/switch_block"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="64dp"
android:orientation="horizontal"
android:gravity="center_vertical"
android:background="?clickableBackground">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/switch_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/MwmTextAppearance.Body1"
android:singleLine="true"
tools:text="Switch block title"/>
<TextView
android:id="@+id/switch_subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/MwmTextAppearance.Body3"
tools:text="Switch block subtitle"/>
</LinearLayout>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch_box"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>

View file

@ -1,59 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/margin_base_plus"
android:layout_weight="1">
<ImageView
android:id="@+id/iv__image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
tools:src="@drawable/img_welcome"/>
</FrameLayout>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:layout_margin="@dimen/margin_base_plus"
android:layout_weight="1">
<include
android:id="@+id/bottom_container"
layout="@layout/info_page_horizontal_bottom_container"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</include>
<LinearLayout
android:layout_above="@+id/bottom_container"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/tv__title"
android:layout_marginTop="@dimen/margin_half_double_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/text_size_toolbar"
android:textAppearance="@style/MwmTextAppearance.Title"
android:fontFamily="@string/robotoMedium"
tools:text="@string/onboarding_welcome_title"
tools:targetApi="jelly_bean"/>
<TextView
android:id="@+id/tv__subtitle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base"
android:textSize="@dimen/text_size_body_3"
android:textAppearance="@style/MwmTextAppearance.Body1.Secondary"
tools:text="@string/onboarding_welcome_first_subtitle"/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>

View file

@ -1,58 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.mapswithme.maps.widget.HeightLimitedFrameLayout
android:layout_above="@id/button_container"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="@dimen/info_page_image_size"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center">
<ImageView
android:id="@+id/iv__image"
android:layout_width="@dimen/info_page_image_size"
android:layout_height="@dimen/info_page_image_size"
android:layout_marginBottom="@dimen/margin_base"
android:layout_gravity="center_horizontal"
android:tag="@string/tag_height_limited"
tools:src="@drawable/img_welcome"/>
<TextView
android:id="@+id/tv__title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_base"
android:textSize="@dimen/text_size_toolbar"
android:textAppearance="@style/MwmTextAppearance.Title"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:fontFamily="@string/robotoMedium"
tools:text="@string/onboarding_welcome_title"
tools:targetApi="jelly_bean"/>
<TextView
android:id="@+id/tv__subtitle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Body1.Secondary"
android:textSize="@dimen/text_size_body_3"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
tools:text="@string/onboarding_welcome_first_subtitle"/>
</LinearLayout>
</com.mapswithme.maps.widget.HeightLimitedFrameLayout>
<include
android:id="@+id/button_container"
layout="@layout/welcome_buttons_vertical_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginStart="@dimen/margin_base_plus"
android:layout_marginEnd="@dimen/margin_base_plus"
android:layout_marginBottom="@dimen/margin_base_plus" />
</RelativeLayout>

View file

@ -1,179 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_above="@id/sightseeing_footer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_sightseeing_subs"
android:orientation="vertical">
<ImageView
android:id="@+id/header_img"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
android:src="@drawable/img_sightseeing_subscription" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@drawable/bookmarks_sightseeing_subs_central_content_bg"
android:maxWidth="@dimen/subs_btn_min_width"
android:orientation="vertical"
android:paddingStart="@dimen/bookmarks_sightseeing_subs_central_content_margin"
android:paddingTop="@dimen/menu_line_button_width"
android:paddingEnd="@dimen/bookmarks_sightseeing_subs_central_content_margin"
android:paddingBottom="@dimen/menu_line_button_width">
<LinearLayout
android:orientation="vertical"
android:minWidth="@dimen/subs_btn_min_width"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/sightseeing"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base_plus_quarter"
android:fontFamily="@string/robotoRegular"
android:text="@string/sightseeing_subscription_header_sightseeing"
android:textAllCaps="true"
android:textColor="@color/base_accent"
android:textSize="@dimen/text_size_title" />
<TextView
android:id="@+id/subscription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@string/robotoRegular"
android:text="@string/sightseeing_subscription_header_subscription"
android:textColor="@color/black_primary"
android:textSize="@dimen/text_size_title" />
<LinearLayout
android:id="@+id/message_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base_plus"
android:gravity="center_vertical|start"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_sightseeing_checkox" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_base"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/sightseeing_subscription_message"
android:textColor="@color/black_primary"
android:textSize="@dimen/text_size_body_2" />
</LinearLayout>
<LinearLayout
android:id="@+id/message_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base_plus_quarter"
android:gravity="center_vertical|start"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_sightseeing_checkox" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_base"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/sightseeing_subscription_message_2"
android:textColor="@color/black_primary"
android:textSize="@dimen/text_size_body_2" />
</LinearLayout>
<LinearLayout
android:id="@+id/message_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base_plus_quarter"
android:gravity="center_vertical|start"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_sightseeing_checkox" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_base"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/sightseeing_subscription_message_3"
android:textColor="@color/black_primary"
android:textSize="@dimen/text_size_body_2" />
</LinearLayout>
</LinearLayout>
<com.mapswithme.maps.widget.SubscriptionButton
android:id="@+id/annual_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_double_and_half"
app:buttonBackground="?primaryButtonBackground"
app:buttonTextColor="@color/white_primary"
app:progressColor="@color/white_primary"
app:saleBackground="@drawable/sightseeing_subs_sale_bg"
app:saleTextColor="@color/white_primary"
app:showSale="true" />
<com.mapswithme.maps.widget.SubscriptionButton
android:id="@+id/monthly_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base"
app:buttonBackground="@drawable/button_secondary_transparent"
app:buttonTextColor="@color/black_primary"
app:progressColor="@color/base_accent"
app:saleTextColor="@color/white_primary"
app:showSale="false" />
<TextView
android:id="@+id/restore_purchase_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="@dimen/margin_base_plus_quarter"
android:background="?attr/selectableItemBackground"
android:gravity="center"
android:minHeight="@dimen/primary_button_min_height"
android:paddingStart="@dimen/margin_half_plus"
android:paddingEnd="@dimen/margin_half_plus"
android:text="@string/restore"
android:textAllCaps="true"
android:textColor="?colorAccent"
tools:ignore="UnusedAttribute"
tools:text="Restore purchases" />
</LinearLayout>
</RelativeLayout>
<ImageView
android:id="@+id/sightseeing_footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:scaleType="centerCrop"
android:src="@drawable/img_sightseeing_footer" />
<include
android:id="@+id/terms_of_use"
layout="@layout/subscription_terms_of_use"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@id/sightseeing_footer"
android:layout_marginBottom="@dimen/margin_base_plus_quarter"
android:layout_marginStart="@dimen/routing_info_height"
android:layout_marginTop="@dimen/margin_base_plus_quarter"
android:layout_marginEnd="@dimen/routing_info_height" />
</RelativeLayout>
</androidx.core.widget.NestedScrollView>

View file

@ -1,233 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/img1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
<ImageView
android:id="@+id/img2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:id="@+id/status_bar_placeholder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="@android:color/transparent" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@drawable/bookmarks_all_subs_central_content_bg"
android:maxWidth="@dimen/bookmark_all_subscription_content_width"
android:orientation="vertical"
android:paddingTop="@dimen/height_block_base"
android:paddingBottom="@dimen/primary_button_min_width">
<LinearLayout
android:orientation="vertical"
android:layout_gravity="start"
android:paddingTop="@dimen/margin_half_plus"
android:paddingBottom="@dimen/margin_half_plus"
android:background="@drawable/all_subs_header_bg"
android:layout_marginTop="@dimen/margin_base_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_base_plus_quarter"
android:layout_marginEnd="@dimen/margin_base_plus_quarter"
android:fontFamily="@string/robotoMedium"
android:gravity="center|start"
android:text="@string/all_pass_subscription_header"
android:textColor="@color/black_primary"
android:textSize="@dimen/text_size_button" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_base_plus_quarter"
android:layout_marginTop="@dimen/margin_half"
android:layout_marginEnd="@dimen/margin_base_plus_quarter"
android:fontFamily="@string/robotoMedium"
android:textStyle="bold"
android:includeFontPadding="false"
android:lineSpacingExtra="@dimen/no_line_spacing_extra"
android:gravity="center|start"
android:text="@string/all_pass_subscription_subheader"
android:textColor="@color/black_primary"
android:textSize="@dimen/text_size_toolbar" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_marginStart="@dimen/dialog_min_height"
android:layout_marginEnd="@dimen/dialog_min_height"
android:layout_height="@dimen/subscription_view_pager_height"
android:gravity="bottom">
<com.mapswithme.maps.widget.ParallaxBackgroundViewPager
android:id="@+id/pager"
android:layout_width="@dimen/bookmark_all_subscription_content_width"
android:layout_height="wrap_content"
android:overScrollMode="never"
app:autoScroll="true"
app:scrollPeriod="4000" />
</LinearLayout>
<LinearLayout
android:id="@+id/bottom_container"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:gravity="center_horizontal"
android:layout_marginStart="@dimen/dialog_min_height"
android:layout_marginEnd="@dimen/dialog_min_height"
android:minWidth="@dimen/subs_btn_min_width"
android:orientation="vertical">
<com.mapswithme.maps.widget.SubscriptionButton
android:id="@+id/annual_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/nav_street_height"
app:buttonBackground="@drawable/button_accent"
app:buttonTextColor="@color/white_primary"
app:progressColor="@color/white_primary"
app:saleBackground="@drawable/bookmarks_all_sale_bg"
app:saleTextColor="@color/tips_and_triks_primary_text_night"
app:showSale="true" />
<com.mapswithme.maps.widget.SubscriptionButton
android:id="@+id/monthly_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base"
app:buttonBackground="@drawable/button_secondary_transparent"
app:buttonTextColor="@color/white_primary"
app:progressColor="@color/base_accent" />
<Button
android:id="@+id/free_trial_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_double_and_half"
android:background="@drawable/button_accent"
android:text="@string/guides_trial_cta_button"
android:textColor="@color/white_primary"
android:textSize="@dimen/text_size_body_3"
android:visibility="gone"
tools:visibility="visible"/>
<TextView
android:id="@+id/free_trial_mesage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base"
android:text="@string/guides_trial_message"
android:textColor="@color/white_primary"
android:textSize="@dimen/text_size_body_4"
android:visibility="gone"
tools:visibility="visible"/>
<TextView
android:id="@+id/restore_purchase_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="@dimen/margin_base_plus"
android:layout_marginTop="@dimen/downloader_status_size"
android:layout_marginEnd="@dimen/margin_base_plus"
android:background="?attr/selectableItemBackground"
android:fontFamily="@string/robotoMedium"
android:gravity="center"
android:text="@string/restore"
android:textAllCaps="true"
android:textAppearance="@style/MwmTextAppearance.Body3.Primary"
android:textColor="@color/routing_button_pressed_tint"
tools:ignore="UnusedAttribute"
tools:text="Restore purchases" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginStart="@dimen/margin_base_plus"
android:layout_marginTop="@dimen/margin_double_and_half"
android:layout_marginEnd="@dimen/margin_base_plus"
android:layout_marginBottom="@dimen/bookmarks_subs_margin_top"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@string/robotoRegular"
android:justificationMode="inter_word"
android:letterSpacing="-0.01"
android:lineSpacingExtra="@dimen/terms_of_use_line_spacing"
android:text="@string/subscription_terms_android_outdoor"
android:textAppearance="?android:textAppearance"
android:textColor="@color/routing_button_pressed_tint"
android:textSize="@dimen/text_size_icon_title"
android:textStyle="normal"
tools:targetApi="o" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
android:id="@+id/term_of_use_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:ellipsize="end"
android:fontFamily="@string/robotoMedium"
android:letterSpacing="-0.01"
android:singleLine="true"
android:text="@string/terms_of_use"
android:textColor="@color/routing_button_pressed_tint"
android:textSize="@dimen/text_size_body_5"
android:textStyle="normal"
tools:targetApi="lollipop"
tools:text="Terms of UseTerms of UseTerms of UseTerms of UseTerms of UseTerms of UseTerms of UseTerms of UseTerms of UseTerms of UseTerms of Use" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="end">
<TextView
android:id="@+id/privacy_policy_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:background="?selectableItemBackground"
android:ellipsize="end"
android:fontFamily="@string/robotoMedium"
android:gravity="end"
android:letterSpacing="-0.01"
android:singleLine="true"
android:text="@string/privacy_policy"
android:textColor="@color/routing_button_pressed_tint"
android:textSize="@dimen/text_size_body_5"
android:textStyle="normal"
tools:targetApi="lollipop"
tools:text="lollipoplollipoplollipoplollipoplollipoplollipoplollipoplollipoplollipoplollipoplollipoplollipoplollipoplollipoplollipoplollipoplollipop" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>

View file

@ -1,94 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black">
<androidx.viewpager.widget.ViewPager
android:id="@+id/vp__image"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<include
layout="@layout/toolbar_transparent"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_half"
android:layout_marginEnd="@dimen/margin_base"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginStart="@dimen/margin_base"
android:layout_marginTop="@dimen/margin_base"
android:layout_gravity="bottom">
<TextView
android:id="@+id/tv__description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_half"
android:textColor="@color/white_primary"
android:textAppearance="@style/MwmTextAppearance.Body1"
android:maxLines="1"
tools:text="Staff, rooftop view, location, free bike…"/>
<RelativeLayout
android:id="@+id/rl__user_block"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/divider_gallery"/>
<ImageView
android:id="@+id/iv__avatar"
android:layout_width="@dimen/track_circle_size"
android:layout_height="@dimen/track_circle_size"
android:layout_marginTop="@dimen/margin_half"
android:layout_below="@id/divider"
android:layout_marginRight="@dimen/margin_half"
android:layout_marginEnd="@dimen/margin_half"
tools:src="@drawable/img_editor_medal"/>
<TextView
android:id="@+id/tv__name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_half"
android:layout_toRightOf="@id/iv__avatar"
android:layout_toEndOf="@id/iv__avatar"
android:layout_below="@id/divider"
android:maxLines="1"
android:textColor="@color/white_primary"
android:textAppearance="@style/MwmTextAppearance.Body1"
tools:text="Polina"/>
<TextView
android:id="@+id/tv__source"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/iv__avatar"
android:layout_toEndOf="@id/iv__avatar"
android:layout_below="@id/tv__name"
android:maxLines="1"
android:textColor="@color/white_primary"
android:textAppearance="@style/MwmTextAppearance.Body4"
tools:text="via Booking"/>
<TextView
android:id="@+id/tv__date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/tv__source"
android:layout_toEndOf="@id/tv__source"
android:layout_alignBaseline="@id/tv__source"
android:gravity="end"
android:maxLines="1"
android:textColor="@color/white_primary"
android:textAppearance="@style/MwmTextAppearance.Body4"
tools:text="Jule 8, 2016"/>
</RelativeLayout>
</LinearLayout>
</FrameLayout>

View file

@ -97,8 +97,6 @@
</FrameLayout>
<include layout="@layout/elevation_profile_bottom_sheet" />
<include layout="@layout/main_menu_bottom_sheet" />
<include layout="@layout/guides_gallery_bottom_sheet" />
<include layout="@layout/guests_and_rooms_menu_bottom_sheet" />
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"

View file

@ -1,85 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:showIn="@layout/fragment_bookmark_payment">
<TextView
android:id="@+id/product_store_name"
android:textAppearance="?android:textAppearance"
android:text="…"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/margin_base_plus"
android:gravity="start"
android:textAllCaps="true"
tools:ignore="HardcodedText"/>
<include layout="@layout/divider_horizontal"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/margin_base_plus">
<TextView
android:id="@+id/product_catalog_name"
android:textAppearance="?android:textAppearanceLarge"
tools:text="Have a dinner with Hemingway and Castro in Havana"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"/>
<TextView
android:id="@+id/author_name"
android:textAppearance="?android:textAppearance"
tools:text="by Julio Mulio"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base"
android:gravity="start"/>
<FrameLayout
android:id="@+id/buy_subs_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base_plus"
android:layout_marginBottom="@dimen/margin_base"
android:layout_gravity="center">
<Button
android:id="@+id/buy_subs_btn"
style="@style/MwmWidget.Button.Primary"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/margin_half_plus_eight"
tools:text="BUY FOR $1.99"/>
<ProgressBar
android:id="@+id/subs_progress"
android:layout_width="@dimen/primary_button_min_height"
android:layout_height="@dimen/primary_button_min_height"
android:layout_gravity="center"
android:visibility="visible"
tools:visibility="visible"/>
</FrameLayout>
<FrameLayout
android:id="@+id/buy_inap_container"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/buy_inapp_btn"
android:textAppearance="?android:textAppearance"
android:background="?clickableBackground"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/margin_half_plus_eight"
android:textColor="?colorAccent"
android:gravity="center"
android:textAllCaps="true"/>
<ProgressBar
android:id="@+id/inapp_progress"
android:layout_width="@dimen/primary_button_min_height"
android:layout_height="@dimen/primary_button_min_height"
android:layout_gravity="center"
android:visibility="visible"
tools:visibility="visible"/>
</FrameLayout>
</LinearLayout>
</LinearLayout>

View file

@ -1,144 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white_primary"
android:gravity="center"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<ProgressBar
android:id="@+id/root_screen_progress"
android:layout_width="@dimen/primary_button_min_height"
android:layout_height="@dimen/primary_button_min_height"
android:layout_gravity="center"
android:visibility="gone"
tools:visibility="visible"/>
<androidx.core.widget.NestedScrollView
android:id="@+id/content_view"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:visibility="gone"
tools:visibility="visible"
android:fillViewport="true">
<LinearLayout
android:orientation="vertical"
android:background="?attr/bookmarkSubscriptionScreenBg"
android:padding="@dimen/margin_base"
android:clipToPadding="false"
android:clipChildren="false"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/text_size_title"
android:layout_gravity="center"
android:textColor="?subscriptionTitleColor"
android:text="@string/subscription_screen_native_title_version_2"
android:fontFamily="@string/robotoMedium"
android:layout_marginRight="@dimen/height_item_oneline"
android:layout_marginStart="@dimen/height_item_oneline"
android:layout_marginEnd="@dimen/height_item_oneline"
android:layout_marginLeft="@dimen/height_item_oneline"
android:textAppearance="?android:attr/textAppearanceLarge"
android:letterSpacing="-0.02"
android:lineSpacingExtra="@dimen/line_spacing_extra_1"
android:textStyle="bold"
android:gravity="center"
tools:text="Unlimited access to 5000+ guides!"
tools:ignore="UnusedAttribute"/>
<TextView
android:id="@+id/subtitle"
android:layout_marginTop="@dimen/margin_base"
tools:text="Every kind of journey. Whether alone or with friends, hiking or sunbathing"
android:text="@string/subscription_screen_native_message_version_2"
android:gravity="center"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@string/robotoRegular"
android:textStyle="normal"
android:textColor="?subscriptionSubtitleColor"
android:textAppearance="?android:attr/textAppearanceMedium"
android:letterSpacing="-0.01"
tools:ignore="UnusedAttribute"/>
<FrameLayout
android:layout_marginTop="@dimen/bookmarks_subs_margin_top"
android:layout_width="wrap_content"
android:gravity="center"
android:layout_gravity="center"
android:clipToPadding="false"
android:clipChildren="false"
android:layout_height="wrap_content">
<include
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:clipToPadding="false"
android:clipChildren="false"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/margin_base_plus"
layout="@layout/subscription_offer_card"/>
<include layout="@layout/subscription_offer_sale"/>
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_quadruple"
android:layout_marginEnd="@dimen/margin_quadruple"
android:layout_marginLeft="@dimen/margin_quadruple"
android:layout_marginRight="@dimen/margin_quadruple"
android:layout_marginTop="@dimen/margin_double_and_half"
android:layout_gravity="center">
<Button
android:id="@+id/continue_btn"
style="@style/MwmWidget.Button.Primary"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/continue_download"
tools:text="BUY FOR $1.99"/>
<ProgressBar
android:id="@+id/progress"
android:layout_width="@dimen/primary_button_min_height"
android:layout_height="@dimen/primary_button_min_height"
android:layout_gravity="center"
android:visibility="gone"
tools:visibility="visible"/>
</FrameLayout>
<TextView
android:id="@+id/restore_purchase_btn"
android:background="?attr/selectableItemBackground"
android:layout_gravity="center"
android:layout_marginTop="@dimen/margin_base_plus_quarter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_quadruple"
android:layout_marginEnd="@dimen/margin_quadruple"
android:layout_marginLeft="@dimen/margin_quadruple"
android:layout_marginRight="@dimen/margin_quadruple"
android:minHeight="@dimen/primary_button_min_height"
android:paddingLeft="@dimen/margin_half_plus"
android:paddingStart="@dimen/margin_half_plus"
android:paddingRight="@dimen/margin_half_plus"
android:paddingEnd="@dimen/margin_half_plus"
android:gravity="center"
android:fontFamily="@string/robotoMedium"
android:textAppearance="@style/MwmTextAppearance.Body3.Primary"
android:text="@string/restore"
android:textColor="?colorAccent"
tools:text="Restore purchases"
tools:ignore="UnusedAttribute"/>
<include
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base_plus_quarter"
layout="@layout/subscription_terms_of_use" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</FrameLayout>

View file

@ -1,163 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/catalog_promo_container"
android:orientation="vertical"
android:background="?attr/windowBackgroundForced"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/catalog_promo_title"
android:text="@string/gallery_pp_download_guides_title"
android:textAppearance="?android:textAppearance"
android:singleLine="true"
android:ellipsize="end"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginStart="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginEnd="@dimen/margin_base"
android:layout_marginTop="@dimen/margin_base"
android:layout_marginBottom="@dimen/margin_half_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<include
android:id="@+id/catalog_promo_title_divider"
android:layout_width="match_parent"
android:layout_height="@dimen/divider_height"
layout="@layout/list_divider"/>
<LinearLayout
android:id="@+id/promo_poi_description_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="?cardBackground"
android:padding="@dimen/margin_base">
<TextView
android:id="@+id/promo_poi_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/text_size_body_3"
android:fontFamily="@string/robotoRegular"
android:textStyle="bold"
android:textColor="?android:textColorPrimary"
android:lineSpacingExtra="@dimen/line_spacing_extra_2"
android:maxLines="2"
android:ellipsize="end"
tools:text="Государственный музей изобразительных искусств имени А.С. Пушкина это..."
tools:targetApi="jelly_bean" />
<TextView
android:id="@+id/promo_poi_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_half"
android:textSize="@dimen/text_size_body_3"
android:fontFamily="@string/robotoRegular"
android:textStyle="normal"
android:textColor="?android:textColorPrimary"
android:lineSpacingExtra="@dimen/line_spacing_extra_2"
android:maxLines="5"
android:ellipsize="end"
tools:text="музейный комплекс, обладающий одим из крупнейших в России художественных собраний
зарубежного искусства. хранящий артефакты, созданные мастерами разных эпох - от Древнего Египта
и античной Греции до;..."
tools:ignore="UnusedAttribute" />
<TextView
android:id="@+id/promo_poi_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/text_size_body_3"
android:fontFamily="@string/robotoRegular"
android:textStyle="normal"
android:textColor="?colorAccent"
android:lineSpacingExtra="@dimen/text_size_body_3"
android:text="@string/category_desc_more"
android:layout_marginTop="@dimen/margin_half"
tools:ignore="UnusedAttribute" />
</LinearLayout>
<include
android:id="@+id/promo_poi_description_divider"
android:layout_width="match_parent"
android:layout_height="@dimen/divider_height"
layout="@layout/list_divider"/>
<androidx.cardview.widget.CardView
android:id="@+id/promo_poi_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_half"
app:cardCornerRadius="@dimen/margin_eighth"
app:cardBackgroundColor="?cardBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/promo_single_place_container_height"
android:orientation="horizontal"
tools:ignore="UnusedAttribute">
<ImageView
android:id="@+id/promo_poi_image"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:scaleType="centerCrop"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:paddingStart="@dimen/margin_half_plus"
android:paddingLeft="@dimen/margin_half_plus"
android:paddingTop="@dimen/margin_double_and_half"
android:paddingEnd="@dimen/margin_half_plus"
android:paddingRight="@dimen/margin_half_plus"
android:paddingBottom="@dimen/margin_base">
<TextView
android:id="@+id/place_single_bookmark_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:fontFamily="@string/robotoRegular"
android:lineSpacingExtra="@dimen/line_spacing_extra_0"
android:maxLines="3"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/text_size_body_3"
android:textStyle="bold"
tools:text="From the Alexander Gardens to the City centre" />
<TextView
android:id="@+id/place_single_bookmark_subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_half"
android:fontFamily="@string/robotoRegular"
android:lineSpacingExtra="@dimen/line_spacing_extra_1"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/text_size_body_4"
android:textStyle="normal"
tools:text="ArrivalGuides" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
android:orientation="vertical">
<Button
android:id="@+id/place_single_bookmark_cta"
style="@style/MwmWidget.Button.Primary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/margin_half"
android:paddingStart="@dimen/margin_half"
android:paddingRight="@dimen/margin_half"
android:paddingEnd="@dimen/margin_half"
android:paddingTop="@dimen/margin_quarter_plus"
android:paddingBottom="@dimen/margin_quarter_plus"
android:text="@string/pp_discovery_place_related_cta_button"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/catalog_promo_recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_quarter"
android:layout_marginBottom="@dimen/margin_quarter" />
</LinearLayout>

View file

@ -1,84 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:padding="@dimen/margin_quarter"
android:clipToPadding="false">
<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardBackgroundColor="?cardBackground">
<LinearLayout
android:foreground="?clickableBackground"
android:orientation="vertical"
android:layout_width="@dimen/gallery_product_width"
android:layout_height="wrap_content"
android:minHeight="@dimen/discovery_expert_item_min_height">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical">
<ImageView
android:id="@+id/image"
android:scaleType="centerCrop"
android:layout_width="@dimen/gallery_product_width"
android:layout_height="@dimen/placeholder_margin_top_no_image"/>
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_half_plus"
android:layout_marginLeft="@dimen/margin_half_plus"
android:layout_marginRight="@dimen/margin_half_plus"
style="@style/MwmWidget.Discovery.Item.Title"
android:maxLines="1"
android:minLines="1"
android:textAppearance="@style/MwmTextAppearance.Discovery.Item.Title"
tools:text="Irina Severintseva"/>
<TextView
android:id="@+id/subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_eighth"
android:layout_marginLeft="@dimen/margin_half_plus"
android:layout_marginRight="@dimen/margin_half_plus"
style="@style/MwmWidget.Discovery.Item.Subtitle"
android:ellipsize="middle"
android:textAppearance="@style/MwmTextAppearance.Body3"
tools:text="★ ★ ★ ★ ★"/>
</LinearLayout>
<TextView
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/MwmTextAppearance.Discovery.Item.Button"
style="@style/MwmWidget.Discovery.Item.Button"
android:layout_gravity="bottom"
android:text="@string/details"/>
</LinearLayout>
<TextView
android:id="@+id/label"
android:elevation="@dimen/default_elevation"
android:layout_gravity="top"
android:paddingTop="@dimen/margin_eighth"
android:paddingBottom="@dimen/margin_eighth"
android:paddingLeft="@dimen/margin_half_plus"
android:paddingStart="@dimen/margin_half_plus"
android:paddingRight="@dimen/margin_half_plus"
android:paddingEnd="@dimen/margin_half_plus"
android:layout_marginTop="@dimen/pro_label_margin"
android:textColor="@android:color/white"
android:textAppearance="?android:attr/textAppearanceSmall"
app:fontFamily="@string/robotoMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:background="@color/base_accent_night"
tools:text="PRO"
tools:visibility="visible"
tools:targetApi="lollipop"/>
</androidx.cardview.widget.CardView>
</FrameLayout>

View file

@ -1,67 +0,0 @@
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/catalog_promo_placeholder_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/margin_quarter"
android:clipToPadding="false">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="?cardBackground"
android:minHeight="@dimen/discovery_expert_item_min_height">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="@dimen/discovery_expert_item_min_height">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:minHeight="@dimen/discovery_search_item_min_height"
android:background="?attr/clickableBackground"
android:orientation="vertical"
android:gravity="center_horizontal">
<ProgressBar
android:id="@+id/progress"
android:layout_width="@dimen/margin_base_plus"
android:layout_height="@dimen/margin_base_plus"
android:layout_marginTop="@dimen/margin_base_plus"/>
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_half_plus"
android:layout_marginLeft="@dimen/margin_half_plus"
android:layout_marginRight="@dimen/margin_half_plus"
android:gravity="center_horizontal"
android:lines="2"
android:textAppearance="@style/MwmTextAppearance.Discovery.Item.Title"
tools:text="Irina Severintseva"/>
<TextView
android:id="@+id/subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_eighth"
android:layout_marginLeft="@dimen/margin_half_plus"
android:layout_marginRight="@dimen/margin_half_plus"
android:gravity="center_horizontal"
android:lines="3"
android:ellipsize="middle"
android:textAppearance="@style/MwmTextAppearance.Body3"
tools:text="★ ★ ★ ★ ★"/>
</LinearLayout>
<TextView
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/MwmTextAppearance.Discovery.Item.Button"
style="@style/MwmWidget.Discovery.Item.Button"
android:layout_gravity="bottom"
android:lines="1"
android:text="@string/details"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
</FrameLayout>

View file

@ -1,97 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:background="?cardBackground">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/margin_base_plus">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/MwmTheme.DialogTitleBase"
android:text="@string/profile_authorization_title"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_half_plus"
android:textAppearance="@style/MwmTextAppearance.Body3.Primary"
android:layout_marginBottom="@dimen/margin_half"
android:text="@string/sign_message_gdpr"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:paddingTop="@dimen/margin_half"
android:paddingBottom="@dimen/margin_half">
<CheckBox
android:id="@+id/privacyPolicyCheck"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/privacyPolicyLink"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginStart="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Body3.Primary"
android:text="@string/sign_agree_pp_gdpr"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:paddingTop="@dimen/margin_half"
android:paddingBottom="@dimen/margin_half">
<CheckBox
android:id="@+id/termOfUseCheck"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/termOfUseLink"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginStart="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Body3.Primary"
android:text="@string/sign_agree_tof_gdpr"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:paddingTop="@dimen/margin_half"
android:paddingBottom="@dimen/margin_half">
<CheckBox
android:id="@+id/newsCheck"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginStart="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Body3.Primary"
android:text="@string/sign_agree_news_gdpr"/>
</LinearLayout>
<TextView
android:id="@+id/phone_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/primary_button_min_height"
android:layout_marginTop="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Button"
android:textColor="?accentButtonTextColor"
android:background="?accentButtonBackground"
android:foreground="?clickableBackground"
android:gravity="center"
android:text="@string/phone_number"/>
</LinearLayout>
</ScrollView>

View file

@ -14,12 +14,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.mapswithme.maps.widget.BookmarkBackupView
android:id="@+id/backup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:background="?cardBackground"/>
<include
layout="@layout/recycler_default"
android:id="@+id/recycler"
@ -27,10 +21,5 @@
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/bookmark_recycler_view_bottom_margin"/>
</LinearLayout>
<include
android:id="@+id/placeholder_loading"
layout="@layout/placeholder_with_progressbar_layout"
android:visibility="gone"
tools:visibility="visible" />
</FrameLayout>
</androidx.core.widget.NestedScrollView>

View file

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.tabs.TabLayout
android:id="@+id/sliding_tabs_layout"
style="@style/MwmWidget.TabLayout"
android:layout_width="match_parent"
android:layout_height="@dimen/tabs_height"/>
<FrameLayout
android:foreground="@drawable/shadow_top"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0"
android:layout_weight="1">
<androidx.viewpager.widget.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>
</LinearLayout>

View file

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:background="?cardBackground"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="@style/MwmWidget.ToolbarTheme"/>
<androidx.core.widget.NestedScrollView
android:scrollbars="none"
android:fillViewport="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:paddingStart="@dimen/margin_base"
android:paddingEnd="@dimen/margin_base"
android:paddingRight="@dimen/margin_base"
android:paddingLeft="@dimen/margin_base"
android:paddingBottom="@dimen/bookmark_hide_btn_padding_top"
android:paddingTop="@dimen/margin_half_plus"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="@string/bookmark_category_name"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<LinearLayout
android:orientation="horizontal"
android:id="@+id/edit_name_container"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/edit_category_name_view"
android:layout_weight="1"
android:layout_width="0dp"
android:background="@null"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginEnd="@dimen/margin_base"/>
<ImageView
android:id="@+id/edit_text_clear_btn"
android:src="?attr/icClearRounded"
android:background="?selectableItemBackgroundBorderless"
android:layout_gravity="center"
android:layout_weight="0"
android:layout_width="@dimen/margin_base_plus"
android:layout_height="@dimen/margin_base_plus"/>
</LinearLayout>
</LinearLayout>
<EditText
android:id="@+id/edit_description"
android:background="@null"
android:hint="@string/bookmark_category_description_hint"
android:minHeight="@dimen/height_item_multiline"
android:paddingStart="@dimen/margin_base"
android:paddingEnd="@dimen/margin_base"
android:paddingRight="@dimen/margin_base"
android:paddingLeft="@dimen/margin_base"
android:textAppearance="?android:attr/textAppearance"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<View
android:background="?android:attr/windowBackground"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>

View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="@dimen/bookmark_purchase_img_height"
android:scaleType="centerCrop"/>
<include layout="@layout/bookmark_payment_layout"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View file

@ -1,62 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="page"
type="com.mapswithme.maps.purchase.BookmarksAllSubscriptionPage" />
</data>
<RelativeLayout
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
tools:background="@color/black_primary">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center|top|start"
android:ellipsize="end"
android:maxLines="@integer/bookmark_all_subs_pager_text_max_lines"
android:textStyle="bold"
android:fontFamily="@string/robotoMedium"
android:includeFontPadding="false"
android:letterSpacing="0"
android:lineSpacingExtra="@dimen/no_line_spacing_extra"
android:textSize="@dimen/text_size_display_1"
android:text="@{page.titleId}"
android:textColor="@color/white_primary"
android:layout_marginEnd="@dimen/bookmarks_all_subscription_pager_item_margin"
android:layout_marginRight="@dimen/bookmarks_all_subscription_pager_item_margin"
android:layout_marginLeft="@dimen/bookmarks_all_subscription_pager_item_margin"
android:layout_marginStart="@dimen/bookmarks_all_subscription_pager_item_margin"
tools:text="700+ cities and 100+ countriesапваплвалжвлпжлв"
android:layout_above="@id/description"
tools:ignore="UnusedAttribute"/>
<TextView
android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center|start"
android:maxLines="@integer/bookmark_all_subs_pager_text_max_lines"
android:ellipsize="end"
android:fontFamily="@string/robotoLight"
android:textColor="@color/white_primary"
android:textSize="@dimen/text_size_body_0"
android:text="@{page.descriptionId}"
android:letterSpacing="0"
android:lineSpacingExtra="@dimen/no_line_spacing_extra"
android:includeFontPadding="false"
android:layout_alignParentBottom="true"
android:layout_marginTop="@dimen/margin_base"
android:layout_marginEnd="@dimen/bookmarks_all_subscription_pager_item_margin"
android:layout_marginRight="@dimen/bookmarks_all_subscription_pager_item_margin"
android:layout_marginLeft="@dimen/bookmarks_all_subscription_pager_item_margin"
android:layout_marginStart="@dimen/bookmarks_all_subscription_pager_item_margin"
tools:text="Every kind of journey. Whether alone
or withваавпавпвпавпапап
аврварваэжпдэжавдпэдваэжпдваэж "
tools:ignore="UnusedAttribute"/>
</RelativeLayout>
</layout>

View file

@ -1,38 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<WebView
android:id="@+id/webview"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent">
</WebView>
<ProgressBar
android:id="@+id/progress"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:minWidth="@dimen/search_progress_size"
android:minHeight="@dimen/search_progress_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/retry_btn"
android:layout_marginLeft="@dimen/margin_double"
android:layout_marginRight="@dimen/margin_double"
android:visibility="gone"
style="@style/MwmWidget.Button.Primary"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:text="@string/downloader_retry"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -9,10 +9,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.mapswithme.maps.bookmarks.BookmarkHeaderView
android:id="@+id/guide_info"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<WebView
android:id="@+id/webview"
android:layout_width="match_parent"

View file

@ -1,118 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:mapsme="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.core.widget.NestedScrollView
android:fillViewport="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/cached_bookmarks_payload_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:orientation="vertical"
android:background="?cardBackground"
android:focusableInTouchMode="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/header"
android:paddingLeft="@dimen/margin_base"
android:paddingRight="@dimen/margin_base"
android:paddingBottom="@dimen/margin_half_plus"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/header_title"
android:text="@string/download_guides"
android:textAppearance="@style/MwmTextAppearance.Body1"
android:gravity="start|center_vertical"
android:paddingTop="@dimen/margin_half_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
mapsme:layout_constraintLeft_toLeftOf="parent"/>
<TextView
android:id="@+id/header_description"
android:text="@string/cached_guides_placeholder_subtitle"
android:textAppearance="@style/MwmTextAppearance.Body3"
android:paddingTop="@dimen/margin_half_plus"
android:paddingBottom="@dimen/margin_half_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
mapsme:layout_constraintTop_toBottomOf="@id/header_title"/>
<ImageView
android:id="@+id/header_close"
android:baselineAlignBottom="true"
mapsme:layout_constraintRight_toRightOf="parent"
mapsme:layout_constraintBottom_toTopOf="@id/header_description"
mapsme:layout_constraintBaseline_toBaselineOf="@id/header_title"
android:src="@drawable/ic_clear"
android:tint="@color/icon_tint"
android:layout_width="@dimen/margin_half_double_plus"
android:layout_height="@dimen/margin_half_double_plus"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:background="?android:attr/listDivider"
android:layout_width="match_parent"
android:layout_height="@dimen/divider_height"/>
<include
android:id="@+id/download_routes_layout"
layout="@layout/item_bookmark_create_group"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</include>
<View
android:background="?android:attr/listDivider"
android:layout_width="match_parent"
android:layout_height="@dimen/divider_height"/>
</LinearLayout>
<include
layout="@layout/recycler_default"
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/bookmark_recycler_view_bottom_margin"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal"
android:paddingTop="@dimen/placeholder_margin_top"
android:paddingBottom="@dimen/placeholder_margin_top"
android:paddingLeft="@dimen/margin_double_and_half"
android:paddingRight="@dimen/margin_double_and_half"
android:id="@+id/placeholder_container">
<com.mapswithme.maps.widget.PlaceholderView
android:id="@+id/placeholder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:layout_weight="1"
mapsme:imgSrcDefault="@drawable/img_empty_bookmarks"
mapsme:titleDefault="@string/guides_catalogue_title"
mapsme:subTitleDefault="@string/cached_bookmarks_placeholder_subtitle"/>
<Button
android:id="@+id/download_routers_btn"
android:layout_width="@dimen/button_width"
android:layout_height="wrap_content"
style="@style/MwmWidget.Button.Primary"
android:layout_weight="0"
android:layout_marginTop="@dimen/margin_half"
android:text="@string/download_guides"
android:textAppearance="@style/MwmTextAppearance.Body1.Light"/>
</LinearLayout>
<include
android:id="@+id/placeholder_loading"
layout="@layout/placeholder_with_progressbar_layout"
android:visibility="gone"
tools:visibility="visible" />
</RelativeLayout>

View file

@ -1,126 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:fillViewport="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="@style/MwmWidget.ToolbarTheme"/>
<LinearLayout
android:id="@+id/galleriesLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/margin_base_plus"
android:orientation="vertical">
<TextView
android:id="@+id/catalog_promo_title"
android:text="@string/gallery_pp_download_guides_title"
android:textAppearance="@style/MwmTextAppearance.Discovery.Subtitle"
style="@style/MwmWidget.Discovery.Subtitle"
android:layout_marginTop="@dimen/margin_half_plus"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginStart="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginEnd="@dimen/margin_base"
android:layout_marginBottom="@dimen/margin_half_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/catalog_promo_recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/attractionsTitle"
android:text="@string/discovery_button_subtitle_attractions"
android:textAppearance="@style/MwmTextAppearance.Discovery.Subtitle"
style="@style/MwmWidget.Discovery.Subtitle"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginStart="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginEnd="@dimen/margin_base"
android:layout_marginBottom="@dimen/margin_half_plus"
android:layout_marginTop="@dimen/margin_base_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/attractions"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/eatAndDrinkTitle"
android:text="@string/discovery_button_subtitle_eat_and_drink"
android:textAppearance="@style/MwmTextAppearance.Discovery.Subtitle"
style="@style/MwmWidget.Discovery.Subtitle"
android:layout_marginTop="@dimen/margin_base_plus"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginStart="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginEnd="@dimen/margin_base"
android:layout_marginBottom="@dimen/margin_half_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/food"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/hotelsTitle"
android:textAppearance="@style/MwmTextAppearance.Discovery.Subtitle"
style="@style/MwmWidget.Discovery.Subtitle"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginStart="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginEnd="@dimen/margin_base"
android:layout_marginTop="@dimen/margin_base_plus"
android:layout_marginBottom="@dimen/margin_half_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/discovery_button_subtitle_book_hotels"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/hotels"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:listitem="@layout/item_viator_product"/>
<TextView
android:id="@+id/localGuidesTitle"
android:text="@string/discovery_button_subtitle_local_guides"
android:visibility="gone"
android:textAppearance="@style/MwmTextAppearance.Discovery.Subtitle"
style="@style/MwmWidget.Discovery.Subtitle"
android:layout_marginTop="@dimen/margin_base_plus"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginStart="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginEnd="@dimen/margin_base"
android:layout_marginBottom="@dimen/margin_half_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/localGuides"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<com.mapswithme.maps.widget.PlaceholderView
android:id="@+id/placeholder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:paddingLeft="@dimen/margin_double_and_half"
android:paddingRight="@dimen/margin_double_and_half"
android:paddingTop="@dimen/placeholder_margin_top"
android:paddingBottom="@dimen/placeholder_margin_top"
android:visibility="gone"
tools:visibility="visible"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View file

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv__gallery"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/margin_half"
android:paddingRight="@dimen/margin_half"
android:paddingTop="@dimen/margin_half_plus"
tools:listitem="@layout/item_image"/>
</LinearLayout>

View file

@ -1,86 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/margin_half">
<androidx.viewpager.widget.ViewPager
android:id="@+id/pager"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
tools:background="#200000FF"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?dividerHorizontal"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_ab_left"
android:scaleType="centerCrop"
android:layout_gravity="center_vertical"
android:tint="?colorAccent"
android:background="?clickableBackground"/>
<LinearLayout
android:id="@+id/dots"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="9dp"
tools:src="@drawable/news_marker_active"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="9dp"
tools:src="@drawable/news_marker_inactive"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="9dp"
tools:src="@drawable/news_marker_inactive"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:src="@drawable/news_marker_inactive"/>
</LinearLayout>
<ImageView
android:id="@+id/next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:src="@drawable/ic_ab_right"
android:scaleType="centerCrop"
android:tint="?colorAccent"
android:background="?clickableBackground"/>
<TextView
android:id="@+id/done"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:text="@string/done"
android:textAppearance="@style/MwmTextAppearance.Body3"
android:textColor="?colorAccent"
android:textAllCaps="true"
android:padding="@dimen/margin_base"
android:background="?clickableBackground"/>
</FrameLayout>
</LinearLayout>

View file

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
layout="@layout/info_page"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>

View file

@ -1,63 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="@dimen/promo_after_booking_width"
android:layout_height="wrap_content"
android:background="?cardBackground">
<ImageView
android:id="@+id/city_picture"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?imgPromoBookingTitle">
</ImageView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/city_picture"
android:orientation="vertical"
android:padding="@dimen/margin_base">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:textAppearanceLarge"
android:textSize="@dimen/text_size_alert_dialog_title"
android:gravity="start"
android:text="@string/popup_booking_download_guides_title"
tools:text="Booked a hotel?"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_half"
android:textAppearance="?android:textAppearance"
android:lineSpacingExtra="4sp"
android:text="@string/popup_booking_download_guides_message"
tools:text="Take a look at ready-made trips around the place!"/>
<Button
android:id="@+id/city_guides"
style="@style/MwmWidget.Button.Accent"
android:layout_width="match_parent"
android:layout_height="@dimen/primary_button_min_height"
android:layout_marginTop="@dimen/margin_base_plus_quarter"
android:textAppearance="?android:textAppearanceInverse"
android:letterSpacing="0.04"
android:text="@string/popup_mwm_download_guides_cta"
tools:text="Choose one"
tools:targetApi="lollipop"/>
<Button
android:id="@+id/cancel"
style="@style/MwmWidget.Button"
android:layout_width="match_parent"
android:layout_height="@dimen/primary_button_min_height"
android:background="?attr/selectableItemBackground"
android:layout_marginTop="@dimen/margin_half"
android:textAppearance="?android:textAppearance"
android:letterSpacing="0.04"
android:text="@string/cancel"
tools:ignore="UnusedAttribute"/>
</LinearLayout>
</RelativeLayout>
</androidx.core.widget.NestedScrollView>

View file

@ -18,11 +18,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<include
layout="@layout/taxi_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<include
android:id="@+id/routing_action_frame"
layout="@layout/routing_action_panel"

View file

@ -94,7 +94,6 @@
android:layout_height="match_parent"
android:background="@android:color/black"
android:visibility="gone"/>
<include layout="@layout/guests_and_rooms_menu_bottom_sheet" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</FrameLayout>

View file

@ -1,112 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:background="?windowBackgroundForced"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:elevation="@dimen/margin_half_plus"
tools:targetApi="lollipop">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:titleEnabled="false"
app:layout_scrollFlags="enterAlways">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="@style/MwmWidget.ToolbarTheme">
<ImageView
android:id="@+id/reset"
android:layout_width="?actionBarSize"
android:layout_height="?actionBarSize"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_gravity="end|center_vertical"
android:background="?selectableItemBackgroundBorderless"
android:scaleType="centerInside"
android:src="@drawable/ic_24px_clear"/>
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:id="@+id/scroll"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/hotels_filter_padding"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginBottom="@dimen/margin_half"
android:layout_marginTop="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.BookingFilter.Title"
android:text="@string/booking_filters_rating"/>
<com.mapswithme.maps.search.RatingFilterView
android:id="@+id/rating"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginTop="@dimen/hotels_filter_margin_top"
android:layout_marginBottom="@dimen/margin_half"
android:textAppearance="@style/MwmTextAppearance.BookingFilter.Title"
android:text="@string/booking_filters_price_category"/>
<com.mapswithme.maps.search.PriceFilterView
android:id="@+id/price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:layout_marginTop="@dimen/hotels_filter_margin_top"
android:textAppearance="@style/MwmTextAppearance.BookingFilter.Title"
android:text="@string/search_hotel_filters_type"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/type"
android:layout_marginLeft="@dimen/margin_quarter"
android:layout_marginRight="@dimen/margin_quarter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:listitem="@layout/item_tag"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<TextView
android:id="@+id/done"
android:layout_width="match_parent"
android:minHeight="@dimen/height_block_base"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:gravity="center"
android:textAppearance="@style/MwmTextAppearance.Button"
android:fontFamily="@string/robotoMedium"
android:text="@string/search"
android:background="?filterPropertyBackground"
tools:targetApi="jelly_bean"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

Some files were not shown because too many files have changed in this diff Show more