craft-native 0.0.168 → 0.0.170

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -52,9 +52,16 @@ object CraftLocationRecordingStore {
52
52
  fun isActive(context: Context) = prefs(context).getBoolean("active", false)
53
53
  fun isPaused(context: Context) = prefs(context).getBoolean("paused", false)
54
54
 
55
+ /**
56
+ * Hears each fix the recording keeps, while the app is running: a native
57
+ * screen shows the route growing (`craftLocationUpdate`).
58
+ */
59
+ @Volatile var listener: ((android.location.Location) -> Unit)? = null
60
+
55
61
  @Synchronized
56
62
  fun append(context: Context, location: android.location.Location) {
57
63
  if (!isActive(context) || isPaused(context)) return
64
+ listener?.invoke(location)
58
65
  val json = JSONObject().apply {
59
66
  put("latitude", location.latitude)
60
67
  put("longitude", location.longitude)