fix #128
This commit is contained in:
parent
f569e369f4
commit
ddb4d55613
|
@ -3,6 +3,7 @@
|
||||||
- Updated Android context menu workaround
|
- Updated Android context menu workaround
|
||||||
- Calling `onCreateContextMenu` event on iOS also when the context menu is disabled in order to have the same effect as Android
|
- Calling `onCreateContextMenu` event on iOS also when the context menu is disabled in order to have the same effect as Android
|
||||||
- Added Android keyboard workaround to hide the keyboard when clicking other HTML elements, losing the focus on the previous input
|
- Added Android keyboard workaround to hide the keyboard when clicking other HTML elements, losing the focus on the previous input
|
||||||
|
- Fixed `Print preview is not working? java.lang.IllegalStateException: Can print only from an activity` [#128](https://github.com/pichillilorenzo/flutter_inappwebview/issues/128)
|
||||||
|
|
||||||
## 3.2.0
|
## 3.2.0
|
||||||
|
|
||||||
|
|
|
@ -1470,8 +1470,7 @@ final public class InAppWebView extends InputAwareWebView {
|
||||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||||
public void printCurrentPage() {
|
public void printCurrentPage() {
|
||||||
// Get a PrintManager instance
|
// Get a PrintManager instance
|
||||||
PrintManager printManager = (PrintManager) Shared.activity.getApplicationContext()
|
PrintManager printManager = (PrintManager) Shared.activity.getSystemService(Context.PRINT_SERVICE);
|
||||||
.getSystemService(Context.PRINT_SERVICE);
|
|
||||||
|
|
||||||
if (printManager != null) {
|
if (printManager != null) {
|
||||||
String jobName = getTitle() + " Document";
|
String jobName = getTitle() + " Document";
|
||||||
|
|
|
@ -71,6 +71,7 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
|
||||||
Shared.activityPluginBinding.addActivityResultListener(this);
|
Shared.activityPluginBinding.addActivityResultListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Bitmap getDefaultVideoPoster() {
|
public Bitmap getDefaultVideoPoster() {
|
||||||
if (mCustomView == null) {
|
if (mCustomView == null) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -78,6 +79,7 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
|
||||||
return BitmapFactory.decodeResource(Shared.activity.getApplicationContext().getResources(), 2130837573);
|
return BitmapFactory.decodeResource(Shared.activity.getApplicationContext().getResources(), 2130837573);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void onHideCustomView() {
|
public void onHideCustomView() {
|
||||||
View decorView = Shared.activity.getWindow().getDecorView();
|
View decorView = Shared.activity.getWindow().getDecorView();
|
||||||
((FrameLayout) decorView).removeView(this.mCustomView);
|
((FrameLayout) decorView).removeView(this.mCustomView);
|
||||||
|
@ -88,7 +90,8 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
|
||||||
this.mCustomViewCallback = null;
|
this.mCustomViewCallback = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onShowCustomView(View paramView, WebChromeClient.CustomViewCallback paramCustomViewCallback) {
|
@Override
|
||||||
|
public void onShowCustomView(View paramView, CustomViewCallback paramCustomViewCallback) {
|
||||||
if (this.mCustomView != null) {
|
if (this.mCustomView != null) {
|
||||||
onHideCustomView();
|
onHideCustomView();
|
||||||
return;
|
return;
|
||||||
|
@ -100,16 +103,28 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
|
||||||
this.mCustomViewCallback = paramCustomViewCallback;
|
this.mCustomViewCallback = paramCustomViewCallback;
|
||||||
this.mCustomView.setBackgroundColor(Color.parseColor("#000000"));
|
this.mCustomView.setBackgroundColor(Color.parseColor("#000000"));
|
||||||
((FrameLayout) decorView).addView(this.mCustomView, new FrameLayout.LayoutParams(-1, -1));
|
((FrameLayout) decorView).addView(this.mCustomView, new FrameLayout.LayoutParams(-1, -1));
|
||||||
decorView.setSystemUiVisibility(
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||||
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
decorView.setSystemUiVisibility(
|
||||||
// Set the content to appear under the system bars so that the
|
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||||
// content doesn't resize when the system bars hide and show.
|
// Set the content to appear under the system bars so that the
|
||||||
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
// content doesn't resize when the system bars hide and show.
|
||||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||||
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||||
// Hide the nav bar and status bar
|
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||||
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
// Hide the nav bar and status bar
|
||||||
| View.SYSTEM_UI_FLAG_FULLSCREEN);
|
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||||
|
| View.SYSTEM_UI_FLAG_FULLSCREEN);
|
||||||
|
} else {
|
||||||
|
decorView.setSystemUiVisibility(
|
||||||
|
// Set the content to appear under the system bars so that the
|
||||||
|
// content doesn't resize when the system bars hide and show.
|
||||||
|
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||||
|
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||||
|
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||||
|
// Hide the nav bar and status bar
|
||||||
|
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||||
|
| View.SYSTEM_UI_FLAG_FULLSCREEN);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity-0.4.8+5/","dependencies":[]},{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.4.4/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-3.2.0/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.7/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-3.3.0/","dependencies":[]}],"android":[{"name":"connectivity","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity-0.4.8+5/","dependencies":[]},{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.4.4/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-3.2.0/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.7/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-3.3.0/","dependencies":[]}],"macos":[{"name":"connectivity_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_macos-0.1.0+3/","dependencies":[]},{"name":"path_provider_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+2/","dependencies":[]}],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"connectivity","dependencies":["connectivity_macos"]},{"name":"connectivity_macos","dependencies":[]},{"name":"flutter_downloader","dependencies":[]},{"name":"flutter_inappwebview","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos"]},{"name":"path_provider_macos","dependencies":[]},{"name":"permission_handler","dependencies":[]}],"date_created":"2020-05-21 22:50:56.107907","version":"1.17.0"}
|
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity-0.4.8+5/","dependencies":[]},{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.4.4/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.7/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-3.3.0/","dependencies":[]}],"android":[{"name":"connectivity","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity-0.4.8+5/","dependencies":[]},{"name":"flutter_downloader","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.4.4/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/lorenzopichilli/Desktop/flutter_inappwebview/","dependencies":[]},{"name":"path_provider","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.7/","dependencies":[]},{"name":"permission_handler","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-3.3.0/","dependencies":[]}],"macos":[{"name":"connectivity_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_macos-0.1.0+3/","dependencies":[]},{"name":"path_provider_macos","path":"/Users/lorenzopichilli/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+2/","dependencies":[]}],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"connectivity","dependencies":["connectivity_macos"]},{"name":"connectivity_macos","dependencies":[]},{"name":"flutter_downloader","dependencies":[]},{"name":"flutter_inappwebview","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos"]},{"name":"path_provider_macos","dependencies":[]},{"name":"permission_handler","dependencies":[]}],"date_created":"2020-05-22 12:58:00.364435","version":"1.17.1"}
|
|
@ -2,11 +2,10 @@
|
||||||
# This is a generated file; do not edit or check into version control.
|
# This is a generated file; do not edit or check into version control.
|
||||||
export "FLUTTER_ROOT=/Users/lorenzopichilli/flutter"
|
export "FLUTTER_ROOT=/Users/lorenzopichilli/flutter"
|
||||||
export "FLUTTER_APPLICATION_PATH=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example"
|
export "FLUTTER_APPLICATION_PATH=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example"
|
||||||
export "FLUTTER_TARGET=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example/lib/main.dart"
|
export "FLUTTER_TARGET=lib/main.dart"
|
||||||
export "FLUTTER_BUILD_DIR=build"
|
export "FLUTTER_BUILD_DIR=build"
|
||||||
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
|
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
|
||||||
export "OTHER_LDFLAGS=$(inherited) -framework Flutter"
|
export "OTHER_LDFLAGS=$(inherited) -framework Flutter"
|
||||||
export "FLUTTER_FRAMEWORK_DIR=/Users/lorenzopichilli/flutter/bin/cache/artifacts/engine/ios"
|
export "FLUTTER_FRAMEWORK_DIR=/Users/lorenzopichilli/flutter/bin/cache/artifacts/engine/ios"
|
||||||
export "FLUTTER_BUILD_NAME=1.0.0"
|
export "FLUTTER_BUILD_NAME=1.0.0"
|
||||||
export "FLUTTER_BUILD_NUMBER=1"
|
export "FLUTTER_BUILD_NUMBER=1"
|
||||||
export "TRACK_WIDGET_CREATION=true"
|
|
||||||
|
|
|
@ -24,8 +24,8 @@ dependencies:
|
||||||
path_provider: ^1.4.0
|
path_provider: ^1.4.0
|
||||||
permission_handler: ^3.3.0
|
permission_handler: ^3.3.0
|
||||||
connectivity: ^0.4.5+6
|
connectivity: ^0.4.5+6
|
||||||
flutter_inappwebview: ^3.2.0
|
flutter_inappwebview:
|
||||||
#path: ../
|
path: ../
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_driver:
|
flutter_driver:
|
||||||
|
|
Loading…
Reference in New Issue