mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2025-02-03 14:37:31 +01:00
mapbox: Allow savedInstanceState to be null
This commit is contained in:
parent
4713797edc
commit
73fd85a8c7
@ -360,8 +360,8 @@ class GoogleMapImpl(private val context: Context, private val options: GoogleMap
|
|||||||
cameraIdleListener = listener
|
cameraIdleListener = listener
|
||||||
}
|
}
|
||||||
|
|
||||||
fun onCreate(savedInstanceState: Bundle) {
|
fun onCreate(savedInstanceState: Bundle?) {
|
||||||
mapView?.onCreate(savedInstanceState.toMapbox())
|
mapView?.onCreate(savedInstanceState?.toMapbox())
|
||||||
mapView?.getMapAsync(this::initMap)
|
mapView?.getMapAsync(this::initMap)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,14 +46,14 @@ class MapFragmentImpl(private val activity: Activity) : IMapFragmentDelegate.Stu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateView(layoutInflater: IObjectWrapper, container: IObjectWrapper, savedInstanceState: Bundle): IObjectWrapper {
|
override fun onCreateView(layoutInflater: IObjectWrapper, container: IObjectWrapper, savedInstanceState: Bundle?): IObjectWrapper {
|
||||||
if (map == null) {
|
if (map == null) {
|
||||||
map = GoogleMapImpl(activity, options ?: GoogleMapOptions())
|
map = GoogleMapImpl(activity, options ?: GoogleMapOptions())
|
||||||
map!!.onCreate(savedInstanceState)
|
map!!.onCreate(savedInstanceState)
|
||||||
return ObjectWrapper.wrap(map!!.view)
|
return ObjectWrapper.wrap(map!!.view)
|
||||||
} else {
|
} else {
|
||||||
val view = map!!.view
|
val view = map!!.view
|
||||||
val parent = view?.parent as ViewGroup
|
val parent = view.parent as ViewGroup
|
||||||
parent.removeView(view)
|
parent.removeView(view)
|
||||||
return ObjectWrapper.wrap(view)
|
return ObjectWrapper.wrap(view)
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ class MapViewImpl(private val context: Context, options: GoogleMapOptions?) : IM
|
|||||||
this.options = options ?: GoogleMapOptions()
|
this.options = options ?: GoogleMapOptions()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
map = GoogleMapImpl(context, options)
|
map = GoogleMapImpl(context, options)
|
||||||
map?.onCreate(savedInstanceState)
|
map?.onCreate(savedInstanceState)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user