From cd5a5d0fecd0bdc824113b47a5bbab44585ef1e9 Mon Sep 17 00:00:00 2001 From: Paul Staats Date: Tue, 2 May 2023 11:32:44 +0200 Subject: [PATCH] Fixed the formatting --- .../WebChromeClientHostApiImpl.java | 34 ++++++++++--------- .../webviewflutter/WebViewFlutterPlugin.java | 5 +-- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebChromeClientHostApiImpl.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebChromeClientHostApiImpl.java index b68e30327bb8..454117875f1a 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebChromeClientHostApiImpl.java +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebChromeClientHostApiImpl.java @@ -72,25 +72,28 @@ public void onShowCustomView(View view, WebChromeClient.CustomViewCallback callb ((ViewGroup) mFullscreenView.getParent()).removeView(mFullscreenView); } if (context instanceof Activity) { - Window window = ((Activity)context).getWindow(); + Window window = ((Activity) context).getWindow(); mFullscreenView = view; setFullscreenStatus(true, window); - window.addContentView(mFullscreenView, - new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, - ViewGroup.LayoutParams.MATCH_PARENT, Gravity.CENTER)); + window.addContentView( + mFullscreenView, + new FrameLayout.LayoutParams( + ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.MATCH_PARENT, + Gravity.CENTER)); } } @Override public void onHideCustomView() { - if (mFullscreenView == null) { - return; - } - if (context instanceof Activity) { - setFullscreenStatus(false, ((Activity)context).getWindow()); - ((ViewGroup) mFullscreenView.getParent()).removeView(mFullscreenView); - mFullscreenView = null; - } + if (mFullscreenView == null) { + return; + } + if (context instanceof Activity) { + setFullscreenStatus(false, ((Activity) context).getWindow()); + ((ViewGroup) mFullscreenView.getParent()).removeView(mFullscreenView); + mFullscreenView = null; + } } @SuppressWarnings("deprecation") @@ -99,13 +102,11 @@ void activateFullscreenDeprecated(Boolean fullscreen, Window window) { if (fullscreen) { decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN); - window.addFlags( - WindowManager.LayoutParams.FLAG_FULLSCREEN); + window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); } else { decorView.setSystemUiVisibility(View.STATUS_BAR_VISIBLE); - window.clearFlags( - WindowManager.LayoutParams.FLAG_FULLSCREEN); + window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); } } @@ -294,6 +295,7 @@ public WebChromeClientHostApiImpl( /** * Sets the context to construct {@link WebChromeClientImpl}s. + * * @param context the new context */ public void setContext(Context context) { diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewFlutterPlugin.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewFlutterPlugin.java index 53215b899923..d8a5a5cee89f 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewFlutterPlugin.java +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewFlutterPlugin.java @@ -107,7 +107,6 @@ private void setUp( new WebChromeClientHostApiImpl.WebChromeClientCreator(), new WebChromeClientFlutterApiImpl(binaryMessenger, instanceManager), context); - JavaObjectHostApi.setup(binaryMessenger, new JavaObjectHostApiImpl(instanceManager)); WebViewHostApi.setup(binaryMessenger, webViewHostApi); @@ -118,9 +117,7 @@ private void setUp( instanceManager, new WebViewClientHostApiImpl.WebViewClientCreator(), new WebViewClientFlutterApiImpl(binaryMessenger, instanceManager))); - WebChromeClientHostApi.setup( - binaryMessenger, - webChromeClientHostApi); + WebChromeClientHostApi.setup(binaryMessenger, webChromeClientHostApi); DownloadListenerHostApi.setup( binaryMessenger, new DownloadListenerHostApiImpl(