From b6d625a1fc50f819a06d6756787109ffa777d92d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Sun, 21 Mar 2021 21:01:28 +0100 Subject: [PATCH] [Gradle] Update most libraries. Rearrange dependencies. --- app/build.gradle | 216 +++++++----------- .../ui/dialogs/RegisterUnavailableDialog.kt | 2 +- .../edziennik/ui/dialogs/day/DayDialog.kt | 6 +- .../ui/dialogs/event/EventManualDialog.kt | 2 +- .../ui/modules/feedback/FeedbackFragment.kt | 20 +- .../home/cards/HomeAvailabilityCard.kt | 2 +- .../ui/modules/login/LoginPrizeFragment.kt | 2 +- .../login/viewholder/PlatformViewHolder.kt | 2 +- build.gradle | 50 +--- 9 files changed, 103 insertions(+), 199 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 47d1b31b..466d538a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,21 +1,21 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-android-extensions' apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.firebase.crashlytics' android { - signingConfigs { - } compileSdkVersion setup.compileSdk + defaultConfig { applicationId 'pl.szczodrzynski.edziennik' minSdkVersion setup.minSdk targetSdkVersion setup.targetSdk + versionCode release.versionCode versionName release.versionName - multiDexEnabled true + + multiDexEnabled = true externalNativeBuild { cmake { @@ -28,41 +28,35 @@ android { variant.outputs.all { if (variant.buildType.name == "release") { outputFileName = "Edziennik_" + defaultConfig.versionName + ".apk" - } else if (variant.buildType.name == "debugMinify") { - outputFileName = "Edziennik_" + defaultConfig.versionName + "_debugMinify.apk" } else { outputFileName = "Edziennik_" + defaultConfig.versionName + "_debug.apk" } } } debug { - minifyEnabled false + minifyEnabled = false } release { - minifyEnabled true - shrinkResources true + minifyEnabled = true + shrinkResources = true proguardFiles getDefaultProguardFile('proguard-android.txt') proguardFiles fileTree('proguard').asList().toArray() } } - dependencies { - implementation "com.google.firebase:firebase-core:${versions.firebase}" - } defaultConfig { vectorDrawables.useSupportLibrary = true } lintOptions { - checkReleaseBuilds false + checkReleaseBuilds = false } buildFeatures { dataBinding = true + viewBinding = true } compileOptions { - coreLibraryDesugaringEnabled true - sourceCompatibility '1.8' - targetCompatibility '1.8' - } - productFlavors { + coreLibraryDesugaringEnabled = true + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = "1.8" @@ -76,137 +70,97 @@ android { version "3.10.2" } } - ndkVersion '21.3.6528147' } -/*task finalizeBundleDebug(type: Copy) { - from("debug/debug") - include "app.aab" - destinationDir file("debug/debug") - rename "app.aab", "Edziennik_debug.aab" -} - -// it finalizes :bundleRelease -task finalizeBundleRelease(type: Copy) { - from("release/release") - include "app.aab" - destinationDir file("release/release") - rename "app.aab", "Edziennik_${android.defaultConfig.versionCode}.aab" -}*/ -/* -// this adds the above two tasks -tasks.whenTaskAdded { task -> - if (task.name == "bundleDebug") { - task.finalizedBy finalizeBundleDebug - } else if (task.name == "bundleRelease") { - task.finalizedBy finalizeBundleRelease - } -}*/ - dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.1' + // Language cores + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5" - kapt "androidx.room:room-compiler:${versions.room}" - debugImplementation "com.amitshekhar.android:debug-db:1.0.5" + // Android Jetpack + implementation "androidx.appcompat:appcompat:1.2.0" + implementation "androidx.cardview:cardview:1.0.0" + implementation "androidx.constraintlayout:constraintlayout:2.0.4" + implementation "androidx.core:core-ktx:1.3.2" + implementation "androidx.gridlayout:gridlayout:1.0.0" + implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.0" + implementation "androidx.navigation:navigation-fragment-ktx:2.3.4" + implementation "androidx.recyclerview:recyclerview:1.1.0" + implementation "androidx.room:room-runtime:2.2.6" + implementation "androidx.work:work-runtime-ktx:2.5.0" + kapt "androidx.room:room-compiler:2.2.6" - implementation "android.arch.navigation:navigation-fragment-ktx:${versions.navigationFragment}" - implementation "androidx.appcompat:appcompat:${versions.appcompat}" - implementation "androidx.cardview:cardview:${versions.cardView}" - implementation "androidx.constraintlayout:constraintlayout:${versions.constraintLayout}" - implementation "androidx.core:core-ktx:${versions.ktx}" - implementation "androidx.gridlayout:gridlayout:${versions.gridLayout}" - implementation "androidx.legacy:legacy-support-v4:${versions.legacy}" - implementation "androidx.lifecycle:lifecycle-livedata-ktx:${versions.lifecycle}" - implementation "androidx.recyclerview:recyclerview:${versions.recyclerView}" - implementation "androidx.room:room-runtime:${versions.room}" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${versions.kotlin}" + // Google design libs + implementation "com.google.android.material:material:1.3.0" + implementation "com.google.android:flexbox:2.0.1" - implementation "com.google.android.gms:play-services-wearable:${versions.play_services}" - implementation "com.google.android.material:material:${versions.material}" - implementation "com.google.firebase:firebase-messaging:${versions.firebasemessaging}" + // Play Services/Firebase + implementation "com.google.android.gms:play-services-wearable:17.0.0" + implementation "com.google.firebase:firebase-core:18.0.2" + implementation "com.google.firebase:firebase-crashlytics:17.4.0" + implementation "com.google.firebase:firebase-messaging:20.1.3" - implementation "pl.szczodrzynski:NavLib:v0.7.0" - implementation "com.mikepenz:iconics-views:${versions.iconics}" - implementation "com.mikepenz:community-material-typeface:${versions.font_cmd}@aar" - - implementation "com.afollestad.material-dialogs:commons:${versions.materialdialogs}" - implementation "com.afollestad.material-dialogs:core:${versions.materialdialogs}" - - implementation "cat.ereza:customactivityoncrash:2.2.0" - implementation "com.applandeo:material-calendar-view:1.5.0" - implementation 'com.google.firebase:firebase-crashlytics:17.3.1' - implementation "com.daimajia.swipelayout:library:1.2.0@aar" - implementation "com.evernote:android-job:1.2.6" - implementation "com.github.antonKozyriatskyi:CircularProgressIndicator:1.2.2" - implementation "com.github.bassaer:chatmessageview:2.0.1" - implementation("com.github.ozodrukh:CircularReveal:2.0.1@aar") {transitive = true} - implementation "com.heinrichreimersoftware:material-intro:1.5.8" // do not update - implementation "com.jaredrummler:colorpicker:1.0.2" - implementation("com.squareup.okhttp3:okhttp") { - version { - strictly "3.12.13" - } - } - implementation "com.theartofdev.edmodo:android-image-cropper:2.8.0" // do not update - implementation "com.wdullaer:materialdatetimepicker:4.1.2" - implementation "com.yuyh.json:jsonviewer:1.0.6" - implementation "me.dm7.barcodescanner:zxing:1.9.8" - implementation "me.grantland:autofittextview:0.2.1" - implementation "me.leolin:ShortcutBadger:1.1.22@aar" - implementation "org.greenrobot:eventbus:3.1.1" - implementation "org.jsoup:jsoup:1.12.1" - implementation "pl.droidsonroids.gif:android-gif-drawable:1.2.15" - implementation "uk.co.samuelwall:material-tap-target-prompt:2.14.0" + // OkHttp, Retrofit, Gson, Jsoup + implementation("com.squareup.okhttp3:okhttp") { version { strictly "3.12.13" } } + implementation "com.squareup.retrofit2:retrofit:2.9.0" + implementation "com.squareup.retrofit2:converter-gson:2.9.0" + implementation "com.squareup.retrofit2:converter-scalars:2.9.0" + implementation 'com.google.code.gson:gson:2.8.6' + implementation "org.jsoup:jsoup:1.13.1" + implementation "pl.droidsonroids:jspoon:1.3.2" + implementation "pl.droidsonroids.retrofit2:converter-jspoon:1.3.2" + // Szkolny.eu libraries/forks implementation "eu.szkolny:agendacalendarview:1799f8ef47" implementation "eu.szkolny:cafebar:5bf0c618de" implementation "eu.szkolny:material-about-library:0534abf316" implementation "eu.szkolny:mhttp:af4b62e6e9" implementation "eu.szkolny:nachos:0e5dfcaceb" - //implementation project(":Navigation") - implementation "eu.szkolny:szkolny-font:1dab7d64ed" implementation "eu.szkolny.selective-dao:annotation:27f8f3f194" + implementation "pl.szczodrzynski:NavLib:v0.7.0" + implementation "pl.szczodrzynski:NumberSlidingPicker:2921225f76" + implementation "pl.szczodrzynski:RecyclerTabLayout:700f980584" + implementation "pl.szczodrzynski:Tachyon:551943a6b5" + implementation "pl.szczodrzynski.FSLogin:lib:2.0.0" kapt "eu.szkolny.selective-dao:codegen:27f8f3f194" + // Iconics & related + implementation "com.mikepenz:iconics-core:5.2.8" + implementation "com.mikepenz:iconics-views:5.2.8" + implementation "com.mikepenz:community-material-typeface:3.5.95.1-kotlin@aar" + implementation "eu.szkolny:szkolny-font:1dab7d64ed" + + // Other dependencies + implementation "cat.ereza:customactivityoncrash:2.3.0" + implementation "com.afollestad.material-dialogs:commons:0.9.6.0" + implementation "com.afollestad.material-dialogs:core:0.9.6.0" + implementation "com.applandeo:material-calendar-view:1.5.0" + implementation "com.daimajia.swipelayout:library:1.2.0@aar" + implementation "com.evernote:android-job:1.4.2" + implementation "com.github.antonKozyriatskyi:CircularProgressIndicator:1.2.2" + implementation "com.github.bassaer:chatmessageview:2.0.1" implementation "com.github.ChuckerTeam.Chucker:library:3.0.1" - //releaseImplementation "com.github.ChuckerTeam.Chucker:library-no-op:3.0.1" + implementation "com.github.jetradarmobile:android-snowfall:1.2.0" + implementation "com.github.wulkanowy.uonet-request-signer:hebe-jvm:a99ca50a31" + implementation "com.heinrichreimersoftware:material-intro:1.5.8" // do not update + implementation "com.hypertrack:hyperlog:0.0.10" + implementation "com.jaredrummler:colorpicker:1.1.0" + implementation "com.qifan.powerpermission:powerpermission-coroutines:1.3.0" + implementation "com.qifan.powerpermission:powerpermission:1.3.0" + implementation "com.theartofdev.edmodo:android-image-cropper:2.8.0" // do not update + implementation "com.wdullaer:materialdatetimepicker:4.2.3" + implementation "com.yuyh.json:jsonviewer:1.0.6" + implementation "io.coil-kt:coil:1.1.1" + implementation "me.dm7.barcodescanner:zxing:1.9.8" + implementation "me.grantland:autofittextview:0.2.1" + implementation "me.leolin:ShortcutBadger:1.1.22@aar" + implementation "org.greenrobot:eventbus:3.2.0" + implementation "pl.droidsonroids.gif:android-gif-drawable:1.2.15" + implementation "uk.co.samuelwall:material-tap-target-prompt:2.14.0" + implementation("com.github.ozodrukh:CircularReveal:2.0.1@aar") {transitive = true} - //implementation 'com.github.wulkanowy:uonet-request-signer:master-SNAPSHOT' - //implementation 'com.github.kuba2k2.uonet-request-signer:android:master-63f094b14a-1' - - //implementation "org.redundent:kotlin-xml-builder:1.5.3" - - implementation 'com.github.wulkanowy.uonet-request-signer:hebe-jvm:a99ca50a31' - - implementation "androidx.work:work-runtime-ktx:${versions.work}" - - implementation 'com.hypertrack:hyperlog:0.0.10' - - implementation 'com.github.kuba2k2:RecyclerTabLayout:700f980584' - - implementation 'com.github.kuba2k2:Tachyon:551943a6b5' - - implementation "com.squareup.retrofit2:retrofit:${versions.retrofit}" - implementation "com.squareup.retrofit2:converter-gson:${versions.retrofit}" - - implementation 'com.github.jetradarmobile:android-snowfall:1.2.0' - - implementation "io.coil-kt:coil:0.9.2" - - implementation 'com.github.kuba2k2:NumberSlidingPicker:2921225f76' - - implementation 'com.google.android:flexbox:2.0.1' - - implementation 'com.qifan.powerpermission:powerpermission:1.3.0' - implementation 'com.qifan.powerpermission:powerpermission-coroutines:1.3.0' - - implementation 'com.github.kuba2k2.FSLogin:lib:2.0.0' - implementation 'pl.droidsonroids:jspoon:1.3.2' - implementation "com.squareup.retrofit2:converter-scalars:2.8.1" - implementation "pl.droidsonroids.retrofit2:converter-jspoon:1.3.2" -} -repositories { - mavenCentral() + // Debug-only dependencies + debugImplementation "com.amitshekhar.android:debug-db:1.0.5" } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/RegisterUnavailableDialog.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/RegisterUnavailableDialog.kt index 6ecd494f..b9e733b8 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/RegisterUnavailableDialog.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/RegisterUnavailableDialog.kt @@ -8,7 +8,7 @@ import android.text.method.LinkMovementMethod import android.view.LayoutInflater import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AppCompatActivity -import coil.api.load +import coil.load import com.google.android.material.dialog.MaterialAlertDialogBuilder import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/day/DayDialog.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/day/DayDialog.kt index c6a7b2f9..e5b7768d 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/day/DayDialog.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/day/DayDialog.kt @@ -10,8 +10,6 @@ import androidx.appcompat.app.AppCompatActivity import androidx.lifecycle.Observer import androidx.recyclerview.widget.LinearLayoutManager import com.google.android.material.dialog.MaterialAlertDialogBuilder -import kotlinx.android.synthetic.main.row_lesson_change_item.view.* -import kotlinx.android.synthetic.main.row_teacher_absence_item.view.* import kotlinx.coroutines.* import pl.szczodrzynski.edziennik.* import pl.szczodrzynski.edziennik.data.db.entity.Lesson @@ -111,7 +109,7 @@ class DayDialog( } lessonChanges.ifNotEmpty { - b.lessonChangeContainer.visibility = View.VISIBLE + b.lessonChangeContainer.root.visibility = View.VISIBLE b.lessonChangeContainer.lessonChangeCount.text = it.size.toString() b.lessonChangeLayout.onClick { @@ -130,7 +128,7 @@ class DayDialog( } teacherAbsences.ifNotEmpty { - b.teacherAbsenceContainer.visibility = View.VISIBLE + b.teacherAbsenceContainer.root.visibility = View.VISIBLE b.teacherAbsenceContainer.teacherAbsenceCount.text = it.size.toString() b.teacherAbsenceLayout.onClick { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventManualDialog.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventManualDialog.kt index 06b5f1a6..7240934b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventManualDialog.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventManualDialog.kt @@ -378,7 +378,7 @@ class EventManualDialog( customColor = color } }) - colorPickerDialog.show(activity.fragmentManager, "color-picker-dialog") + colorPickerDialog.show(activity.supportFragmentManager, "color-picker-dialog") } }} diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/feedback/FeedbackFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/feedback/FeedbackFragment.kt index 63f7500f..3c33be8d 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/feedback/FeedbackFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/feedback/FeedbackFragment.kt @@ -14,8 +14,8 @@ import android.widget.PopupMenu import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment -import coil.Coil -import coil.api.load +import coil.imageLoader +import coil.request.ImageRequest import com.github.bassaer.chatmessageview.model.IChatUser import com.github.bassaer.chatmessageview.model.Message import com.github.bassaer.chatmessageview.view.ChatView @@ -34,14 +34,6 @@ import pl.szczodrzynski.edziennik.onClick import pl.szczodrzynski.edziennik.utils.Utils import pl.szczodrzynski.edziennik.utils.Utils.openUrl import java.util.* -import kotlin.collections.List -import kotlin.collections.any -import kotlin.collections.filter -import kotlin.collections.firstOrNull -import kotlin.collections.forEach -import kotlin.collections.forEachIndexed -import kotlin.collections.isNotEmpty -import kotlin.collections.mutableMapOf import kotlin.collections.set import kotlin.coroutines.CoroutineContext @@ -221,13 +213,15 @@ class FeedbackFragment : Fragment(), CoroutineScope { Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888).also { bmp -> launch { Log.d(TAG, "Created image for $userName") - Coil.load(activity, image) { - target { + val request = ImageRequest.Builder(activity) + .data(image) + .target { val canvas = Canvas(bmp) it.setBounds(0, 0, bmp.width, bmp.height) it.draw(canvas) } - } + .build() + activity.imageLoader.enqueue(request) } } } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/cards/HomeAvailabilityCard.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/cards/HomeAvailabilityCard.kt index 957dff0c..fd54748e 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/cards/HomeAvailabilityCard.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/cards/HomeAvailabilityCard.kt @@ -12,7 +12,7 @@ import androidx.core.text.HtmlCompat import androidx.core.view.isVisible import androidx.core.view.plusAssign import androidx.core.view.setMargins -import coil.api.load +import coil.load import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginPrizeFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginPrizeFragment.kt index b9fdf43a..1c9634fc 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginPrizeFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginPrizeFragment.kt @@ -10,7 +10,7 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.fragment.app.Fragment -import coil.api.load +import coil.load import com.google.android.material.dialog.MaterialAlertDialogBuilder import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/viewholder/PlatformViewHolder.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/viewholder/PlatformViewHolder.kt index ea8a063d..2c08c27e 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/viewholder/PlatformViewHolder.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/viewholder/PlatformViewHolder.kt @@ -9,7 +9,7 @@ import android.view.ViewGroup import androidx.appcompat.app.AppCompatActivity import androidx.core.view.isVisible import androidx.recyclerview.widget.RecyclerView -import coil.api.load +import coil.load import pl.szczodrzynski.edziennik.App import pl.szczodrzynski.edziennik.databinding.LoginPlatformItemBinding import pl.szczodrzynski.edziennik.ui.modules.grades.viewholder.BindableViewHolder diff --git a/build.gradle b/build.gradle index fd64a16a..343e5fd5 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ buildscript { ext { - kotlin_version = '1.4.30' + kotlin_version = '1.4.31' release = [ versionName: "4.6.1", @@ -11,50 +11,9 @@ buildscript { setup = [ compileSdk: 30, - buildTools: "28.0.3", minSdk : 16, targetSdk : 30 ] - - versions = [ - gradleAndroid : '4.2.0-beta04', - - kotlin : ext.kotlin_version, - ktx : "1.3.2", - - androidX : '1.0.0', - annotation : '1.1.0', - recyclerView : '1.2.0-beta01', - material : '1.3.0', - appcompat : '1.3.0-beta01', - constraintLayout : '2.1.0-alpha2', - cardview : '1.0.0', - gridLayout : '1.0.0', - navigation : "2.0.0", - navigationFragment: "1.0.0", - legacy : "1.0.0", - - room : "2.2.6", - lifecycle : "2.3.0", - work : "2.5.0", - - firebase : '18.0.2', - firebasemessaging: "20.1.3", - play_services : "17.0.0", - - materialdialogs : "0.9.6.0", - materialdrawer : "817e45765c367034b03046aaea6e95eeabcb40e9", - iconics : "5.2.8", - font_cmd : "3.5.95.1-kotlin", - - navlib : "28cdab341470dffa5f331379fe9702482681d7de", - - gifdrawable : "1.2.15", - - retrofit : "2.6.4" - ] - versions.kotlin = '1.4.0' - versions.kotlin = '1.4.0' } repositories { @@ -62,11 +21,10 @@ buildscript { jcenter() } dependencies { - classpath "com.android.tools.build:gradle:${versions.gradleAndroid}" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}" - classpath 'me.tatarka:gradle-retrolambda:3.7.0' + classpath "com.android.tools.build:gradle:4.2.0-beta06" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.3.5' - classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.0' + classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.1' } }