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

Commit 53aba0ce authored by Fynn Godau's avatar Fynn Godau
Browse files

Call callback later

An app (Biryani By Kilo) is, for an unknown reason, not performing its
map updates if the callback is executed before the rest of its code that
immediately follows the call that sets the callback (likely: the rest of
its onCreate). Therefore, delay callback invocation until after next UI
draw.
parent f0b9ed3a
Loading
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -820,8 +820,10 @@ class GoogleMapImpl(context: Context, var options: GoogleMapOptions) : AbstractG
                 * null), otherwise that results in other problems (e.g. Gas Now app not
                 * initializing).
                 */
                Log.d(TAG, "Invoking callback instantly: map cannot be initialized because it is not shown (yet)")
                mapView?.post {
                    Log.d(TAG, "Invoking callback now: map cannot be initialized because it is not shown (yet)")
                    runCallback()
                }
            } else {
                Log.d(TAG, "Delay callback invocation, as map is not yet initialized")
                initializedCallbackList.add { runCallback() }