Welcome to mirror list, hosted at ThFree Co, Russian Federation.

LightFramework.java « maps « mapswithme « com « src « android - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 94f206d73077fd531a7e9b565e275d3b98908523 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package com.mapswithme.maps;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.mapswithme.maps.background.NotificationCandidate;
import com.mapswithme.maps.bookmarks.data.FeatureId;
import com.mapswithme.maps.geofence.GeoFenceFeature;
import com.mapswithme.maps.geofence.GeofenceLocation;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class LightFramework
{
  public static native boolean nativeIsAuthenticated();
  public static native int nativeGetNumberUnsentUGC();
  @NonNull
  private static native GeoFenceFeature[] nativeGetLocalAdsFeatures(double lat, double lon,
                                                                   double radiusInMeters,
                                                                   int maxCount);
  @NonNull
  public static native String nativeMakeFeatureId(@NonNull String mwmName, long mwmVersion,
                                                  int featureIndex);

  @NonNull
  public static List<GeoFenceFeature> getLocalAdsFeatures(double lat, double lon,
                                                          double radiusInMeters,
                                                          int maxCount)
  {
    return Collections.unmodifiableList(Arrays.asList(nativeGetLocalAdsFeatures(lat,
                                                                                lon,
                                                                                radiusInMeters,
                                                                                maxCount)));
  }

  public static void logLocalAdsEvent(@NonNull GeofenceLocation location,
                                      @NonNull FeatureId feature)
  {
    nativeLogLocalAdsEvent(Framework.LocalAdsEventType.LOCAL_ADS_EVENT_VISIT.ordinal(),
                           location.getLat(), location.getLon(),
                           (int) location.getRadiusInMeters(), feature.getMwmVersion(),
                           feature.getMwmName(), feature.getFeatureIndex());
  }

  private static native void nativeLogLocalAdsEvent(int type, double lat, double lon,
                                                    int accuracyInMeters, long mwmVersion,
                                                    @NonNull String countryId, int featureIndex);
  @Nullable
  public static native NotificationCandidate nativeGetNotification();
}