September 2019
Beginner
512 pages
12h 52m
English
Creating and registering platform views on each platform is a very similar process; we just need to manage the differences in languages and native view APIs. The simplest way to start platform view creation is to register it into the platform views registry, very similar to what is done when creating a Flutter plugin. Also, as we are dealing with a plugin project, this is done together with the plugin registration:
class HandsOnPlatformViewsPlugin{ companion object { @JvmStatic fun registerWith(registrar: Registrar) { registrar .platformViewRegistry() .registerViewFactory( "com.example.handson/textview", HandsOnTextViewFactory()); } }}
We register a view factory identifying it with a type/key, so that, when instantiating ...
Read now
Unlock full access