Skip to content

Commit

Permalink
Fixed the formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
paulppn committed May 2, 2023
1 parent 5498f0b commit cd5a5d0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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);
}
}

Expand Down Expand Up @@ -294,6 +295,7 @@ public WebChromeClientHostApiImpl(

/**
* Sets the context to construct {@link WebChromeClientImpl}s.
*
* @param context the new context
*/
public void setContext(Context context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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(
Expand Down

0 comments on commit cd5a5d0

Please sign in to comment.