Skip to content

Commit e98a67e

Browse files
committed
⬆️ Upgrading pre 1.12 Android project …
more info at:- https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
1 parent c240ffe commit e98a67e

File tree

10 files changed

+363
-125
lines changed

10 files changed

+363
-125
lines changed

.vscode/launch.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Dart",
9+
"type": "dart",
10+
"request": "launch",
11+
"program": "lib/main.dart"
12+
},
13+
]
14+
}

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ apply plugin: 'com.android.application'
2525
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2626

2727
android {
28-
compileSdkVersion 28
28+
compileSdkVersion 29
2929

3030
lintOptions {
3131
disable 'InvalidPackage'
@@ -35,7 +35,7 @@ android {
3535
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
3636
applicationId "com.thealphamerc.flutter_twitter_clone"
3737
minSdkVersion 16
38-
targetSdkVersion 28
38+
targetSdkVersion 29
3939
versionCode flutterVersionCode.toInteger()
4040
versionName flutterVersionName
4141
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

android/app/src/main/AndroidManifest.xml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,43 @@
77
additional functionality it is fine to subclass or reimplement
88
FlutterApplication and put your custom class here. -->
99
<uses-permission android:name="android.permission.INTERNET"/>
10-
<application
10+
<application
1111
android:name="io.flutter.app.FlutterApplication"
1212
android:label="Fwitter"
1313
android:icon="@mipmap/ic_launcher">
1414
<activity
1515
android:name=".MainActivity"
1616
android:launchMode="singleTop"
1717
android:theme="@style/LaunchTheme"
18-
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
18+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1919
android:hardwareAccelerated="true"
2020
android:windowSoftInputMode="adjustResize">
21-
<!-- This keeps the window background of the activity showing
22-
until Flutter renders its first frame. It can be removed if
23-
there is no splash screen (such as the default splash screen
24-
defined in @style/LaunchTheme). -->
21+
<!-- Specifies an Android theme to apply to this Activity as soon as
22+
the Android process has started. This theme is visible to the user
23+
while the Flutter UI initializes. After that, this theme continues
24+
to determine the Window background behind the Flutter UI. -->
2525
<meta-data
26-
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
27-
android:value="true" />
26+
android:name="io.flutter.embedding.android.NormalTheme"
27+
android:resource="@style/NormalTheme"
28+
/>
29+
<!-- Displays an Android View that continues showing the launch screen
30+
Drawable until Flutter paints its first frame, then this splash
31+
screen fades out. A splash screen is useful to avoid any visual
32+
gap between the end of Android's launch screen and the painting of
33+
Flutter's first frame. -->
34+
<meta-data
35+
android:name="io.flutter.embedding.android.SplashScreenDrawable"
36+
android:resource="@drawable/launch_background"
37+
/>
2838
<intent-filter>
2939
<action android:name="android.intent.action.MAIN"/>
3040
<category android:name="android.intent.category.LAUNCHER"/>
31-
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
32-
<category android:name="android.intent.category.DEFAULT" />
3341
</intent-filter>
3442
</activity>
35-
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
43+
<!-- Don't delete the meta-data below.
44+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
45+
<meta-data
46+
android:name="flutterEmbedding"
47+
android:value="2" />
3648
</application>
3749
</manifest>
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
package com.thealphamerc.flutter_twitter_clone;
22

3-
import android.os.Bundle;
4-
import io.flutter.app.FlutterActivity;
5-
import io.flutter.plugins.GeneratedPluginRegistrant;
3+
import io.flutter.embedding.android.FlutterActivity;
64

75
public class MainActivity extends FlutterActivity {
8-
@Override
9-
protected void onCreate(Bundle savedInstanceState) {
10-
super.onCreate(savedInstanceState);
11-
GeneratedPluginRegistrant.registerWith(this);
12-
}
136
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3+
<!-- Theme applied to the Android Window while the process is starting -->
34
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
45
<!-- Show a splash screen on the activity. Automatically removed when
56
Flutter draws its first frame -->
67
<item name="android:windowBackground">@drawable/launch_background</item>
78
</style>
9+
<!-- Theme applied to the Android Window as soon as the process has started.
10+
This theme determines the color of the Android Window while your
11+
Flutter UI initializes, as well as behind your Flutter UI while its
12+
running.
13+
14+
This Theme is only used starting with V2 of Flutter's Android embedding. -->
15+
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
16+
<item name="android:windowBackground">@android:color/white</item>
17+
</style>
818
</resources>

android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ buildscript {
55
}
66

77
dependencies {
8-
classpath 'com.android.tools.build:gradle:3.3.0'
9-
classpath 'com.google.gms:google-services:4.3.0'
8+
classpath 'com.android.tools.build:gradle:3.5.0'
9+
classpath 'com.google.gms:google-services:4.3.4'
1010
}
1111
}
1212

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip

android/settings_aar.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include ':app'

0 commit comments

Comments
 (0)