diff --git a/app/build.gradle b/app/build.gradle index 5ec831479..292b1b529 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -23,6 +23,10 @@ def crashlyticsEnabled() { return googleFile.exists() && linphoneLibrary.exists() && linphoneLibraryDebug.exists() } +if (firebaseEnabled()) { + apply plugin: 'com.google.gms.google-services' +} + if (crashlyticsEnabled()) { apply plugin: 'com.google.firebase.crashlytics' } @@ -94,14 +98,6 @@ android { applicationId getPackageName() } - // Required to be able to generate app bundle with native libraries symbols, see releaseAppBundle below - def ndkHome = System.getenv('ANDROID_NDK_HOME') - if (ndkHome == null || !new File(ndkHome + "/source.properties").exists()) { - ndkVersion "21.3.6528147" - } else { - ndkPath ndkHome - } - applicationVariants.all { variant -> variant.outputs.all { outputFileName = "linphone-android-${variant.buildType.name}-${project.version}.apk" @@ -152,16 +148,14 @@ android { resValue "bool", "crashlytics_enabled", "false" } - releaseAppBundle { + releaseWithCrashlytics { initWith release - ndk.debugSymbolLevel = 'FULL' if (crashlyticsEnabled()) { resValue "bool", "crashlytics_enabled", "true" firebaseCrashlytics { nativeSymbolUploadEnabled true - strippedNativeLibsDir file(LinphoneSdkBuildDir + '/libs/').toString() unstrippedNativeLibsDir file(LinphoneSdkBuildDir + '/libs-debug/').toString() } } else { @@ -188,7 +182,6 @@ android { firebaseCrashlytics { nativeSymbolUploadEnabled true - strippedNativeLibsDir file(LinphoneSdkBuildDir + '/libs/').toString() unstrippedNativeLibsDir file(LinphoneSdkBuildDir + '/libs-debug/').toString() } } else { @@ -235,23 +228,23 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.3.0' implementation 'androidx.media:media:1.2.0' - implementation 'androidx.fragment:fragment-ktx:1.4.0-alpha03' - implementation 'androidx.core:core-ktx:1.6.0-rc01' + implementation 'androidx.fragment:fragment-ktx:1.4.0-alpha04' + implementation 'androidx.core:core-ktx:1.6.0' def nav_version = "2.3.5" implementation "androidx.navigation:navigation-fragment-ktx:$nav_version" implementation "androidx.navigation:navigation-ui-ktx:$nav_version" - implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0-alpha02" - implementation "androidx.window:window:1.0.0-alpha08" + implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0-alpha03" + implementation "androidx.window:window:1.0.0-alpha09" implementation 'androidx.constraintlayout:constraintlayout:2.0.4' implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1' implementation 'androidx.recyclerview:recyclerview:1.1.0' - implementation "androidx.security:security-crypto:1.1.0-alpha03" + implementation "androidx.security:security-crypto-ktx:1.1.0-alpha03" - implementation 'com.google.android.material:material:1.3.0' + implementation 'com.google.android.material:material:1.4.0' implementation 'com.google.android:flexbox:2.0.0' implementation 'androidx.emoji:emoji:1.1.0' @@ -278,10 +271,6 @@ dependencies { //debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.4' } -if (firebaseEnabled()) { - apply plugin: 'com.google.gms.google-services' -} - task generateContactsXml(type: Copy) { from 'contacts.xml' into "src/main/res/xml/" @@ -307,7 +296,7 @@ if (crashlyticsEnabled()) { assembleDebug.finalizedBy(uploadCrashlyticsSymbolFileDebug) packageDebugBundle.finalizedBy(uploadCrashlyticsSymbolFileDebug) - assembleReleaseAppBundle.finalizedBy(uploadCrashlyticsSymbolFileReleaseAppBundle) - packageReleaseAppBundleBundle.finalizedBy(uploadCrashlyticsSymbolFileReleaseAppBundle) + assembleReleaseWithCrashlytics.finalizedBy(uploadCrashlyticsSymbolFileReleaseWithCrashlytics) + packageReleaseWithCrashlytics.finalizedBy(uploadCrashlyticsSymbolFileReleaseWithCrashlytics) } } diff --git a/app/src/main/java/org/linphone/activities/main/chat/fragments/DetailChatRoomFragment.kt b/app/src/main/java/org/linphone/activities/main/chat/fragments/DetailChatRoomFragment.kt index 1f64e139b..2aae23ca9 100644 --- a/app/src/main/java/org/linphone/activities/main/chat/fragments/DetailChatRoomFragment.kt +++ b/app/src/main/java/org/linphone/activities/main/chat/fragments/DetailChatRoomFragment.kt @@ -570,11 +570,6 @@ class DetailChatRoomFragment : MasterFragment() list.addAll(events.value.orEmpty()) - if (!list.contains(eventLog)) { + val found = list.find { data -> data.eventLog == eventLog } + if (found == null) { list.add(EventLogData(eventLog)) } events.value = list diff --git a/app/src/main/java/org/linphone/activities/main/settings/viewmodels/ChatSettingsViewModel.kt b/app/src/main/java/org/linphone/activities/main/settings/viewmodels/ChatSettingsViewModel.kt index d599278a0..01f78ccf3 100644 --- a/app/src/main/java/org/linphone/activities/main/settings/viewmodels/ChatSettingsViewModel.kt +++ b/app/src/main/java/org/linphone/activities/main/settings/viewmodels/ChatSettingsViewModel.kt @@ -127,13 +127,6 @@ class ChatSettingsViewModel : GenericSettingsViewModel() { } val hideRoomsRemovedProxies = MutableLiveData() - val ephemeralMessagesBetaListener = object : SettingListenerStub() { - override fun onBoolValueChanged(newValue: Boolean) { - prefs.ephemeralMessagesEnabled = newValue - } - } - val ephemeralMessagesBeta = MutableLiveData() - val goToAndroidNotificationSettingsListener = object : SettingListenerStub() { override fun onClicked() { goToAndroidNotificationSettingsEvent.value = Event(true) @@ -153,7 +146,6 @@ class ChatSettingsViewModel : GenericSettingsViewModel() { launcherShortcuts.value = prefs.chatRoomShortcuts hideEmptyRooms.value = prefs.hideEmptyRooms hideRoomsRemovedProxies.value = prefs.hideRoomsFromRemovedProxies - ephemeralMessagesBeta.value = prefs.ephemeralMessagesEnabled fileSharingUrl.value = core.fileTransferServer vfs.value = prefs.vfsEnabled } diff --git a/app/src/main/java/org/linphone/core/CorePreferences.kt b/app/src/main/java/org/linphone/core/CorePreferences.kt index 49345c7da..509e77fcb 100644 --- a/app/src/main/java/org/linphone/core/CorePreferences.kt +++ b/app/src/main/java/org/linphone/core/CorePreferences.kt @@ -141,13 +141,6 @@ class CorePreferences constructor(private val context: Context) { /* Chat */ - // TODO: Remove for 4.6 release - var ephemeralMessagesEnabled: Boolean - get() = config.getBool("app", "ephemeral", false) - set(value) { - config.setBool("app", "ephemeral", value) - } - var preventMoreThanOneFilePerMessage: Boolean get() = config.getBool("app", "prevent_more_than_one_file_per_message", false) set(value) { diff --git a/app/src/main/res/layout/settings_chat_fragment.xml b/app/src/main/res/layout/settings_chat_fragment.xml index 7c9e8dc29..c6eeb8e57 100644 --- a/app/src/main/res/layout/settings_chat_fragment.xml +++ b/app/src/main/res/layout/settings_chat_fragment.xml @@ -143,12 +143,6 @@ linphone:listener="@{viewModel.hideRoomsRemovedProxiesListener}" linphone:checked="@={viewModel.hideRoomsRemovedProxies}"/> - - - + @@ -31,39 +32,50 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:adjustViewBounds="true" - android:layout_marginLeft="10dp" + android:layout_marginLeft="@dimen/settings_margin" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:contentDescription="@null" + android:visibility="@{icon != null ? View.VISIBLE : View.GONE}" android:src="@{icon}" /> - + style="@style/settings_item_font" + app:autoSizeTextType="uniform" + app:autoSizeMinTextSize="@dimen/setting_title_min_size" + app:autoSizeMaxTextSize="@dimen/setting_title_max_size" + app:autoSizeStepGranularity="@dimen/settings_granularity_step"/> - + style="@style/settings_item_subtitle_font" + app:autoSizeTextType="uniform" + app:autoSizeMinTextSize="@dimen/setting_subtitle_min_size" + app:autoSizeMaxTextSize="@dimen/setting_subtitle_max_size" + app:autoSizeStepGranularity="@dimen/settings_granularity_step"/> - + @@ -28,31 +29,41 @@ android:layout_width="match_parent" android:layout_height="wrap_content"> - + android:layout_marginLeft="@dimen/settings_margin" + android:layout_marginRight="@dimen/settings_margin" + style="@style/settings_item_font" + app:autoSizeTextType="uniform" + app:autoSizeMinTextSize="@dimen/setting_title_min_size" + app:autoSizeMaxTextSize="@dimen/setting_title_max_size" + app:autoSizeStepGranularity="@dimen/settings_granularity_step"/> - + android:layout_marginLeft="@dimen/settings_margin" + android:layout_marginRight="@dimen/settings_margin" + style="@style/settings_item_subtitle_font" + app:autoSizeTextType="uniform" + app:autoSizeMinTextSize="@dimen/setting_subtitle_min_size" + app:autoSizeMaxTextSize="@dimen/setting_subtitle_max_size" + app:autoSizeStepGranularity="@dimen/settings_granularity_step"/> + android:layout_marginLeft="@dimen/settings_margin" + android:layout_marginRight="@dimen/settings_margin" /> - + @@ -33,38 +34,47 @@ android:onCheckedChanged="@{(switch, value) -> listener.onBoolValueChanged(value)}" android:layout_centerVertical="true" android:layout_alignParentRight="true" - android:layout_marginLeft="10dp" - android:layout_marginRight="20dp" + android:layout_marginRight="@dimen/settings_margin" android:layout_width="wrap_content" android:layout_height="wrap_content" /> - + android:layout_marginLeft="@dimen/settings_margin" + android:layout_marginRight="@dimen/settings_margin" + style="@style/settings_item_font" + app:autoSizeTextType="uniform" + app:autoSizeMinTextSize="@dimen/setting_title_min_size" + app:autoSizeMaxTextSize="@dimen/setting_title_max_size" + app:autoSizeStepGranularity="@dimen/settings_granularity_step"/> - + android:layout_marginLeft="@dimen/settings_margin" + android:layout_marginRight="@dimen/settings_margin" + style="@style/settings_item_subtitle_font" + app:autoSizeTextType="uniform" + app:autoSizeMinTextSize="@dimen/setting_subtitle_min_size" + app:autoSizeMaxTextSize="@dimen/setting_subtitle_max_size" + app:autoSizeStepGranularity="@dimen/settings_granularity_step"/> - + android:layout_marginLeft="@dimen/settings_margin" + android:layout_marginRight="@dimen/settings_margin" + style="@style/settings_item_font" + app:autoSizeTextType="uniform" + app:autoSizeMinTextSize="@dimen/setting_title_min_size" + app:autoSizeMaxTextSize="@dimen/setting_title_max_size" + app:autoSizeStepGranularity="@dimen/settings_granularity_step"/> - + android:layout_marginLeft="@dimen/settings_margin" + android:layout_marginRight="@dimen/settings_margin" + style="@style/settings_item_subtitle_font" + app:autoSizeTextType="uniform" + app:autoSizeMinTextSize="@dimen/setting_subtitle_min_size" + app:autoSizeMaxTextSize="@dimen/setting_subtitle_max_size" + app:autoSizeStepGranularity="@dimen/settings_granularity_step"/> diff --git a/app/src/main/res/layout/settings_widget_text.xml b/app/src/main/res/layout/settings_widget_text.xml index a031a402f..ab33322a4 100644 --- a/app/src/main/res/layout/settings_widget_text.xml +++ b/app/src/main/res/layout/settings_widget_text.xml @@ -36,8 +36,7 @@ android:contentDescription="@string/content_description_confirm_contact_edit" android:layout_width="20dp" android:layout_height="20dp" - android:layout_marginLeft="10dp" - android:layout_marginRight="20dp" + android:layout_marginRight="@dimen/settings_margin" android:src="@drawable/valid" android:layout_alignParentRight="true" android:layout_centerVertical="true" /> @@ -48,8 +47,8 @@ android:layout_height="wrap_content" android:layout_toLeftOf="@id/settings_commit_input" android:layout_marginTop="5dp" - android:layout_marginLeft="10dp" - android:layout_marginRight="10dp" + android:layout_marginLeft="@dimen/settings_margin" + android:layout_marginRight="@dimen/settings_margin" android:enabled="@{enabled ?? true}" android:hint="@{title}" app:helperText="@{subtitle}" @@ -61,7 +60,7 @@ android:text="@{defaultValue}" android:imeOptions="actionDone" android:inputType="@{inputType ?? InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS}" - android:singleLine="true" + android:maxLines="1" android:background="@color/transparent_color" android:layout_width="match_parent" android:layout_height="wrap_content"/> diff --git a/app/src/main/res/layout/side_menu_account_cell.xml b/app/src/main/res/layout/side_menu_account_cell.xml index 0e7574c0f..4ef373c64 100644 --- a/app/src/main/res/layout/side_menu_account_cell.xml +++ b/app/src/main/res/layout/side_menu_account_cell.xml @@ -24,7 +24,7 @@ android:layout_height="match_parent" android:gravity="center_vertical" android:padding="2dp" - android:layout_marginLeft="10dp" /> + android:layout_marginLeft="@dimen/settings_margin" /> 6.7dp 30dp 40dp + 10dp + 10sp + 18sp + 8sp + 14sp + 1sp \ No newline at end of file diff --git a/build.gradle b/build.gradle index a49aca70b..063b55d46 100644 --- a/build.gradle +++ b/build.gradle @@ -1,30 +1,34 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.4.32' + ext.kotlin_version = '1.5.20' repositories { google() - jcenter() + jcenter() // For ktlint maven { url "https://plugins.gradle.org/m2/" } - maven { url "https://www.jitpack.io" } // for com.github.chrisbanes:PhotoView + maven { + url "https://www.jitpack.io" + } // for com.github.chrisbanes:PhotoView } dependencies { classpath 'com.android.tools.build:gradle:4.2.2' - classpath 'com.google.gms:google-services:4.3.5' + classpath 'com.google.gms:google-services:4.3.8' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jlleitschuh.gradle:ktlint-gradle:9.1.1" - classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.2' + classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1' } } allprojects { repositories { google() - jcenter() - maven { url "https://www.jitpack.io" } // for com.github.chrisbanes:PhotoView + jcenter() // For ktlint + maven { + url "https://www.jitpack.io" + } // for com.github.chrisbanes:PhotoView } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c24dd9cf5..67cca04be 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip