fix resize window

Change-Id: Iff851ceda75cbbcf683684f2ecccd043f85d30b7
This commit is contained in:
songcongyi
2021-07-29 19:58:12 +08:00
parent decc0a69e7
commit e54047f94d
+10
View File
@@ -160,6 +160,16 @@ void AceAbility::OnStart(const Want& want)
return aceView->DispatchTouchEvent(aceView, event);
};
window->RegistOnTouchCb(touchEventCallback);
// register surface change callback
auto&& surfaceChangedCallBack = [flutterAceView](OHOS::WindowInfo& info) {
LOGD("RegistWindowInfoChangeCb surfaceChangedCallBack called");
flutter::ViewportMetrics metrics;
metrics.physical_width = info.width;
metrics.physical_height = info.height;
Platform::FlutterAceView::SetViewportMetrics(flutterAceView, metrics);
Platform::FlutterAceView::SurfaceChanged(flutterAceView, info.width, info.height, 0);
};
window->RegistWindowInfoChangeCb(surfaceChangedCallBack);
Platform::FlutterAceView::SurfaceCreated(flutterAceView, window);