This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e2be3ab
commit 9f1612f
Showing
6 changed files
with
115 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Events.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.mapbox.mapboxsdk.maps; | ||
|
||
|
||
import com.mapbox.android.telemetry.MapboxTelemetry; | ||
import com.mapbox.android.telemetry.TelemetryEnabler; | ||
import com.mapbox.mapboxsdk.BuildConfig; | ||
import com.mapbox.mapboxsdk.Mapbox; | ||
|
||
class Events { | ||
static final String TWO_FINGER_TAP = "TwoFingerTap"; | ||
static final String DOUBLE_TAP = "DoubleTap"; | ||
static final String SINGLE_TAP = "SingleTap"; | ||
static final String PAN = "Pan"; | ||
static final String PINCH = "Pinch"; | ||
static final String ROTATION = "Rotation"; | ||
static final String PITCH = "Pitch"; | ||
private MapboxTelemetry telemetry; | ||
|
||
private Events() { | ||
telemetry = new MapboxTelemetry(Mapbox.getApplicationContext(), Mapbox.getAccessToken(), | ||
BuildConfig.MAPBOX_EVENTS_USER_AGENT); | ||
TelemetryEnabler.State telemetryState = TelemetryEnabler.retrieveTelemetryStateFromPreferences(); | ||
if (TelemetryEnabler.State.NOT_INITIALIZED.equals(telemetryState) | ||
|| TelemetryEnabler.State.ENABLED.equals(telemetryState)) { | ||
telemetry.enable(); | ||
} | ||
} | ||
|
||
private static class EventsHolder { | ||
private static final Events INSTANCE = new Events(); | ||
} | ||
|
||
static MapboxTelemetry obtainTelemetry() { | ||
return EventsHolder.INSTANCE.telemetry; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters