From 7a4caa56b0fc385080eb2bad22d2a3d81a1b2925 Mon Sep 17 00:00:00 2001 From: Amir Hardon Date: Thu, 5 Jul 2018 13:54:29 -0700 Subject: [PATCH] Platform Views: Android and MethodChannel APIs, and implementation skeleton. To keep the scope of this CL as small of possible I'm leaving the actual implementation of the platform view mechanics to a following CL. This CL introduces: * A PlatformViewsController class which will be responsible for creating, resizing, and disposing platform views. * A PlatformViewRegistry which is exposed through the PluginRegistry and allows plugins to register factories for platform views. Android plugin code will add support for a new platform view type by implementing PlatformViewFactory, and registering a factory with the registry, e.g: ```java registrar.platformViewRegistry().registerViewFactory( 'webview', new FlutterWebViewFactory() ); ``` On the Dart side, the framework will ask the engine to create new platform views by sending a create message over the platformviews method channel with the unique platform view type id, dimensions, and a unique id allocated by the framework for the new platform view instance. The platformviews method channel is also used for resizing and disposing platform views. --- .../io/flutter/plugin/platform/PlatformViewsController.java | 2 -- travis/licenses_golden/licenses_flutter | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java b/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java index 2d10a45d81fbf..f3afbb8b3d082 100644 --- a/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java +++ b/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java @@ -4,13 +4,11 @@ package io.flutter.plugin.platform; -import android.util.Log; import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; import io.flutter.plugin.common.StandardMethodCodec; import io.flutter.view.FlutterView; -import java.util.HashMap; import java.util.Map; /** diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index d6c0f0cee527a..6f4e4d8ce7add 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -202,6 +202,11 @@ FILE: ../../../flutter/lib/ui/window/window.h FILE: ../../../flutter/shell/common/skia_event_tracer_impl.cc FILE: ../../../flutter/shell/platform/android/apk_asset_provider.cc FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/JSONUtil.java +FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/PlatformView.java +FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewFactory.java +FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewRegistry.java +FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewRegistryImpl.java +FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java FILE: ../../../flutter/shell/platform/darwin/desktop/Info.plist FILE: ../../../flutter/shell/platform/darwin/ios/framework/Flutter.podspec FILE: ../../../flutter/shell/platform/darwin/ios/framework/Info.plist