Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f1250b0 authored by Fynn Godau's avatar Fynn Godau
Browse files

Merge branch '912-snapshot' into 'epic67-maps'

Snapshots

See merge request !59
parents dd4e7961 0008c656
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -523,8 +523,17 @@ class GoogleMapImpl(private val context: Context, var options: GoogleMapOptions)
    }

    override fun snapshot(callback: ISnapshotReadyCallback, bitmap: IObjectWrapper?) {
        Log.d(TAG, "unimplemented Method: snapshot")

        val map = map
        if (map == null) {
            // Snapshot cannot be taken
            runOnMainLooper { callback.onBitmapWrappedReady(ObjectWrapper.wrap(null)) }
        } else {
            map.snapshot {
                runOnMainLooper {
                    callback.onBitmapWrappedReady(ObjectWrapper.wrap(it))
                }
            }
        }
    }

    override fun setPadding(left: Int, top: Int, right: Int, bottom: Int) = afterInitialize { map ->