Skip to content

Commit

Permalink
Split Geofence Examples (#2842)
Browse files Browse the repository at this point in the history
  • Loading branch information
flasher297 authored Nov 8, 2024
1 parent 572a41d commit 4c0d622
Show file tree
Hide file tree
Showing 9 changed files with 491 additions and 275 deletions.
19 changes: 16 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,23 @@
android:value=".ExampleOverviewActivity" />
</activity>
<activity
android:name=".examples.geofence.GeofencingActivity"
android:description="@string/description_geofencing"
android:name=".examples.geofence.SimpleGeofencingActivity"
android:description="@string/description_simple_geofencing"
android:exported="true"
android:label="@string/activity_geofencing"
android:label="@string/activity_simple_geofencing"
android:launchMode="singleTask">
<meta-data
android:name="@string/category"
android:value="@string/category_location" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".ExampleOverviewActivity" />
</activity>
<activity
android:name=".examples.geofence.ExtendedGeofencingActivity"
android:description="@string/description_extended_geofencing"
android:exported="true"
android:label="@string/activity_extended_geofencing"
android:launchMode="singleTask">
<meta-data
android:name="@string/category"
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/java/com/mapbox/maps/testapp/MapboxApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import com.mapbox.common.experimental.geofencing.GeofencingFactory
import com.mapbox.common.experimental.geofencing.GeofencingObserver
import com.mapbox.maps.logD
import com.mapbox.maps.logW
import com.mapbox.maps.testapp.examples.geofence.GeofencingActivity
import com.mapbox.maps.testapp.examples.geofence.ExtendedGeofencingActivity

/**
* Application class of the test application.
Expand All @@ -19,29 +19,29 @@ class MapboxApplication : MultiDexApplication() {
private val geofencingObserver: GeofencingObserver = object : GeofencingObserver {

override fun onEntry(event: GeofencingEvent) {
GeofencingActivity.showNotification(
ExtendedGeofencingActivity.showNotification(
this@MapboxApplication,
"Entry into feature id = ${event.feature.id()} at ${event.timestamp}",
event.feature.id(),
GeofencingActivity.NOTIFICATION_FEATURE_ENTRY
ExtendedGeofencingActivity.NOTIFICATION_FEATURE_ENTRY
)
}

override fun onExit(event: GeofencingEvent) {
GeofencingActivity.showNotification(
ExtendedGeofencingActivity.showNotification(
this@MapboxApplication,
"Exit from feature id = ${event.feature.id()} at ${event.timestamp}",
event.feature.id(),
GeofencingActivity.NOTIFICATION_FEATURE_EXIT
ExtendedGeofencingActivity.NOTIFICATION_FEATURE_EXIT
)
}

override fun onDwell(event: GeofencingEvent) {
GeofencingActivity.showNotification(
ExtendedGeofencingActivity.showNotification(
this@MapboxApplication,
"Dwell into feature id = ${event.feature.id()} at ${event.timestamp}",
event.feature.id(),
GeofencingActivity.NOTIFICATION_FEATURE_DWELL
ExtendedGeofencingActivity.NOTIFICATION_FEATURE_DWELL
)
}

Expand Down
Loading

0 comments on commit 4c0d622

Please sign in to comment.