jni for crown

This commit is contained in:
Arsentiy Milchakov 2019-09-02 15:32:03 +03:00 committed by yoksnod
parent 9c3994fdfb
commit bce10a5a82
4 changed files with 21 additions and 0 deletions

View file

@ -7,6 +7,7 @@
#include "com/mapswithme/vulkan/android_vulkan_context_factory.hpp"
#include "map/chart_generator.hpp"
#include "map/crown.hpp"
#include "map/everywhere_search_params.hpp"
#include "map/notifications/notification_queue.hpp"
#include "map/user_mark.hpp"
@ -2228,4 +2229,10 @@ Java_com_mapswithme_maps_Framework_nativeSetSearchViewport(JNIEnv *, jclass, jdo
auto const rect = df::GetRectForDrawScale(static_cast<int>(zoom), center);
frm()->GetSearchAPI().OnViewportChanged(rect);
}
JNIEXPORT jboolean JNICALL
Java_com_mapswithme_maps_Framework_nativeNeedToShowCrown(JNIEnv *, jclass)
{
return static_cast<jboolean>(crown::NeedToShow(frm()->GetPurchase()));
}
} // extern "C"

View file

@ -112,4 +112,10 @@ Java_com_mapswithme_maps_metrics_UserActionsLogger_nativePromoAfterBookingShown(
{
eye::Eye::Event::PromoAfterBookingShown(jni::ToNativeString(env, id));
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_metrics_UserActionsLogger_nativeCrownClicked(JNIEnv *, jclass)
{
eye::Eye::Event::CrownClicked();
}
}

View file

@ -533,6 +533,8 @@ public class Framework
public static native void nativeSetSearchViewport(double lat, double lon, int zoom);
public static native boolean nativeNeedToShowCrown();
public enum LocalAdsEventType
{
LOCAL_ADS_EVENT_SHOW_POINT,

View file

@ -70,6 +70,11 @@ public class UserActionsLogger
nativePromoAfterBookingShown(id);
}
public static void logCrownClicked()
{
nativeCrownClicked();
}
private static native void nativeTipClicked(int type, int event);
private static native void nativeBookingFilterUsed();
private static native void nativeBookmarksCatalogShown();
@ -83,4 +88,5 @@ public class UserActionsLogger
private static native void nativeBookingReviewsClicked();
private static native void nativeBookingDetailsClicked();
private static native void nativePromoAfterBookingShown(@NonNull String id);
private static native void nativeCrownClicked();
}