Bumped dependencies + improved settings layout

This commit is contained in:
Sylvain Berfini 2021-07-09 10:27:20 +02:00
parent 41a15cf6ee
commit 38a144725f
15 changed files with 142 additions and 127 deletions

View file

@ -23,6 +23,10 @@ def crashlyticsEnabled() {
return googleFile.exists() && linphoneLibrary.exists() && linphoneLibraryDebug.exists() return googleFile.exists() && linphoneLibrary.exists() && linphoneLibraryDebug.exists()
} }
if (firebaseEnabled()) {
apply plugin: 'com.google.gms.google-services'
}
if (crashlyticsEnabled()) { if (crashlyticsEnabled()) {
apply plugin: 'com.google.firebase.crashlytics' apply plugin: 'com.google.firebase.crashlytics'
} }
@ -94,14 +98,6 @@ android {
applicationId getPackageName() 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 -> applicationVariants.all { variant ->
variant.outputs.all { variant.outputs.all {
outputFileName = "linphone-android-${variant.buildType.name}-${project.version}.apk" outputFileName = "linphone-android-${variant.buildType.name}-${project.version}.apk"
@ -152,16 +148,14 @@ android {
resValue "bool", "crashlytics_enabled", "false" resValue "bool", "crashlytics_enabled", "false"
} }
releaseAppBundle { releaseWithCrashlytics {
initWith release initWith release
ndk.debugSymbolLevel = 'FULL'
if (crashlyticsEnabled()) { if (crashlyticsEnabled()) {
resValue "bool", "crashlytics_enabled", "true" resValue "bool", "crashlytics_enabled", "true"
firebaseCrashlytics { firebaseCrashlytics {
nativeSymbolUploadEnabled true nativeSymbolUploadEnabled true
strippedNativeLibsDir file(LinphoneSdkBuildDir + '/libs/').toString()
unstrippedNativeLibsDir file(LinphoneSdkBuildDir + '/libs-debug/').toString() unstrippedNativeLibsDir file(LinphoneSdkBuildDir + '/libs-debug/').toString()
} }
} else { } else {
@ -188,7 +182,6 @@ android {
firebaseCrashlytics { firebaseCrashlytics {
nativeSymbolUploadEnabled true nativeSymbolUploadEnabled true
strippedNativeLibsDir file(LinphoneSdkBuildDir + '/libs/').toString()
unstrippedNativeLibsDir file(LinphoneSdkBuildDir + '/libs-debug/').toString() unstrippedNativeLibsDir file(LinphoneSdkBuildDir + '/libs-debug/').toString()
} }
} else { } else {
@ -235,23 +228,23 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.3.0' implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.media:media:1.2.0' implementation 'androidx.media:media:1.2.0'
implementation 'androidx.fragment:fragment-ktx:1.4.0-alpha03' implementation 'androidx.fragment:fragment-ktx:1.4.0-alpha04'
implementation 'androidx.core:core-ktx:1.6.0-rc01' implementation 'androidx.core:core-ktx:1.6.0'
def nav_version = "2.3.5" def nav_version = "2.3.5"
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version" implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$nav_version" implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0-alpha02" implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0-alpha03"
implementation "androidx.window:window:1.0.0-alpha08" implementation "androidx.window:window:1.0.0-alpha09"
implementation 'androidx.constraintlayout:constraintlayout:2.0.4' implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1' implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation 'androidx.recyclerview:recyclerview:1.1.0' 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 'com.google.android:flexbox:2.0.0'
implementation 'androidx.emoji:emoji:1.1.0' implementation 'androidx.emoji:emoji:1.1.0'
@ -278,10 +271,6 @@ dependencies {
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.4' //debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.4'
} }
if (firebaseEnabled()) {
apply plugin: 'com.google.gms.google-services'
}
task generateContactsXml(type: Copy) { task generateContactsXml(type: Copy) {
from 'contacts.xml' from 'contacts.xml'
into "src/main/res/xml/" into "src/main/res/xml/"
@ -307,7 +296,7 @@ if (crashlyticsEnabled()) {
assembleDebug.finalizedBy(uploadCrashlyticsSymbolFileDebug) assembleDebug.finalizedBy(uploadCrashlyticsSymbolFileDebug)
packageDebugBundle.finalizedBy(uploadCrashlyticsSymbolFileDebug) packageDebugBundle.finalizedBy(uploadCrashlyticsSymbolFileDebug)
assembleReleaseAppBundle.finalizedBy(uploadCrashlyticsSymbolFileReleaseAppBundle) assembleReleaseWithCrashlytics.finalizedBy(uploadCrashlyticsSymbolFileReleaseWithCrashlytics)
packageReleaseAppBundleBundle.finalizedBy(uploadCrashlyticsSymbolFileReleaseAppBundle) packageReleaseWithCrashlytics.finalizedBy(uploadCrashlyticsSymbolFileReleaseWithCrashlytics)
} }
} }

View file

@ -570,11 +570,6 @@ class DetailChatRoomFragment : MasterFragment<ChatRoomDetailFragmentBinding, Cha
if (!viewModel.encryptedChatRoom) { if (!viewModel.encryptedChatRoom) {
builder.removeItem(R.id.chat_room_participants_devices) builder.removeItem(R.id.chat_room_participants_devices)
builder.removeItem(R.id.chat_room_ephemeral_messages) builder.removeItem(R.id.chat_room_ephemeral_messages)
} else {
// TODO: Remove for 4.6 release
if (!corePreferences.ephemeralMessagesEnabled) {
builder.removeItem(R.id.chat_room_ephemeral_messages)
}
} }
builder.setCallback(object : MenuBuilder.Callback { builder.setCallback(object : MenuBuilder.Callback {

View file

@ -209,7 +209,8 @@ class ChatMessagesListViewModel(private val chatRoom: ChatRoom) : ViewModel() {
private fun addEvent(eventLog: EventLog) { private fun addEvent(eventLog: EventLog) {
val list = arrayListOf<EventLogData>() val list = arrayListOf<EventLogData>()
list.addAll(events.value.orEmpty()) list.addAll(events.value.orEmpty())
if (!list.contains(eventLog)) { val found = list.find { data -> data.eventLog == eventLog }
if (found == null) {
list.add(EventLogData(eventLog)) list.add(EventLogData(eventLog))
} }
events.value = list events.value = list

View file

@ -127,13 +127,6 @@ class ChatSettingsViewModel : GenericSettingsViewModel() {
} }
val hideRoomsRemovedProxies = MutableLiveData<Boolean>() val hideRoomsRemovedProxies = MutableLiveData<Boolean>()
val ephemeralMessagesBetaListener = object : SettingListenerStub() {
override fun onBoolValueChanged(newValue: Boolean) {
prefs.ephemeralMessagesEnabled = newValue
}
}
val ephemeralMessagesBeta = MutableLiveData<Boolean>()
val goToAndroidNotificationSettingsListener = object : SettingListenerStub() { val goToAndroidNotificationSettingsListener = object : SettingListenerStub() {
override fun onClicked() { override fun onClicked() {
goToAndroidNotificationSettingsEvent.value = Event(true) goToAndroidNotificationSettingsEvent.value = Event(true)
@ -153,7 +146,6 @@ class ChatSettingsViewModel : GenericSettingsViewModel() {
launcherShortcuts.value = prefs.chatRoomShortcuts launcherShortcuts.value = prefs.chatRoomShortcuts
hideEmptyRooms.value = prefs.hideEmptyRooms hideEmptyRooms.value = prefs.hideEmptyRooms
hideRoomsRemovedProxies.value = prefs.hideRoomsFromRemovedProxies hideRoomsRemovedProxies.value = prefs.hideRoomsFromRemovedProxies
ephemeralMessagesBeta.value = prefs.ephemeralMessagesEnabled
fileSharingUrl.value = core.fileTransferServer fileSharingUrl.value = core.fileTransferServer
vfs.value = prefs.vfsEnabled vfs.value = prefs.vfsEnabled
} }

View file

@ -141,13 +141,6 @@ class CorePreferences constructor(private val context: Context) {
/* Chat */ /* 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 var preventMoreThanOneFilePerMessage: Boolean
get() = config.getBool("app", "prevent_more_than_one_file_per_message", false) get() = config.getBool("app", "prevent_more_than_one_file_per_message", false)
set(value) { set(value) {

View file

@ -143,12 +143,6 @@
linphone:listener="@{viewModel.hideRoomsRemovedProxiesListener}" linphone:listener="@{viewModel.hideRoomsRemovedProxiesListener}"
linphone:checked="@={viewModel.hideRoomsRemovedProxies}"/> linphone:checked="@={viewModel.hideRoomsRemovedProxies}"/>
<include
layout="@layout/settings_widget_switch"
linphone:title="@{@string/chat_settins_enable_ephemeral_messages_beta_title}"
linphone:listener="@{viewModel.ephemeralMessagesBetaListener}"
linphone:checked="@={viewModel.ephemeralMessagesBeta}"/>
<include <include
layout="@layout/settings_widget_text" layout="@layout/settings_widget_text"
linphone:title="@{@string/chat_settings_file_sharing_url_title}" linphone:title="@{@string/chat_settings_file_sharing_url_title}"

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"> <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data> <data>
<import type="android.view.View"/> <import type="android.view.View"/>
@ -31,39 +32,50 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:layout_marginLeft="10dp" android:layout_marginLeft="@dimen/settings_margin"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:contentDescription="@null" android:contentDescription="@null"
android:visibility="@{icon != null ? View.VISIBLE : View.GONE}"
android:src="@{icon}" /> android:src="@{icon}" />
<org.linphone.views.MarqueeTextView <TextView
android:id="@+id/settings_title" android:id="@+id/settings_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="25dp"
android:gravity="center_vertical"
android:text="@{title}" android:text="@{title}"
android:enabled="@{enabled ?? true}" android:enabled="@{enabled ?? true}"
android:visibility="@{title.length() > 0 ? View.VISIBLE : View.GONE}" android:visibility="@{title.length() > 0 ? View.VISIBLE : View.GONE}"
android:singleLine="true" android:maxLines="1"
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:layout_marginLeft="10dp" android:layout_marginLeft="@dimen/settings_margin"
android:layout_marginRight="10dp" android:layout_marginRight="@dimen/settings_margin"
android:layout_toRightOf="@id/icon" android:layout_toRightOf="@id/icon"
style="@style/settings_item_font"/> 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"/>
<org.linphone.views.MarqueeTextView <TextView
android:id="@+id/settings_subtitle" android:id="@+id/settings_subtitle"
android:text="@{subtitle}" android:text="@{subtitle}"
android:enabled="@{enabled ?? true}" android:enabled="@{enabled ?? true}"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="20dp"
android:gravity="center_vertical"
android:visibility="@{subtitle.length() > 0 ? View.VISIBLE : View.GONE}" android:visibility="@{subtitle.length() > 0 ? View.VISIBLE : View.GONE}"
android:singleLine="true" android:maxLines="1"
android:layout_below="@id/settings_title" android:layout_below="@id/settings_title"
android:layout_marginLeft="10dp" android:layout_marginLeft="@dimen/settings_margin"
android:layout_marginRight="10dp" android:layout_marginRight="@dimen/settings_margin"
android:layout_toRightOf="@id/icon" android:layout_toRightOf="@id/icon"
style="@style/settings_item_subtitle_font"/> 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"/>
<View <View
android:layout_marginTop="15dp" android:layout_marginTop="15dp"

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"> <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data> <data>
<import type="android.view.View"/> <import type="android.view.View"/>
@ -28,31 +29,41 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<org.linphone.views.MarqueeTextView <TextView
android:id="@+id/settings_title" android:id="@+id/settings_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="25dp"
android:gravity="center_vertical"
android:text="@{title}" android:text="@{title}"
android:enabled="@{enabled ?? true}" android:enabled="@{enabled ?? true}"
android:visibility="@{title.length() > 0 ? View.VISIBLE : View.GONE}" android:visibility="@{title.length() > 0 ? View.VISIBLE : View.GONE}"
android:singleLine="true" android:maxLines="1"
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:layout_marginLeft="20dp" android:layout_marginLeft="@dimen/settings_margin"
android:layout_marginRight="20dp" android:layout_marginRight="@dimen/settings_margin"
style="@style/settings_item_font"/> 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"/>
<org.linphone.views.MarqueeTextView <TextView
android:id="@+id/settings_subtitle" android:id="@+id/settings_subtitle"
android:text="@{subtitle}" android:text="@{subtitle}"
android:enabled="@{enabled ?? true}" android:enabled="@{enabled ?? true}"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="20dp"
android:gravity="center_vertical"
android:visibility="@{subtitle.length() > 0 ? View.VISIBLE : View.GONE}" android:visibility="@{subtitle.length() > 0 ? View.VISIBLE : View.GONE}"
android:singleLine="true" android:maxLines="1"
android:layout_below="@id/settings_title" android:layout_below="@id/settings_title"
android:layout_marginLeft="20dp" android:layout_marginLeft="@dimen/settings_margin"
android:layout_marginRight="20dp" android:layout_marginRight="@dimen/settings_margin"
style="@style/settings_item_subtitle_font"/> 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"/>
<Spinner <Spinner
android:id="@+id/settings_spinner" android:id="@+id/settings_spinner"
@ -63,8 +74,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/settings_subtitle" android:layout_below="@id/settings_subtitle"
android:layout_marginLeft="20dp" android:layout_marginLeft="@dimen/settings_margin"
android:layout_marginRight="20dp" /> android:layout_marginRight="@dimen/settings_margin" />
<View <View
android:layout_marginTop="15dp" android:layout_marginTop="15dp"

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"> <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data> <data>
<import type="android.view.View"/> <import type="android.view.View"/>
@ -33,38 +34,47 @@
android:onCheckedChanged="@{(switch, value) -> listener.onBoolValueChanged(value)}" android:onCheckedChanged="@{(switch, value) -> listener.onBoolValueChanged(value)}"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_marginLeft="10dp" android:layout_marginRight="@dimen/settings_margin"
android:layout_marginRight="20dp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<org.linphone.views.MarqueeTextView <TextView
android:id="@+id/settings_title" android:id="@+id/settings_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="25dp"
android:gravity="center_vertical"
android:text="@{title}" android:text="@{title}"
android:enabled="@{enabled ?? true}" android:enabled="@{enabled ?? true}"
android:visibility="@{title.length() > 0 ? View.VISIBLE : View.GONE}" android:visibility="@{title.length() > 0 ? View.VISIBLE : View.GONE}"
android:singleLine="true" android:maxLines="1"
android:layout_toLeftOf="@id/setting_switch" android:layout_toLeftOf="@id/setting_switch"
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:layout_marginLeft="20dp" android:layout_marginLeft="@dimen/settings_margin"
android:layout_marginRight="10dp" android:layout_marginRight="@dimen/settings_margin"
style="@style/settings_item_font"/> 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"/>
<org.linphone.views.MarqueeTextView <TextView
android:id="@+id/settings_subtitle" android:id="@+id/settings_subtitle"
android:text="@{subtitle}" android:text="@{subtitle}"
android:enabled="@{enabled ?? true}" android:enabled="@{enabled ?? true}"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="20dp"
android:gravity="center_vertical"
android:visibility="@{subtitle.length() > 0 ? View.VISIBLE : View.GONE}" android:visibility="@{subtitle.length() > 0 ? View.VISIBLE : View.GONE}"
android:singleLine="true" android:maxLines="1"
android:layout_below="@id/settings_title" android:layout_below="@id/settings_title"
android:layout_toLeftOf="@id/setting_switch" android:layout_toLeftOf="@id/setting_switch"
android:layout_marginLeft="20dp" android:layout_marginLeft="@dimen/settings_margin"
android:layout_marginRight="10dp" android:layout_marginRight="@dimen/settings_margin"
style="@style/settings_item_subtitle_font"/> 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"/>
<View <View
android:layout_marginTop="15dp" android:layout_marginTop="15dp"

View file

@ -44,38 +44,47 @@
android:onCheckedChanged="@{(switch, value) -> listener.onBoolValueChanged(value)}" android:onCheckedChanged="@{(switch, value) -> listener.onBoolValueChanged(value)}"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_marginLeft="10dp" android:layout_marginRight="@dimen/settings_margin"
android:layout_marginRight="20dp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<org.linphone.views.MarqueeTextView <TextView
android:id="@+id/settings_title" android:id="@+id/settings_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="25dp"
android:gravity="center_vertical"
android:text="@{switch_title}" android:text="@{switch_title}"
android:enabled="@{enabled ?? true}" android:enabled="@{enabled ?? true}"
android:visibility="@{switch_title.length() > 0 ? View.VISIBLE : View.GONE}" android:visibility="@{switch_title.length() > 0 ? View.VISIBLE : View.GONE}"
android:singleLine="true" android:maxLines="1"
android:layout_toLeftOf="@id/setting_switch" android:layout_toLeftOf="@id/setting_switch"
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:layout_marginLeft="20dp" android:layout_marginLeft="@dimen/settings_margin"
android:layout_marginRight="10dp" android:layout_marginRight="@dimen/settings_margin"
style="@style/settings_item_font"/> 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"/>
<org.linphone.views.MarqueeTextView <TextView
android:id="@+id/settings_subtitle" android:id="@+id/settings_subtitle"
android:text="@{switch_subtitle}" android:text="@{switch_subtitle}"
android:enabled="@{enabled ?? true}" android:enabled="@{enabled ?? true}"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="20dp"
android:gravity="center_vertical"
android:visibility="@{switch_subtitle.length() > 0 ? View.VISIBLE : View.GONE}" android:visibility="@{switch_subtitle.length() > 0 ? View.VISIBLE : View.GONE}"
android:singleLine="true" android:maxLines="1"
android:layout_below="@id/settings_title" android:layout_below="@id/settings_title"
android:layout_toLeftOf="@id/setting_switch" android:layout_toLeftOf="@id/setting_switch"
android:layout_marginLeft="20dp" android:layout_marginLeft="@dimen/settings_margin"
android:layout_marginRight="10dp" android:layout_marginRight="@dimen/settings_margin"
style="@style/settings_item_subtitle_font"/> 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"/>
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/settings_input_layout" android:id="@+id/settings_input_layout"
@ -85,8 +94,8 @@
android:layout_below="@id/settings_subtitle" android:layout_below="@id/settings_subtitle"
android:layout_toLeftOf="@id/setting_switch" android:layout_toLeftOf="@id/setting_switch"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginLeft="20dp" android:layout_marginLeft="@dimen/settings_margin"
android:layout_marginRight="10dp" android:layout_marginRight="@dimen/settings_margin"
android:enabled="@{enabled ?? true}" android:enabled="@{enabled ?? true}"
android:hint="@{text_title}" android:hint="@{text_title}"
app:helperText="@{text_subtitle}" app:helperText="@{text_subtitle}"
@ -98,7 +107,7 @@
android:imeOptions="actionDone" android:imeOptions="actionDone"
android:inputType="@{InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS}" android:inputType="@{InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS}"
onValueChanged="@{() -> listener.onTextValueChanged(settingsInput.getText().toString())}" onValueChanged="@{() -> listener.onTextValueChanged(settingsInput.getText().toString())}"
android:singleLine="true" android:maxLines="1"
android:background="@color/transparent_color" android:background="@color/transparent_color"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>

View file

@ -36,8 +36,7 @@
android:contentDescription="@string/content_description_confirm_contact_edit" android:contentDescription="@string/content_description_confirm_contact_edit"
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_marginLeft="10dp" android:layout_marginRight="@dimen/settings_margin"
android:layout_marginRight="20dp"
android:src="@drawable/valid" android:src="@drawable/valid"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerVertical="true" /> android:layout_centerVertical="true" />
@ -48,8 +47,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toLeftOf="@id/settings_commit_input" android:layout_toLeftOf="@id/settings_commit_input"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginLeft="10dp" android:layout_marginLeft="@dimen/settings_margin"
android:layout_marginRight="10dp" android:layout_marginRight="@dimen/settings_margin"
android:enabled="@{enabled ?? true}" android:enabled="@{enabled ?? true}"
android:hint="@{title}" android:hint="@{title}"
app:helperText="@{subtitle}" app:helperText="@{subtitle}"
@ -61,7 +60,7 @@
android:text="@{defaultValue}" android:text="@{defaultValue}"
android:imeOptions="actionDone" android:imeOptions="actionDone"
android:inputType="@{inputType ?? InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS}" android:inputType="@{inputType ?? InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS}"
android:singleLine="true" android:maxLines="1"
android:background="@color/transparent_color" android:background="@color/transparent_color"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>

View file

@ -24,7 +24,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center_vertical" android:gravity="center_vertical"
android:padding="2dp" android:padding="2dp"
android:layout_marginLeft="10dp" /> android:layout_marginLeft="@dimen/settings_margin" />
<ImageView <ImageView
android:src="@{data.iconResource, default=@drawable/led_not_registered}" android:src="@{data.iconResource, default=@drawable/led_not_registered}"
@ -34,7 +34,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginRight="10dp" android:layout_marginRight="@dimen/settings_margin"
android:padding="2dp" /> android:padding="2dp" />
<View <View

View file

@ -30,4 +30,10 @@
<dimen name="chat_message_round_corner_radius">6.7dp</dimen> <dimen name="chat_message_round_corner_radius">6.7dp</dimen>
<dimen name="play_pause_button_size">30dp</dimen> <dimen name="play_pause_button_size">30dp</dimen>
<dimen name="progress_bar_height">40dp</dimen> <dimen name="progress_bar_height">40dp</dimen>
<dimen name="settings_margin">10dp</dimen>
<dimen name="setting_title_min_size">10sp</dimen>
<dimen name="setting_title_max_size">18sp</dimen>
<dimen name="setting_subtitle_min_size">8sp</dimen>
<dimen name="setting_subtitle_max_size">14sp</dimen>
<dimen name="settings_granularity_step">1sp</dimen>
</resources> </resources>

View file

@ -1,30 +1,34 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
ext.kotlin_version = '1.4.32' ext.kotlin_version = '1.5.20'
repositories { repositories {
google() google()
jcenter() jcenter() // For ktlint
maven { maven {
url "https://plugins.gradle.org/m2/" 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 { dependencies {
classpath 'com.android.tools.build:gradle:4.2.2' 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.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jlleitschuh.gradle:ktlint-gradle:9.1.1" 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 { allprojects {
repositories { repositories {
google() google()
jcenter() jcenter() // For ktlint
maven { url "https://www.jitpack.io" } // for com.github.chrisbanes:PhotoView maven {
url "https://www.jitpack.io"
} // for com.github.chrisbanes:PhotoView
} }
} }

View file

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists 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