Skip to content

Commit 4c0d622

Browse files
authored
Split Geofence Examples (#2842)
1 parent 572a41d commit 4c0d622

File tree

9 files changed

+491
-275
lines changed

9 files changed

+491
-275
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,23 @@
403403
android:value=".ExampleOverviewActivity" />
404404
</activity>
405405
<activity
406-
android:name=".examples.geofence.GeofencingActivity"
407-
android:description="@string/description_geofencing"
406+
android:name=".examples.geofence.SimpleGeofencingActivity"
407+
android:description="@string/description_simple_geofencing"
408408
android:exported="true"
409-
android:label="@string/activity_geofencing"
409+
android:label="@string/activity_simple_geofencing"
410+
android:launchMode="singleTask">
411+
<meta-data
412+
android:name="@string/category"
413+
android:value="@string/category_location" />
414+
<meta-data
415+
android:name="android.support.PARENT_ACTIVITY"
416+
android:value=".ExampleOverviewActivity" />
417+
</activity>
418+
<activity
419+
android:name=".examples.geofence.ExtendedGeofencingActivity"
420+
android:description="@string/description_extended_geofencing"
421+
android:exported="true"
422+
android:label="@string/activity_extended_geofencing"
410423
android:launchMode="singleTask">
411424
<meta-data
412425
android:name="@string/category"

app/src/main/java/com/mapbox/maps/testapp/MapboxApplication.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import com.mapbox.common.experimental.geofencing.GeofencingFactory
99
import com.mapbox.common.experimental.geofencing.GeofencingObserver
1010
import com.mapbox.maps.logD
1111
import com.mapbox.maps.logW
12-
import com.mapbox.maps.testapp.examples.geofence.GeofencingActivity
12+
import com.mapbox.maps.testapp.examples.geofence.ExtendedGeofencingActivity
1313

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

2121
override fun onEntry(event: GeofencingEvent) {
22-
GeofencingActivity.showNotification(
22+
ExtendedGeofencingActivity.showNotification(
2323
this@MapboxApplication,
2424
"Entry into feature id = ${event.feature.id()} at ${event.timestamp}",
2525
event.feature.id(),
26-
GeofencingActivity.NOTIFICATION_FEATURE_ENTRY
26+
ExtendedGeofencingActivity.NOTIFICATION_FEATURE_ENTRY
2727
)
2828
}
2929

3030
override fun onExit(event: GeofencingEvent) {
31-
GeofencingActivity.showNotification(
31+
ExtendedGeofencingActivity.showNotification(
3232
this@MapboxApplication,
3333
"Exit from feature id = ${event.feature.id()} at ${event.timestamp}",
3434
event.feature.id(),
35-
GeofencingActivity.NOTIFICATION_FEATURE_EXIT
35+
ExtendedGeofencingActivity.NOTIFICATION_FEATURE_EXIT
3636
)
3737
}
3838

3939
override fun onDwell(event: GeofencingEvent) {
40-
GeofencingActivity.showNotification(
40+
ExtendedGeofencingActivity.showNotification(
4141
this@MapboxApplication,
4242
"Dwell into feature id = ${event.feature.id()} at ${event.timestamp}",
4343
event.feature.id(),
44-
GeofencingActivity.NOTIFICATION_FEATURE_DWELL
44+
ExtendedGeofencingActivity.NOTIFICATION_FEATURE_DWELL
4545
)
4646
}
4747

0 commit comments

Comments
 (0)