Update workmanager and migrate to Flutter embedding v2
This commit is contained in:
		| @@ -17,11 +17,14 @@ | ||||
|          additional functionality it is fine to subclass or reimplement | ||||
|          FlutterApplication and put your custom class here. --> | ||||
|     <application | ||||
|         android:name=".Application" | ||||
|         android:label="HA Client" | ||||
|         android:icon="@mipmap/ic_launcher" | ||||
|         android:usesCleartextTraffic="true"> | ||||
|  | ||||
|         <meta-data | ||||
|             android:name="flutterEmbedding" | ||||
|             android:value="2" /> | ||||
|  | ||||
|         <meta-data | ||||
|             android:name="com.google.firebase.messaging.default_notification_channel_id" | ||||
|             android:value="ha_notify" /> | ||||
| @@ -33,13 +36,12 @@ | ||||
|             android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density" | ||||
|             android:hardwareAccelerated="true" | ||||
|             android:windowSoftInputMode="adjustResize"> | ||||
|             <!-- 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). | ||||
|             <meta-data | ||||
|                 android:name="io.flutter.app.android.SplashScreenUntilFirstFrame" | ||||
|                 android:value="true" />--> | ||||
|                 android:name="io.flutter.embedding.android.SplashScreenDrawable" | ||||
|                 android:resource="@drawable/launch_background" /> | ||||
|             <meta-data | ||||
|                 android:name="io.flutter.embedding.android.NormalTheme" | ||||
|                 android:resource="@style/NormalTheme" /> | ||||
|             <intent-filter> | ||||
|                 <action android:name="FLUTTER_NOTIFICATION_CLICK" /> | ||||
|                 <category android:name="android.intent.category.DEFAULT" /> | ||||
|   | ||||
| @@ -1,20 +0,0 @@ | ||||
| package com.keyboardcrumbs.hassclient; | ||||
|  | ||||
| import io.flutter.app.FlutterApplication; | ||||
| import io.flutter.plugin.common.PluginRegistry; | ||||
| import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback; | ||||
| import io.flutter.plugins.GeneratedPluginRegistrant; | ||||
| import be.tramckrijte.workmanager.WorkmanagerPlugin; | ||||
|  | ||||
| public class Application extends FlutterApplication implements PluginRegistrantCallback { | ||||
|     @Override | ||||
|     public void onCreate() { | ||||
|         super.onCreate(); | ||||
|         WorkmanagerPlugin.setPluginRegistrantCallback(this); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void registerWith(PluginRegistry registry) { | ||||
|         GeneratedPluginRegistrant.registerWith(registry); | ||||
|     } | ||||
| } | ||||
| @@ -1,14 +1,15 @@ | ||||
| package com.keyboardcrumbs.hassclient; | ||||
|  | ||||
| import android.os.Bundle; | ||||
| import io.flutter.app.FlutterActivity; | ||||
| import androidx.annotation.NonNull; | ||||
| import io.flutter.embedding.android.FlutterActivity; | ||||
| import io.flutter.embedding.engine.FlutterEngine; | ||||
| import io.flutter.plugins.GeneratedPluginRegistrant; | ||||
|  | ||||
| public class MainActivity extends FlutterActivity { | ||||
|    | ||||
|   @Override | ||||
|   protected void onCreate(Bundle savedInstanceState) { | ||||
|     super.onCreate(savedInstanceState); | ||||
|     GeneratedPluginRegistrant.registerWith(this); | ||||
|   } | ||||
|     @Override | ||||
|     public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { | ||||
|         GeneratedPluginRegistrant.registerWith(flutterEngine); | ||||
|     } | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -5,4 +5,7 @@ | ||||
|              Flutter draws its first frame --> | ||||
|         <item name="android:windowBackground">@drawable/launch_background</item> | ||||
|     </style> | ||||
|     <style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar"> | ||||
|         <item name="android:windowBackground">@drawable/launch_background</item> | ||||
|     </style> | ||||
| </resources> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user