mapbox-maps-android
mapbox-maps-android copied to clipboard
Revisit gesture plugin initialization
Capturing from this comment:
Now thinking of this part of the initialisation of GesturesPlugin, why does it need to be a separate constructor for context, attrs and pixel ratio? As far as I see, the GesturesPlugin extends ContextBinder
fun interface ContextBinder {
/**
* Bind the ViewPlugin with current map context. This will create a View that
* will be added to the MapView.
*
* @param context The hosting context
* @param attrs parent attributes
* @param pixelRatio the pixel ratio of the device
* @return View that will be added to the MapView
*/
fun bind(context: Context, attrs: AttributeSet?, pixelRatio: Float)
}
So the GesturesPlugin can be initialised properly when the plugin is created through the MapPluginRegistry.