Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
pichillilorenzo authored Oct 24, 2019
2 parents c316c47 + 4b14e44 commit 29e4474
Show file tree
Hide file tree
Showing 10 changed files with 123 additions and 26 deletions.
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.md
Original file line number Diff line number Diff line change
@@ -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 -->
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
Original file line number Diff line number Diff line change
@@ -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 changes: 25 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,11 @@ public void onPageFinished(WebView view, String url) {
webView.loadUrl("about:blank");
}
}

@Override
public void onInputConnectionLocked() {}

@Override
public void onInputConnectionUnlocked() {}

}
Original file line number Diff line number Diff line change
Expand Up @@ -298,19 +298,27 @@ public void clearAllCache() {
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ public void run() {
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);
}
Expand Down
2 changes: 1 addition & 1 deletion android/src/main/res/menu/menu_main.xml
Original file line number Diff line number Diff line change
@@ -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">

Expand Down
36 changes: 15 additions & 21 deletions ios/Classes/InAppBrowserWebViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
1 change: 1 addition & 0 deletions ios/flutter_inappbrowser.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ A new Flutter plugin.
s.dependency 'Flutter'

s.ios.deployment_target = '8.0'
s.swift_version = '4.0'
end

0 comments on commit 29e4474

Please sign in to comment.