Android 12 support

This commit is contained in:
Carlos Erazo 2022-03-07 18:16:25 +01:00
parent f06bcdf695
commit 6fcf757df6
3 changed files with 10 additions and 2 deletions

View File

@ -4,10 +4,12 @@
<application> <application>
<activity <activity
android:theme="@style/AppTheme" android:theme="@style/AppTheme"
android:exported="true"
android:name="com.pichillilorenzo.flutter_inappwebview.in_app_browser.InAppBrowserActivity" android:name="com.pichillilorenzo.flutter_inappwebview.in_app_browser.InAppBrowserActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density" /> android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density" />
<activity <activity
android:theme="@style/ThemeTransparent" android:theme="@style/ThemeTransparent"
android:exported="false"
android:name="com.pichillilorenzo.flutter_inappwebview.chrome_custom_tabs.ChromeCustomTabsActivity" /> android:name="com.pichillilorenzo.flutter_inappwebview.chrome_custom_tabs.ChromeCustomTabsActivity" />
<receiver android:name="com.pichillilorenzo.flutter_inappwebview.chrome_custom_tabs.ActionBroadcastReceiver" /> <receiver android:name="com.pichillilorenzo.flutter_inappwebview.chrome_custom_tabs.ActionBroadcastReceiver" />
<meta-data <meta-data

View File

@ -207,9 +207,14 @@ public class ChromeCustomTabsActivity extends Activity implements MethodChannel.
extras.putString(ActionBroadcastReceiver.CHROME_MANAGER_ID, manager.id); extras.putString(ActionBroadcastReceiver.CHROME_MANAGER_ID, manager.id);
actionIntent.putExtras(extras); actionIntent.putExtras(extras);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
return PendingIntent.getBroadcast(
this, actionSourceId, actionIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
} else {
return PendingIntent.getBroadcast( return PendingIntent.getBroadcast(
this, actionSourceId, actionIntent, PendingIntent.FLAG_UPDATE_CURRENT); this, actionSourceId, actionIntent, PendingIntent.FLAG_UPDATE_CURRENT);
} }
}
public void dispose() { public void dispose() {
channel.setMethodCallHandler(null); channel.setMethodCallHandler(null);

View File

@ -56,6 +56,7 @@
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
android:launchMode="singleTop" android:launchMode="singleTop"
android:exported="false"
android:name="io.flutter.embedding.android.FlutterActivity" android:name="io.flutter.embedding.android.FlutterActivity"
android:theme="@style/LaunchTheme" android:theme="@style/LaunchTheme"
android:windowSoftInputMode="adjustResize"> android:windowSoftInputMode="adjustResize">