Java源码示例:io.flutter.plugin.platform.PlatformView
示例1
@Override
public PlatformView create(Context context, int id, Object o) {
Gson gson = new Gson();
AMapNavModel model = new AMapNavModel();
if (o instanceof String) {
model = gson.fromJson(o.toString(), AMapNavModel.class);
}
FlutterAMapNavView aMapNavView = new FlutterAMapNavView(context, mActivityState, mPluginRegistrar, id, mPluginRegistrar.activity(), model);
// aMapNavView.setup();
return aMapNavView;
}
示例2
@Override
public PlatformView create(Context context, int id, Object o) {
Gson gson = new Gson();
AMapMapModel model = new AMapMapModel();
if (o instanceof String) {
model = gson.fromJson(o.toString(),AMapMapModel.class);
}
FlutterAMapView aMapView = new FlutterAMapView(context, mActivityState, mPluginRegistrar, id, model);
aMapView.setup();
return aMapView;
}
示例3
@Override
public PlatformView create(Context context, int viewId, Object args) {
Map<String, Object> params = (Map<String, Object>) args;
QiniucloudPlayerPlatformView view = new QiniucloudPlayerPlatformView(context);
// 绑定方法监听器
MethodChannel methodChannel = new MethodChannel(messenger, SIGN + "_" + viewId);
methodChannel.setMethodCallHandler(view);
// 初始化
view.init(params, methodChannel);
return view;
}
示例4
@Override
public PlatformView create(Context context, int viewId, Object args) {
this.viewId = viewId;
Map<String, Object> params = (Map<String, Object>) args;
QiniucloudConnectedPlayerPlatformView view = new QiniucloudConnectedPlayerPlatformView(context);
// 绑定方法监听器
MethodChannel methodChannel = new MethodChannel(messenger, SIGN + "_" + viewId);
methodChannel.setMethodCallHandler(view);
// 初始化
view.init(params, methodChannel);
// 添加到视图队列
ConnectedUtil.add(this.viewId, view);
return view;
}
示例5
@Override
public PlatformView create(Context context, int viewId, Object args) {
Map<String, Object> params = (Map<String, Object>) args;
QiniucloudPushPlatformView view = new QiniucloudPushPlatformView(context);
// 绑定方法监听器
MethodChannel methodChannel = new MethodChannel(messenger, SIGN + "_" + viewId);
methodChannel.setMethodCallHandler(view);
// 初始化
view.init(params, methodChannel);
return view;
}
示例6
@Override
public PlatformView create(Context context, int id, Object args) {
return new AdvCamera(id, context, mPluginRegistrar, args);
}
示例7
@Override
public PlatformView create(Context context, int id, Object args) {
Map<String, Object> params = (Map<String, Object>) args;
return new QrReaderView(context, registrar, id, params);
}