0
0
Fork 0
mirror of https://github.com/YTVanced/VancedMicroG synced 2024-11-28 06:03:00 +00:00

mapbox: Allow savedInstanceState to be null

This commit is contained in:
Marvin W 2019-06-03 15:35:51 +02:00
parent 4713797edc
commit 73fd85a8c7
No known key found for this signature in database
GPG key ID: 072E9235DB996F2A
3 changed files with 5 additions and 5 deletions

View file

@ -360,8 +360,8 @@ class GoogleMapImpl(private val context: Context, private val options: GoogleMap
cameraIdleListener = listener
}
fun onCreate(savedInstanceState: Bundle) {
mapView?.onCreate(savedInstanceState.toMapbox())
fun onCreate(savedInstanceState: Bundle?) {
mapView?.onCreate(savedInstanceState?.toMapbox())
mapView?.getMapAsync(this::initMap)
}

View file

@ -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) {
map = GoogleMapImpl(activity, options ?: GoogleMapOptions())
map!!.onCreate(savedInstanceState)
return ObjectWrapper.wrap(map!!.view)
} else {
val view = map!!.view
val parent = view?.parent as ViewGroup
val parent = view.parent as ViewGroup
parent.removeView(view)
return ObjectWrapper.wrap(view)
}

View file

@ -35,7 +35,7 @@ class MapViewImpl(private val context: Context, options: GoogleMapOptions?) : IM
this.options = options ?: GoogleMapOptions()
}
override fun onCreate(savedInstanceState: Bundle) {
override fun onCreate(savedInstanceState: Bundle?) {
map = GoogleMapImpl(context, options)
map?.onCreate(savedInstanceState)
}