mirror of
https://github.com/YTVanced/VancedMicroG
synced 2024-11-04 18:15:04 +00:00
mapbox: Allow savedInstanceState to be null
This commit is contained in:
parent
4713797edc
commit
73fd85a8c7
3 changed files with 5 additions and 5 deletions
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue