From ac807ca0f3728573f3c9bc35d5c629dd1eb468d9 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Fri, 2 Oct 2020 15:57:24 +0200 Subject: [PATCH] Upgrade to flutter 1.22.0 The screenshots package had to have some override because of a dependency conflict. Also, while the splash screen still works, I'm not sure if I'm doing the right thing any more. --- android/app/src/main/AndroidManifest.xml | 25 +++---- .../gitjournal/gitjournal/MainActivity.java | 26 +++---- android/app/src/main/res/values/styles.xml | 5 +- pubspec.lock | 72 +++++++++---------- pubspec.yaml | 4 ++ 5 files changed, 67 insertions(+), 65 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 05127775..549ea852 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -5,13 +5,7 @@ - - + + + + android:name="io.flutter.embedding.android.SplashScreenDrawable" + android:resource="@drawable/launch_background" /> + + + + @@ -65,6 +65,7 @@ + diff --git a/android/app/src/main/java/io/gitjournal/gitjournal/MainActivity.java b/android/app/src/main/java/io/gitjournal/gitjournal/MainActivity.java index 49bb2bc2..a78ca336 100644 --- a/android/app/src/main/java/io/gitjournal/gitjournal/MainActivity.java +++ b/android/app/src/main/java/io/gitjournal/gitjournal/MainActivity.java @@ -2,7 +2,6 @@ package io.gitjournal.gitjournal; import androidx.annotation.NonNull; -import android.os.Bundle; import android.provider.Settings; import android.util.Log; import android.view.WindowManager; @@ -18,25 +17,22 @@ import io.flutter.plugin.common.MethodChannel.MethodCallHandler; import io.flutter.plugin.common.MethodChannel.Result; import io.flutter.plugins.GeneratedPluginRegistrant; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; +import io.flutter.embedding.android.FlutterActivity; +import io.flutter.embedding.engine.FlutterEngine; -public class MainActivity extends FlutterActivity implements MethodCallHandler { +public class MainActivity extends FlutterActivity { private static final String CHANNEL_NAME = "gitjournal.io/git"; static MethodChannel channel; @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - - channel = new MethodChannel(getFlutterView(), CHANNEL_NAME); - channel.setMethodCallHandler(this); - } - - @Override - public void onMethodCall(MethodCall call, Result result) { - result.notImplemented(); + public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { + GeneratedPluginRegistrant.registerWith(flutterEngine); + channel = new MethodChannel(flutterEngine.getDartExecutor().getBinaryMessenger(), CHANNEL_NAME); + channel.setMethodCallHandler( + (call, result) -> { + result.notImplemented(); + } + ); } @Override diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index 45d37f37..4470c25a 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -1,8 +1,9 @@ +