Skip to content

Commit

Permalink
Merge pull request #4 from gmackall/master
Browse files Browse the repository at this point in the history
remove android v1 embedding
  • Loading branch information
ueman authored Sep 18, 2024
2 parents 4c58653 + 5b3dce1 commit 2cf712c
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 52 deletions.
4 changes: 4 additions & 0 deletions flutter_inappwebview/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 6.0.0+1

* Removes references to and support for deprecated v1 Android embedding.

## 6.0.0

- Updated minimum platform interface and implementation versions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
<uses-permission android:name="android.permission.VIDEO_CAPTURE" />
<uses-permission android:name="android.permission.AUDIO_CAPTURE" />

<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:label="flutter_inappwebview_example"
android:usesCleartextTraffic="true"
Expand All @@ -38,22 +33,6 @@
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<!-- <activity-->
<!-- android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"-->
<!-- android:exported="true"-->
<!-- android:hardwareAccelerated="true"-->
<!-- android:launchMode="singleTop"-->
<!-- android:name=".EmbedderV1Activity"-->
<!-- android:theme="@style/LaunchTheme"-->
<!-- android:windowSoftInputMode="adjustResize">-->
<!-- &lt;!&ndash; This keeps the window background of the activity showing-->
<!-- until Flutter renders its first frame. It can be removed if-->
<!-- there is no splash screen (such as the default splash screen-->
<!-- defined in @style/LaunchTheme). &ndash;&gt;-->
<!-- <meta-data-->
<!-- android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"-->
<!-- android:value="true"/>-->
<!-- </activity>-->
<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
android:hardwareAccelerated="true"
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion flutter_inappwebview/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_inappwebview
description: A Flutter plugin that allows you to add an inline webview, to use an headless webview, and to open an in-app browser window.
version: 6.0.0
version: 6.0.0+1
homepage: https://inappwebview.dev/
repository: https://github.com/pichillilorenzo/flutter_inappwebview
issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
import io.flutter.embedding.engine.plugins.activity.ActivityAware;
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugin.platform.PlatformViewRegistry;
import io.flutter.view.FlutterView;
import io.flutter.embedding.android.FlutterView;

public class InAppWebViewFlutterPlugin implements FlutterPlugin, ActivityAware {

Expand Down Expand Up @@ -64,7 +63,6 @@ public class InAppWebViewFlutterPlugin implements FlutterPlugin, ActivityAware {
public ProcessGlobalConfigManager processGlobalConfigManager;
public FlutterWebViewFactory flutterWebViewFactory;
public Context applicationContext;
public PluginRegistry.Registrar registrar;
public BinaryMessenger messenger;
public FlutterPlugin.FlutterAssets flutterAssets;
@Nullable
Expand All @@ -76,14 +74,6 @@ public class InAppWebViewFlutterPlugin implements FlutterPlugin, ActivityAware {

public InAppWebViewFlutterPlugin() {}

@SuppressWarnings("deprecation")
public static void registerWith(PluginRegistry.Registrar registrar) {
final InAppWebViewFlutterPlugin instance = new InAppWebViewFlutterPlugin();
instance.registrar = registrar;
instance.onAttachedToEngine(
registrar.context(), registrar.messenger(), registrar.activity(), registrar.platformViewRegistry(), registrar.view());
}

@Override
public void onAttachedToEngine(FlutterPluginBinding binding) {
this.flutterAssets = binding.getFlutterAssets();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class Util {
private Util() {}

public static String getUrlAsset(InAppWebViewFlutterPlugin plugin, String assetFilePath) throws IOException {
String key = (plugin.registrar != null) ? plugin.registrar.lookupKeyForAsset(assetFilePath) : plugin.flutterAssets.getAssetFilePathByName(assetFilePath);
String key = plugin.flutterAssets.getAssetFilePathByName(assetFilePath);
InputStream is = null;
IOException e = null;

Expand All @@ -91,7 +91,7 @@ public static String getUrlAsset(InAppWebViewFlutterPlugin plugin, String assetF
}

public static InputStream getFileAsset(InAppWebViewFlutterPlugin plugin, String assetFilePath) throws IOException {
String key = (plugin.registrar != null) ? plugin.registrar.lookupKeyForAsset(assetFilePath) : plugin.flutterAssets.getAssetFilePathByName(assetFilePath);
String key = plugin.flutterAssets.getAssetFilePathByName(assetFilePath);
AssetManager mg = plugin.applicationContext.getResources().getAssets();
return mg.open(key);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ public InAppWebViewChromeClient(@NonNull final InAppWebViewFlutterPlugin plugin,
this.inAppBrowserDelegate.getActivityResultListeners().add(this);
}

if (plugin.registrar != null)
plugin.registrar.addActivityResultListener(this);
else if (plugin.activityPluginBinding != null)
if (plugin.activityPluginBinding != null)
plugin.activityPluginBinding.addActivityResultListener(this);
}

Expand Down

0 comments on commit 2cf712c

Please sign in to comment.