This commit is contained in:
Lorenzo Pichilli 2022-04-28 17:30:44 +02:00
commit 517f6599dc
3 changed files with 14 additions and 9 deletions

View File

@ -11,17 +11,21 @@
- On Android, the `InAppWebView` widget uses hybrid composition by default (`useHybridComposition: true`). - On Android, the `InAppWebView` widget uses hybrid composition by default (`useHybridComposition: true`).
## 5.4.3+1 ## 5.4.3+2
- Fixed "Latest version 5.4.3 crashes on Android" [#1159](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1159) - Fixed "Latest version 5.4.3 crashes on Android" [#1159](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1159)
## 5.4.3+1
- Try to fix "Latest version 5.4.3 crashes on Android" [#1159](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1159)
## 5.4.3 ## 5.4.3
- Added Bitwise OR operator support for `AndroidActionModeMenuItem` class - Added Bitwise OR operator support for `AndroidActionModeMenuItem` class
## 5.4.2+1 ## 5.4.2+1
- Fixed "Latest version 5.4.2 crashes on Android - HeadlessInAppWebView.dispose" [#1155](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1155) - Try to fix "Latest version 5.4.2 crashes on Android - HeadlessInAppWebView.dispose" [#1155](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1155)
## 5.4.2 ## 5.4.2

View File

@ -83,8 +83,10 @@ public class HeadlessInAppWebViewManager implements MethodChannel.MethodCallHand
channel.setMethodCallHandler(null); channel.setMethodCallHandler(null);
Collection<HeadlessInAppWebView> headlessInAppWebViews = webViews.values(); Collection<HeadlessInAppWebView> headlessInAppWebViews = webViews.values();
for (HeadlessInAppWebView headlessInAppWebView : headlessInAppWebViews) { for (HeadlessInAppWebView headlessInAppWebView : headlessInAppWebViews) {
if (headlessInAppWebView != null) {
headlessInAppWebView.dispose(); headlessInAppWebView.dispose();
} }
}
webViews.clear(); webViews.clear();
} }
} }

View File

@ -55,7 +55,7 @@ public class InAppBrowserActivity extends AppCompatActivity implements InAppBrow
public ActionBar actionBar; public ActionBar actionBar;
public Menu menu; public Menu menu;
public SearchView searchView; public SearchView searchView;
public InAppBrowserSettings customSettings; public InAppBrowserSettings customSettings = new InAppBrowserSettings();
public ProgressBar progressBar; public ProgressBar progressBar;
public boolean isHidden = false; public boolean isHidden = false;
public String fromActivity; public String fromActivity;
@ -76,6 +76,9 @@ public class InAppBrowserActivity extends AppCompatActivity implements InAppBrow
manager = InAppBrowserManager.shared.get(managerId); manager = InAppBrowserManager.shared.get(managerId);
if (manager == null || manager.plugin == null|| manager.plugin.messenger == null) return; if (manager == null || manager.plugin == null|| manager.plugin.messenger == null) return;
Map<String, Object> settingsMap = (Map<String, Object>) b.getSerializable("settings");
customSettings.parse(settingsMap);
windowId = b.getInt("windowId"); windowId = b.getInt("windowId");
channel = new MethodChannel(manager.plugin.messenger, "com.pichillilorenzo/flutter_inappbrowser_" + id); channel = new MethodChannel(manager.plugin.messenger, "com.pichillilorenzo/flutter_inappbrowser_" + id);
@ -102,13 +105,9 @@ public class InAppBrowserActivity extends AppCompatActivity implements InAppBrow
fromActivity = b.getString("fromActivity"); fromActivity = b.getString("fromActivity");
Map<String, Object> settingsMap = (Map<String, Object>) b.getSerializable("settings");
Map<String, Object> contextMenu = (Map<String, Object>) b.getSerializable("contextMenu"); Map<String, Object> contextMenu = (Map<String, Object>) b.getSerializable("contextMenu");
List<Map<String, Object>> initialUserScripts = (List<Map<String, Object>>) b.getSerializable("initialUserScripts"); List<Map<String, Object>> initialUserScripts = (List<Map<String, Object>>) b.getSerializable("initialUserScripts");
customSettings = new InAppBrowserSettings();
customSettings.parse(settingsMap);
InAppWebViewSettings webViewSettings = new InAppWebViewSettings(); InAppWebViewSettings webViewSettings = new InAppWebViewSettings();
webViewSettings.parse(settingsMap); webViewSettings.parse(settingsMap);
webView.customSettings = webViewSettings; webView.customSettings = webViewSettings;