From e56fe114c6ed01ba25b208b957053d2e49ccd91a Mon Sep 17 00:00:00 2001 From: Fahim Salam Chowdhury Date: Thu, 12 May 2022 11:28:48 +0600 Subject: [PATCH 1/2] 5352-Conversation_part_disappear_on_conversation_list_issue issue: https://gitlab.e.foundation/e/backlog/-/issues/5352 dependency update causes the part disappear without reason. Most probably it is bug in latest android library. This commit revert back the build dependencies same as upstream/master. --- .gitlab-ci.yml | 2 +- build.gradle | 11 +++++------ data/build.gradle | 4 ---- domain/build.gradle | 12 +----------- gradle/wrapper/gradle-wrapper.properties | 2 +- presentation/build.gradle | 12 ++++++------ .../com/moez/QKSMS/common/widget/TightTextView.kt | 2 +- .../com/moez/QKSMS/feature/backup/BackupPresenter.kt | 2 +- 8 files changed, 16 insertions(+), 31 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 07fb3f72c..6efec05db 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: "registry.gitlab.e.foundation/e/os/docker-android-apps-cicd:latest" +image: "registry.gitlab.e.foundation/e/os/docker-android-apps-cicd:legacy" stages: - update-from-upstream diff --git a/build.gradle b/build.gradle index 06b2a41a8..14c9f3d2e 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ buildscript { ext.androidx_appcompat_version = '1.1.0' ext.androidx_constraintlayout_version = '1.1.3' - ext.androidx_core_version = '1.2.0' + ext.androidx_core_version = '1.1.0' ext.androidx_emoji_version = '1.0.0' ext.androidx_exifinterface_version = '1.0.0' ext.androidx_testrunner_version = '1.1.0-alpha3' @@ -17,13 +17,13 @@ buildscript { ext.exoplayer_version = "2.8.1" ext.glide_version = "4.8.0" ext.junit_version = '4.12' - ext.kotlin_version = '1.5.31' + ext.kotlin_version = '1.3.60' ext.lifecycle_version = '2.1.0' ext.material_version = '1.0.0' ext.mockito_version = '2.18.3' ext.moshi_version = '1.8.0' ext.okhttp3_version = '4.1.0' - ext.realm_version = '6.0.2'//'5.8.0' + ext.realm_version = '5.8.0' ext.realm_adapters_version = '3.1.0' ext.rxandroid_version = '2.0.1' ext.rxdogtag_version = '0.2.0' @@ -42,12 +42,11 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.1.1' + classpath 'com.android.tools.build:gradle:3.5.4' + classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1' classpath 'com.google.gms:google-services:4.2.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "io.realm:realm-gradle-plugin:$realm_version" - classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.2' - } } diff --git a/data/build.gradle b/data/build.gradle index 7f75289f4..d61add8e7 100644 --- a/data/build.gradle +++ b/data/build.gradle @@ -42,10 +42,6 @@ android { withAnalytics { dimension "analytics" } noAnalytics { dimension "analytics" } } - - kotlinOptions { - jvmTarget = "11" - } } dependencies { diff --git a/domain/build.gradle b/domain/build.gradle index e7f4a6d13..85a69fd8d 100644 --- a/domain/build.gradle +++ b/domain/build.gradle @@ -23,7 +23,7 @@ apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' android { - compileSdkVersion 30 + compileSdkVersion 29 compileOptions { sourceCompatibility 1.8 @@ -34,16 +34,6 @@ android { minSdkVersion 21 targetSdkVersion 29 } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() - } - } dependencies { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f60099fbc..024d97ff6 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Thu Mar 17 12:40:57 IST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/presentation/build.gradle b/presentation/build.gradle index 569fa6c4a..ab4665692 100644 --- a/presentation/build.gradle +++ b/presentation/build.gradle @@ -23,13 +23,14 @@ apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' android { - compileSdkVersion 31 + compileSdkVersion 29 + buildToolsVersion "29.0.3" flavorDimensions "analytics" defaultConfig { applicationId "foundation.e.message" minSdkVersion 21 - targetSdkVersion 30 + targetSdkVersion 29 versionCode 2218 versionName "3.9.4" setProperty("archivesBaseName", "QKSMS-v${versionName}") @@ -63,12 +64,12 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility 1.8 + targetCompatibility 1.8 } // For Kotlin projects kotlinOptions { - jvmTarget = "11" + jvmTarget = "1.8" } lintOptions { @@ -170,7 +171,6 @@ dependencies { kapt "io.realm:realm-annotations:$realm_version" kapt "io.realm:realm-annotations-processor:$realm_version" - // rxjava implementation "io.reactivex.rxjava2:rxandroid:$rxandroid_version" implementation "io.reactivex.rxjava2:rxjava:$rxjava_version" diff --git a/presentation/src/main/java/com/moez/QKSMS/common/widget/TightTextView.kt b/presentation/src/main/java/com/moez/QKSMS/common/widget/TightTextView.kt index ce86aef7a..0c104b81c 100644 --- a/presentation/src/main/java/com/moez/QKSMS/common/widget/TightTextView.kt +++ b/presentation/src/main/java/com/moez/QKSMS/common/widget/TightTextView.kt @@ -37,7 +37,7 @@ class TightTextView @JvmOverloads constructor( val maxLineWidth = (0 until layout.lineCount) .map(layout::getLineWidth) - .maxOrNull() ?: 0f + .max() ?: 0f val width = Math.ceil(maxLineWidth.toDouble()).toInt() + compoundPaddingLeft + compoundPaddingRight if (width < measuredWidth) { diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/backup/BackupPresenter.kt b/presentation/src/main/java/com/moez/QKSMS/feature/backup/BackupPresenter.kt index ae2ee694e..09f5aa162 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/backup/BackupPresenter.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/backup/BackupPresenter.kt @@ -64,7 +64,7 @@ class BackupPresenter @Inject constructor( .distinctUntilChanged() .switchMap { backupRepo.getBackups() } .doOnNext { backups -> newState { copy(backups = backups) } } - .map { backups -> backups.map { it.date }.maxOrNull() ?: 0L } + .map { backups -> backups.map { it.date }.max() ?: 0L } .map { lastBackup -> when (lastBackup) { 0L -> context.getString(R.string.backup_never) -- GitLab From 31ff353b417325a975e3e7366022935a6bff6b32 Mon Sep 17 00:00:00 2001 From: Fahim Salam Chowdhury Date: Thu, 12 May 2022 13:51:45 +0600 Subject: [PATCH 2/2] Add missing onRestoreInstanceState override on ComposeActivity issue: https://gitlab.e.foundation/e/backlog/-/issues/5352 In commit 73a0137d96a0c14e6fce4daf769b93b652db3745, to resolve merge conflict, `onRestoreInstanceState` code commented out, which was introduced in 8e4ff3ec8d7121a56016d2354137242371932950 commit by upstream maintainer. As it can introduce bug which is not present in upstream & as we don't modified anything which this code do, we need to revert back to upstream change. --- .../java/com/moez/QKSMS/feature/compose/ComposeActivity.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt b/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt index 11d41b51e..058898b8d 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt @@ -392,6 +392,11 @@ class ComposeActivity : QkThemedActivity(), ComposeView { super.onSaveInstanceState(outState) } + override fun onRestoreInstanceState(savedInstanceState: Bundle?) { + cameraDestination = savedInstanceState?.getParcelable(CameraDestinationKey) + super.onRestoreInstanceState(savedInstanceState) + } + override fun onBackPressed() = backPressedIntent.onNext(Unit) } \ No newline at end of file -- GitLab