From 4b14151f8b840ca4da127e87be832351bc547d85 Mon Sep 17 00:00:00 2001 From: Ezerous Date: Mon, 20 Jul 2020 14:16:35 +0300 Subject: [PATCH] Small BaseApp & gradle fixes --- .gitignore | 1 + app/build.gradle | 13 +++++++------ app/src/main/AndroidManifest.xml | 1 + .../java/gr/thmmy/mthmmy/base/BaseApplication.java | 12 ++++++++++-- build.gradle | 2 +- emojis/build.gradle | 9 +-------- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 7 files changed, 23 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 3f32039e..8b2da229 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ bin/ gen/ out/ output.json +output-metadata.json # Gradle files .gradle/ diff --git a/app/build.gradle b/app/build.gradle index 62af4345..603d2651 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,7 +11,7 @@ android { buildToolsVersion = '29.0.3' defaultConfig { - vectorDrawables.useSupportLibrary = true + vectorDrawables.useSupportLibrary = true //TODO: Remove when minSdkVersion >= 21 applicationId "gr.thmmy.mthmmy" minSdkVersion 19 targetSdkVersion 29 @@ -25,13 +25,14 @@ android { buildTypes { release { + multiDexEnabled true //TODO: Remove when minSdkVersion >= 21 minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' multiDexKeepProguard file('proguard-rules.pro') //TODO: Remove when minSdkVersion >= 21 } debug { - multiDexEnabled true + multiDexEnabled true //TODO: Remove when minSdkVersion >= 21 def date = new Date().format('ddMMyy_HHmmss') archivesBaseName = archivesBaseName + "-$date" firebaseCrashlytics { @@ -77,7 +78,7 @@ tasks.whenTaskAdded { task -> dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation project(":emojis") - implementation 'androidx.appcompat:appcompat:1.2.0-rc01' + implementation 'androidx.appcompat:appcompat:1.3.0-alpha01' implementation 'androidx.preference:preference:1.1.1' implementation 'androidx.legacy:legacy-preference-v14:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0' @@ -88,9 +89,9 @@ dependencies { implementation 'androidx.exifinterface:exifinterface:1.2.0' implementation 'androidx.multidex:multidex:2.0.1' //TODO: Remove when minSdkVersion >= 21 implementation 'com.google.android.material:material:1.1.0' - implementation 'com.google.firebase:firebase-analytics:17.4.3' - implementation 'com.google.firebase:firebase-crashlytics:17.0.1' - implementation 'com.google.firebase:firebase-messaging:20.2.0' + implementation 'com.google.firebase:firebase-analytics:17.4.4' + implementation 'com.google.firebase:firebase-crashlytics:17.1.1' + implementation 'com.google.firebase:firebase-messaging:20.2.3' implementation 'com.snatik:storage:2.1.0' implementation ('com.squareup.okhttp3:okhttp:3.12.12') { //TODO: Warning: OkHttp has dropped support for Android 19 since OkHttp 3.13! force = true //TODO: Remove when minSdkVersion >= 21 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index fa42ba6b..7c7ab811 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -7,6 +7,7 @@ + diff --git a/app/src/main/java/gr/thmmy/mthmmy/base/BaseApplication.java b/app/src/main/java/gr/thmmy/mthmmy/base/BaseApplication.java index 131ae24b..feed7496 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/base/BaseApplication.java +++ b/app/src/main/java/gr/thmmy/mthmmy/base/BaseApplication.java @@ -179,8 +179,16 @@ public class BaseApplication extends MultiDexApplication { @Override public Drawable placeholder(Context ctx, String tag) { - if (DrawerImageLoader.Tags.PROFILE.name().equals(tag)) - return BaseApplication.getInstance().getResources().getDrawable(R.drawable.ic_default_user_avatar); + if (DrawerImageLoader.Tags.PROFILE.name().equals(tag)){ + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) + return ContextCompat.getDrawable(BaseApplication.getInstance(), R.drawable.ic_default_user_avatar); + else { // Just for KitKats + return new IconicsDrawable(ctx).icon(FontAwesome.Icon.faw_user) + .paddingDp(10) + .color(ContextCompat.getColor(ctx, R.color.iron)) + .backgroundColor(ContextCompat.getColor(ctx, R.color.primary_lighter)); + } + } return super.placeholder(ctx, tag); } }); diff --git a/build.gradle b/build.gradle index d966ef2f..72da44f0 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ buildscript { maven { url "https://jitpack.io" } } dependencies { - classpath 'com.android.tools.build:gradle:3.6.3' + classpath 'com.android.tools.build:gradle:4.0.1' classpath 'com.google.gms:google-services:4.3.3' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.1' classpath 'org.ajoberstar.grgit:grgit-core:3.1.1' // Also change in app/gradle/grgit.gradle diff --git a/emojis/build.gradle b/emojis/build.gradle index 6aef90cf..46608744 100644 --- a/emojis/build.gradle +++ b/emojis/build.gradle @@ -4,7 +4,6 @@ android { compileSdkVersion 29 buildToolsVersion "29.0.3" - defaultConfig { minSdkVersion 19 targetSdkVersion 29 @@ -20,10 +19,4 @@ android { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } - -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.1.0' -} +} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 669ee9b7..0e03b907 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sat May 09 21:06:12 EEST 2020 +#Mon Jul 20 13:59:13 EEST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip