Merge branch 'master' into master
This commit is contained in:
commit
29e4474c13
|
@ -0,0 +1,12 @@
|
|||
# These are supported funding model platforms
|
||||
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: lorenzo_pichilli # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: ['https://www.paypal.me/LorenzoPichilli'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
name: Bug report
|
||||
about: Something is crashing or not working as intended
|
||||
|
||||
---
|
||||
|
||||
## Environment
|
||||
|
||||
**App version:** <!-- Add branch if necessary -->
|
||||
**Android version:** <!-- If customize ROM, write which -->
|
||||
**Device information:** <!-- Manufacturer and model -->
|
||||
|
||||
## Description
|
||||
|
||||
**Expected behavior:**
|
||||
|
||||
**Current behavior:**
|
||||
|
||||
## Steps to reproduce
|
||||
|
||||
1. This
|
||||
2. Than that
|
||||
3. Then
|
||||
|
||||
## Images <!-- if available, else delete -->
|
||||
|
||||
## Stacktrace/Logcat <!-- if available, else delete -->
|
|
@ -0,0 +1,19 @@
|
|||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
|
||||
---
|
||||
|
||||
## Environment
|
||||
|
||||
**App version:** <!-- Add branch if necessary -->
|
||||
**Android version:** <!-- If customize ROM, write which -->
|
||||
**Device information:** <!-- Manufacturer and model -->
|
||||
|
||||
## Description
|
||||
|
||||
**What you'd like to happen:**
|
||||
|
||||
**Alternatives you've considered:** <!-- if available, else delete -->
|
||||
|
||||
**Images:** <!-- if available, else delete -->
|
|
@ -0,0 +1,25 @@
|
|||
## Connection with issue(s)
|
||||
|
||||
Resolve issue #???
|
||||
|
||||
<!-- Required: this reference (one or many) will be closed upon merge. Ideally it has the acceptance criteria and designs for features or fixes related to the work in this Pull Request -->
|
||||
|
||||
Connected to #???
|
||||
|
||||
<!-- Optional: other issues or pull requests related to this, but merging should not close it -->
|
||||
|
||||
## Testing and Review Notes
|
||||
|
||||
<!-- Required: steps to take to confirm this works as expected or other guidance for code, UX, and any other reviewers -->
|
||||
|
||||
|
||||
## Screenshots or Videos
|
||||
|
||||
<!-- Optional: to clearly demonstrate the feature or fix to help with testing and reviews -->
|
||||
|
||||
## To Do
|
||||
|
||||
<!-- Add “WIP” to the PR title if pushing up but not complete nor ready for review -->
|
||||
- [ ] double check the original issue to confirm it is fully satisfied
|
||||
- [ ] add testing notes and screenshots in PR description to help guide reviewers
|
||||
- [ ] request the "UX" team perform a design review (if/when applicable)
|
|
@ -229,4 +229,11 @@ public class FlutterWebView implements PlatformView, MethodCallHandler {
|
|||
webView.loadUrl("about:blank");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInputConnectionLocked() {}
|
||||
|
||||
@Override
|
||||
public void onInputConnectionUnlocked() {}
|
||||
|
||||
}
|
|
@ -298,19 +298,27 @@ public class InAppWebView extends WebView {
|
|||
}
|
||||
|
||||
public byte[] takeScreenshot() {
|
||||
Picture picture = capturePicture();
|
||||
float scale = getScale();
|
||||
int height = (int) (getContentHeight() * scale + 0.5);
|
||||
|
||||
Bitmap b = Bitmap.createBitmap( getWidth(),
|
||||
getHeight(), Bitmap.Config.ARGB_8888);
|
||||
height, Bitmap.Config.ARGB_8888);
|
||||
Canvas c = new Canvas(b);
|
||||
|
||||
picture.draw(c);
|
||||
draw(c);
|
||||
int scrollOffset = (getScrollY() + getMeasuredHeight() > b.getHeight())
|
||||
? b.getHeight() : getScrollY();
|
||||
Bitmap resized = Bitmap.createBitmap(
|
||||
b, 0, scrollOffset, b.getWidth(), getMeasuredHeight());
|
||||
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
b.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream);
|
||||
resized.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream);
|
||||
try {
|
||||
byteArrayOutputStream.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
resized.recycle();
|
||||
return byteArrayOutputStream.toByteArray();
|
||||
}
|
||||
|
||||
|
|
|
@ -51,6 +51,10 @@ public class JavaScriptBridgeInterface {
|
|||
getChannel().invokeMethod("onCallJsHandler", obj, new MethodChannel.Result() {
|
||||
@Override
|
||||
public void success(Object json) {
|
||||
if (flutterWebView.webView == null) {
|
||||
// The webview has already been disposed, ignore.
|
||||
return;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
flutterWebView.webView.evaluateJavascript("window." + name + "[" + _callHandlerID + "](" + json + "); delete window." + name + "[" + _callHandlerID + "];", null);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:appcompat="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:app="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context=".InAppBrowserActivity">
|
||||
|
||||
|
|
|
@ -272,27 +272,21 @@ class InAppBrowserWebViewController: UIViewController, UIScrollViewDelegate, WKU
|
|||
|
||||
weak var weakSelf = self
|
||||
|
||||
// Run later to avoid the "took a long time" log message.
|
||||
DispatchQueue.main.async(execute: {() -> Void in
|
||||
if (weakSelf?.responds(to: #selector(getter: self.presentingViewController)))! {
|
||||
weakSelf?.presentingViewController?.dismiss(animated: true, completion: {() -> Void in
|
||||
self.tmpWindow?.windowLevel = UIWindow.Level(rawValue: 0.0)
|
||||
UIApplication.shared.delegate?.window??.makeKeyAndVisible()
|
||||
if (self.navigationDelegate != nil) {
|
||||
self.navigationDelegate?.browserExit(uuid: self.uuid)
|
||||
}
|
||||
})
|
||||
}
|
||||
else {
|
||||
weakSelf?.parent?.dismiss(animated: true, completion: {() -> Void in
|
||||
self.tmpWindow?.windowLevel = UIWindow.Level(rawValue: 0.0)
|
||||
UIApplication.shared.delegate?.window??.makeKeyAndVisible()
|
||||
})
|
||||
}
|
||||
if (self.navigationDelegate != nil) {
|
||||
self.navigationDelegate?.browserExit(uuid: self.uuid)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@objc func goBack() {
|
||||
|
|
|
@ -18,5 +18,6 @@ A new Flutter plugin.
|
|||
s.dependency 'Flutter'
|
||||
|
||||
s.ios.deployment_target = '8.0'
|
||||
s.swift_version = '4.0'
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue