Merge branch 'master' into master

This commit is contained in:
Lorenzo Pichilli 2019-10-24 12:34:07 +02:00 committed by GitHub
commit 29e4474c13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 123 additions and 26 deletions

12
.github/FUNDING.yml vendored Normal file
View File

@ -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']

27
.github/ISSUE_TEMPLATE/BUG_REPORT.md vendored Normal file
View File

@ -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 -->

View File

@ -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 -->

25
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -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)

View File

@ -229,4 +229,11 @@ public class FlutterWebView implements PlatformView, MethodCallHandler {
webView.loadUrl("about:blank");
}
}
@Override
public void onInputConnectionLocked() {}
@Override
public void onInputConnectionUnlocked() {}
}

View File

@ -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();
}

View File

@ -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);
}

View File

@ -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">

View File

@ -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)
}
})
}
})
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()
})
}
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() {

View File

@ -18,5 +18,6 @@ A new Flutter plugin.
s.dependency 'Flutter'
s.ios.deployment_target = '8.0'
s.swift_version = '4.0'
end