diff --git a/android/jni/com/mapswithme/maps/locals/Locals.cpp b/android/jni/com/mapswithme/maps/locals/Locals.cpp index e99f5aa3c0..61e6c2e67a 100644 --- a/android/jni/com/mapswithme/maps/locals/Locals.cpp +++ b/android/jni/com/mapswithme/maps/locals/Locals.cpp @@ -21,22 +21,22 @@ void PrepareClassRefs(JNIEnv * env) if (g_localsClass != nullptr) return; - g_localsClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/locals/Locals"); + g_localsClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/discovery/Locals"); static jfieldID const localsInstanceField = jni::GetStaticFieldID(env, g_localsClass, "INSTANCE", - "Lcom/mapswithme/maps/locals/Locals;"); + "Lcom/mapswithme/maps/discovery/Locals;"); g_localsInstance = env->GetStaticObjectField(g_localsClass, localsInstanceField); g_onLocalsReceivedMethod = jni::GetMethodID(env, g_localsInstance, "onLocalsReceived", - "([Lcom/mapswithme/maps/locals/LocalExpert;)V"); + "([Lcom/mapswithme/maps/discovery/LocalExpert;)V"); g_onLocalsErrorReceivedMethod = jni::GetMethodID(env, g_localsInstance, "onLocalsErrorReceived", - "(Lcom/mapswithme/maps/locals/LocalsError;)V"); + "(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/locals/LocalExpert"); + 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" @@ -44,7 +44,7 @@ void PrepareClassRefs(JNIEnv * env) "Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); // @ErrorCode int code, @NonNull String message - g_localErrorClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/locals/LocalError"); + g_localErrorClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/discovery/LocalError"); g_localErrorConstructor = jni::GetConstructorID(env, g_localErrorClass, "(ILjava/lang/String;)V"); } diff --git a/android/src/com/mapswithme/maps/discovery/DiscoveryManager.java b/android/src/com/mapswithme/maps/discovery/DiscoveryManager.java new file mode 100644 index 0000000000..9f7a9fa3c4 --- /dev/null +++ b/android/src/com/mapswithme/maps/discovery/DiscoveryManager.java @@ -0,0 +1,40 @@ +package com.mapswithme.maps.discovery; + +import android.support.annotation.MainThread; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; + +import com.mapswithme.maps.Framework; +import com.mapswithme.maps.search.SearchResult; +import com.mapswithme.maps.viator.ViatorProduct; + +enum DiscoveryManager +{ + INSTANCE; + + public void discover(@NonNull DiscoveryParams params) + { + Framework.nativeDiscover(params); + } + + // Called from JNI. + @MainThread + private void onResultReceived(@Nullable SearchResult[] results, @DiscoveryParams.ItemType int type) + { + // TODO: not implemented yet. + } + + // Called from JNI. + @MainThread + private void onViatorProductsReceived(@Nullable ViatorProduct[] products) + { + // TODO: not implemented yet. + } + + // Called from JNI. + @MainThread + private void onLocalExpertsReceived(@Nullable LocalExpert[] experts) + { + // TODO: not implemented yet. + } +} diff --git a/android/src/com/mapswithme/maps/locals/LocalExpert.java b/android/src/com/mapswithme/maps/discovery/LocalExpert.java similarity index 99% rename from android/src/com/mapswithme/maps/locals/LocalExpert.java rename to android/src/com/mapswithme/maps/discovery/LocalExpert.java index 964d095352..1174f4b7b0 100644 --- a/android/src/com/mapswithme/maps/locals/LocalExpert.java +++ b/android/src/com/mapswithme/maps/discovery/LocalExpert.java @@ -1,4 +1,4 @@ -package com.mapswithme.maps.locals; +package com.mapswithme.maps.discovery; import android.os.Parcel; import android.os.Parcelable; diff --git a/android/src/com/mapswithme/maps/locals/Locals.java b/android/src/com/mapswithme/maps/discovery/Locals.java similarity index 97% rename from android/src/com/mapswithme/maps/locals/Locals.java rename to android/src/com/mapswithme/maps/discovery/Locals.java index f14075e4da..f282c55aa4 100644 --- a/android/src/com/mapswithme/maps/locals/Locals.java +++ b/android/src/com/mapswithme/maps/discovery/Locals.java @@ -1,4 +1,4 @@ -package com.mapswithme.maps.locals; +package com.mapswithme.maps.discovery; import android.support.annotation.MainThread; import android.support.annotation.NonNull; diff --git a/android/src/com/mapswithme/maps/locals/LocalsError.java b/android/src/com/mapswithme/maps/discovery/LocalsError.java similarity index 95% rename from android/src/com/mapswithme/maps/locals/LocalsError.java rename to android/src/com/mapswithme/maps/discovery/LocalsError.java index 0ac4f08d24..9e064dfd5b 100644 --- a/android/src/com/mapswithme/maps/locals/LocalsError.java +++ b/android/src/com/mapswithme/maps/discovery/LocalsError.java @@ -1,4 +1,4 @@ -package com.mapswithme.maps.locals; +package com.mapswithme.maps.discovery; import android.support.annotation.IntDef; import android.support.annotation.NonNull;