Minor changes to fix code inspector warnings

This commit is contained in:
Sylvain Berfini 2021-11-17 10:30:43 +01:00
parent 07b6d07b7f
commit 8a11fc9c4a
28 changed files with 230 additions and 155 deletions

View file

@ -114,8 +114,8 @@ class StatusFragment : GenericFragment<CallStatusFragmentBinding>() {
val viewModel = DialogViewModel(getString(R.string.zrtp_dialog_message), getString(R.string.zrtp_dialog_title))
viewModel.showZrtp = true
viewModel.zrtpReadSas = toRead.toUpperCase(Locale.getDefault())
viewModel.zrtpListenSas = toListen.toUpperCase(Locale.getDefault())
viewModel.zrtpReadSas = toRead.uppercase(Locale.getDefault())
viewModel.zrtpListenSas = toListen.uppercase(Locale.getDefault())
viewModel.showIcon = true
viewModel.iconResource = R.drawable.security_2_indicator

View file

@ -342,23 +342,27 @@ class ControlsViewModel : ViewModel() {
val currentCall = core.currentCall
val conference = core.conference
if (currentCall != null) {
if (currentCall.isRecording) {
currentCall.stopRecording()
} else {
currentCall.startRecording()
when {
currentCall != null -> {
if (currentCall.isRecording) {
currentCall.stopRecording()
} else {
currentCall.startRecording()
}
isRecording.value = currentCall.isRecording
}
isRecording.value = currentCall.isRecording
} else if (conference != null) {
val path = LinphoneUtils.getRecordingFilePathForConference()
if (conference.isRecording) {
conference.stopRecording()
} else {
conference.startRecording(path)
conference != null -> {
val path = LinphoneUtils.getRecordingFilePathForConference()
if (conference.isRecording) {
conference.stopRecording()
} else {
conference.startRecording(path)
}
isRecording.value = conference.isRecording
}
else -> {
isRecording.value = false
}
isRecording.value = conference.isRecording
} else {
isRecording.value = false
}
if (closeMenu) toggleOptionsMenu()

View file

@ -29,7 +29,7 @@ internal abstract class ChatScrollListener(private val mLayoutManager: LinearLay
// True if we are still waiting for the last set of data to load.
private var loading = true
var userHasScrolledUp: Boolean = false
private var userHasScrolledUp: Boolean = false
// This happens many times a second during a scroll, so be wary of the code you place here.
// We are given a few useful parameters to help us work out if we need to load some more data,

View file

@ -60,7 +60,6 @@ class ChatMessageContentData(
val fileName = MutableLiveData<String>()
val filePath = MutableLiveData<String>()
val fileSize = MutableLiveData<String>()
val downloadable = MutableLiveData<Boolean>()
val downloadEnabled = MutableLiveData<Boolean>()
@ -72,7 +71,6 @@ class ChatMessageContentData(
val formattedDuration = MutableLiveData<String>()
val voiceRecordPlayingPosition = MutableLiveData<Int>()
val isVoiceRecordPlaying = MutableLiveData<Boolean>()
var voiceRecordAudioFocusRequest: AudioFocusRequestCompat? = null
val isAlone: Boolean
get() {
@ -86,7 +84,9 @@ class ChatMessageContentData(
return count == 1
}
var isFileEncrypted: Boolean = false
private var isFileEncrypted: Boolean = false
private var voiceRecordAudioFocusRequest: AudioFocusRequestCompat? = null
private lateinit var voiceRecordingPlayer: Player
private val playerListener = PlayerListener {
@ -193,8 +193,8 @@ class ChatMessageContentData(
}
// Display download size and underline text
fileSize.value = AppUtils.bytesToDisplayableSize(content.fileSize.toLong())
val spannable = SpannableString("${AppUtils.getString(R.string.chat_message_download_file)} (${fileSize.value})")
val fileSize = AppUtils.bytesToDisplayableSize(content.fileSize.toLong())
val spannable = SpannableString("${AppUtils.getString(R.string.chat_message_download_file)} ($fileSize)")
spannable.setSpan(UnderlineSpan(), 0, spannable.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
downloadLabel.value = spannable

View file

@ -165,7 +165,7 @@ class ChatMessageData(val chatMessage: ChatMessage) : GenericContactData(chatMes
val list = arrayListOf<ChatMessageContentData>()
val contentsList = chatMessage.contents
for (index in 0 until contentsList.size) {
for (index in contentsList.indices) {
val content = contentsList[index]
if (content.isFileTransfer || content.isFile) {
val data = ChatMessageContentData(chatMessage, index)

View file

@ -86,11 +86,11 @@ class ChatMessageSendingViewModel(private val chatRoom: ChatRoom) : ViewModel()
val isPlayingVoiceRecording = MutableLiveData<Boolean>()
val recorder: Recorder
val voiceRecordPlayingPosition = MutableLiveData<Int>()
var voiceRecordAudioFocusRequest: AudioFocusRequestCompat? = null
private val recorder: Recorder
private var voiceRecordAudioFocusRequest: AudioFocusRequestCompat? = null
private lateinit var voiceRecordingPlayer: Player
private val playerListener = PlayerListener {

View file

@ -90,12 +90,12 @@ class ChatRoomViewModel(val chatRoom: ChatRoom) : ViewModel(), ContactDataInterf
var oneParticipantOneDevice: Boolean = false
var addressToCall: Address? = null
var onlyParticipantOnlyDeviceAddress: Address? = null
val chatUnreadCountTranslateY = MutableLiveData<Float>()
private var addressToCall: Address? = null
private val bounceAnimator: ValueAnimator by lazy {
ValueAnimator.ofFloat(AppUtils.getDimension(R.dimen.tabs_fragment_unread_count_bounce_offset), 0f).apply {
addUpdateListener {

View file

@ -170,12 +170,10 @@ class ChatRoomsListViewModel : ErrorReportingViewModel() {
}
private fun findChatRoomIndex(chatRoom: ChatRoom): Int {
var index = 0
for (chatRoomViewModel in chatRooms.value.orEmpty()) {
for ((index, chatRoomViewModel) in chatRooms.value.orEmpty().withIndex()) {
if (chatRoomViewModel.chatRoom == chatRoom) {
return index
}
index++
}
return -1
}

View file

@ -32,8 +32,8 @@ import org.linphone.mediastream.Version
import org.linphone.utils.Event
class AdvancedSettingsViewModel : LogsUploadViewModel() {
protected val prefs = corePreferences
protected val core = coreContext.core
private val prefs = corePreferences
private val core = coreContext.core
val debugModeListener = object : SettingListenerStub() {
override fun onBoolValueChanged(newValue: Boolean) {

View file

@ -57,7 +57,7 @@ open class StatusViewModel : ViewModel() {
body: Content
) {
if (body.type == "application" && body.subtype == "simple-message-summary" && body.size > 0) {
val data = body.utf8Text?.toLowerCase(Locale.getDefault())
val data = body.utf8Text?.lowercase(Locale.getDefault())
val voiceMail = data?.split("voice-message: ")
if (voiceMail?.size ?: 0 >= 2) {
val toParse = voiceMail!![1].split("/", limit = 0)

View file

@ -22,6 +22,7 @@ package org.linphone.compatibility
import android.annotation.SuppressLint
import android.annotation.TargetApi
import android.app.Activity
import android.app.PendingIntent
import android.bluetooth.BluetoothAdapter
import android.content.ContentValues
import android.content.Context
@ -207,5 +208,9 @@ class Api21Compatibility {
fun requestDismissKeyguard(activity: Activity) {
activity.window.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD)
}
fun getUpdateCurrentPendingIntentFlag(): Int {
return PendingIntent.FLAG_UPDATE_CURRENT
}
}
}

View file

@ -0,0 +1,32 @@
/*
* Copyright (c) 2010-2021 Belledonne Communications SARL.
*
* This file is part of linphone-android
* (see https://www.linphone.org).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.linphone.compatibility
import android.annotation.TargetApi
import android.app.PendingIntent
@TargetApi(31)
class Api31Compatibility {
companion object {
fun getUpdateCurrentPendingIntentFlag(): Int {
return PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE
}
}
}

View file

@ -252,5 +252,12 @@ class Compatibility {
}
return Api21Compatibility.addAudioToMediaStore(context, content)
}
fun getUpdateCurrentPendingIntentFlag(): Int {
if (Version.sdkAboveOrEqual(Version.API31_ANDROID_12)) {
return Api31Compatibility.getUpdateCurrentPendingIntentFlag()
}
return Api21Compatibility.getUpdateCurrentPendingIntentFlag()
}
}
}

View file

@ -129,10 +129,10 @@ class AsyncContactsLoader(private val context: Context) :
try {
val id: String =
cursor.getString(cursor.getColumnIndex(ContactsContract.Data.CONTACT_ID))
cursor.getString(cursor.getColumnIndexOrThrow(ContactsContract.Data.CONTACT_ID))
val starred =
cursor.getInt(cursor.getColumnIndex(ContactsContract.Contacts.STARRED)) == 1
val lookupKey = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY))
cursor.getInt(cursor.getColumnIndexOrThrow(ContactsContract.Contacts.STARRED)) == 1
val lookupKey = cursor.getString(cursor.getColumnIndexOrThrow(ContactsContract.Contacts.LOOKUP_KEY))
var contact: Contact? = androidContactsCache[id]
if (contact == null) {
Log.d(
@ -148,6 +148,10 @@ class AsyncContactsLoader(private val context: Context) :
Log.e(
"[Contacts Loader] Couldn't get values from cursor, exception: $ise"
)
} catch (iae: IllegalArgumentException) {
Log.e(
"[Contacts Loader] Couldn't get values from cursor, exception: $iae"
)
}
}
cursor.close()

View file

@ -51,10 +51,10 @@ open class Contact : Comparable<Contact> {
// Raw SIP addresses are only used for contact edition
var rawSipAddresses = arrayListOf<String>()
var thumbnailUri: Uri? = null
var friend: Friend? = null
private var thumbnailUri: Uri? = null
override fun compareTo(other: Contact): Int {
val fn = fullName ?: ""
val otherFn = other.fullName ?: ""

View file

@ -79,12 +79,6 @@ class ContactsManager(private val context: Context) {
@Synchronized
private set
var localAccountsContacts = ArrayList<Contact>()
@Synchronized
get
@Synchronized
private set
val magicSearch: MagicSearch by lazy {
val magicSearch = coreContext.core.createMagicSearch()
magicSearch.limitedSearch = false
@ -93,6 +87,12 @@ class ContactsManager(private val context: Context) {
var latestContactFetch: String = ""
private var localAccountsContacts = ArrayList<Contact>()
@Synchronized
get
@Synchronized
private set
private val friendsMap: HashMap<String, Friend> = HashMap()
private val contactsUpdatedListeners = ArrayList<ContactsUpdatedListener>()

View file

@ -86,97 +86,104 @@ class NativeContact(val nativeId: String, private val lookupKey: String? = null)
@Synchronized
override fun syncValuesFromAndroidCursor(cursor: Cursor) {
val displayName: String? =
cursor.getString(cursor.getColumnIndex(ContactsContract.Data.DISPLAY_NAME_PRIMARY))
try {
val displayName: String? =
cursor.getString(cursor.getColumnIndexOrThrow(ContactsContract.Data.DISPLAY_NAME_PRIMARY))
val mime: String? = cursor.getString(cursor.getColumnIndex(ContactsContract.Data.MIMETYPE))
val data1: String? = cursor.getString(cursor.getColumnIndex("data1"))
val data2: String? = cursor.getString(cursor.getColumnIndex("data2"))
val data3: String? = cursor.getString(cursor.getColumnIndex("data3"))
val data4: String? = cursor.getString(cursor.getColumnIndex("data4"))
val mime: String? =
cursor.getString(cursor.getColumnIndexOrThrow(ContactsContract.Data.MIMETYPE))
val data1: String? = cursor.getString(cursor.getColumnIndexOrThrow("data1"))
val data2: String? = cursor.getString(cursor.getColumnIndexOrThrow("data2"))
val data3: String? = cursor.getString(cursor.getColumnIndexOrThrow("data3"))
val data4: String? = cursor.getString(cursor.getColumnIndexOrThrow("data4"))
if (fullName == null || fullName != displayName) {
Log.d("[Native Contact] Setting display name $displayName")
fullName = displayName
}
if (fullName == null || fullName != displayName) {
Log.d("[Native Contact] Setting display name $displayName")
fullName = displayName
}
val linphoneMime = AppUtils.getString(R.string.linphone_address_mime_type)
when (mime) {
ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE -> {
if (data1 == null && data4 == null) {
Log.d("[Native Contact] Phone number data is empty")
return
}
val linphoneMime = AppUtils.getString(R.string.linphone_address_mime_type)
when (mime) {
ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE -> {
if (data1 == null && data4 == null) {
Log.d("[Native Contact] Phone number data is empty")
return
}
val labelColumnIndex = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.LABEL)
val label: String? = cursor.getString(labelColumnIndex)
val typeColumnIndex = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.TYPE)
val type: Int = cursor.getInt(typeColumnIndex)
val typeLabel = ContactsContract.CommonDataKinds.Phone.getTypeLabel(
coreContext.context.resources,
type,
label
).toString()
val labelColumnIndex =
cursor.getColumnIndexOrThrow(ContactsContract.CommonDataKinds.Phone.LABEL)
val label: String? = cursor.getString(labelColumnIndex)
val typeColumnIndex =
cursor.getColumnIndexOrThrow(ContactsContract.CommonDataKinds.Phone.TYPE)
val type: Int = cursor.getInt(typeColumnIndex)
val typeLabel = ContactsContract.CommonDataKinds.Phone.getTypeLabel(
coreContext.context.resources,
type,
label
).toString()
// data4 = ContactsContract.CommonDataKinds.Phone.NORMALIZED_NUMBER
// data1 = ContactsContract.CommonDataKinds.Phone.NUMBER
val number = if (corePreferences.preferNormalizedPhoneNumbersFromAddressBook) {
data4 ?: data1
} else {
data1 ?: data4
}
if (number != null && number.isNotEmpty()) {
Log.d("[Native Contact] Found phone number $data1 ($data4), type label is $typeLabel")
if (!rawPhoneNumbers.contains(number)) {
phoneNumbers.add(PhoneNumber(number, typeLabel))
rawPhoneNumbers.add(number)
// data4 = ContactsContract.CommonDataKinds.Phone.NORMALIZED_NUMBER
// data1 = ContactsContract.CommonDataKinds.Phone.NUMBER
val number = if (corePreferences.preferNormalizedPhoneNumbersFromAddressBook) {
data4 ?: data1
} else {
data1 ?: data4
}
if (number != null && number.isNotEmpty()) {
Log.d("[Native Contact] Found phone number $data1 ($data4), type label is $typeLabel")
if (!rawPhoneNumbers.contains(number)) {
phoneNumbers.add(PhoneNumber(number, typeLabel))
rawPhoneNumbers.add(number)
}
}
}
}
linphoneMime, ContactsContract.CommonDataKinds.SipAddress.CONTENT_ITEM_TYPE -> {
if (data1 == null) {
Log.d("[Native Contact] SIP address is null")
return
}
linphoneMime, ContactsContract.CommonDataKinds.SipAddress.CONTENT_ITEM_TYPE -> {
if (data1 == null) {
Log.d("[Native Contact] SIP address is null")
return
}
Log.d("[Native Contact] Found SIP address $data1")
if (rawPhoneNumbers.contains(data1)) {
Log.d("[Native Contact] SIP address value already exists in phone numbers list, skipping")
return
}
Log.d("[Native Contact] Found SIP address $data1")
if (rawPhoneNumbers.contains(data1)) {
Log.d("[Native Contact] SIP address value already exists in phone numbers list, skipping")
return
}
val address: Address? = coreContext.core.interpretUrl(data1)
if (address == null) {
Log.e("[Native Contact] Couldn't parse address $data1 !")
return
}
val address: Address? = coreContext.core.interpretUrl(data1)
if (address == null) {
Log.e("[Native Contact] Couldn't parse address $data1 !")
return
}
val stringAddress = address.asStringUriOnly()
Log.d("[Native Contact] Found SIP address $stringAddress")
if (!rawSipAddresses.contains(data1)) {
sipAddresses.add(address)
rawSipAddresses.add(data1)
val stringAddress = address.asStringUriOnly()
Log.d("[Native Contact] Found SIP address $stringAddress")
if (!rawSipAddresses.contains(data1)) {
sipAddresses.add(address)
rawSipAddresses.add(data1)
}
}
ContactsContract.CommonDataKinds.Organization.CONTENT_ITEM_TYPE -> {
if (data1 == null) {
Log.d("[Native Contact] Organization is null")
return
}
Log.d("[Native Contact] Found organization $data1")
organization = data1
}
ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE -> {
if (data2 == null && data3 == null) {
Log.d("[Native Contact] First name and last name are both null")
return
}
Log.d("[Native Contact] Found first name $data2 and last name $data3")
firstName = data2
lastName = data3
}
}
ContactsContract.CommonDataKinds.Organization.CONTENT_ITEM_TYPE -> {
if (data1 == null) {
Log.d("[Native Contact] Organization is null")
return
}
Log.d("[Native Contact] Found organization $data1")
organization = data1
}
ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE -> {
if (data2 == null && data3 == null) {
Log.d("[Native Contact] First name and last name are both null")
return
}
Log.d("[Native Contact] Found first name $data2 and last name $data3")
firstName = data2
lastName = data3
}
} catch (iae: IllegalArgumentException) {
Log.e("[Native Contact] Exception: $iae")
}
}

View file

@ -96,8 +96,12 @@ class NativeContactEditor(val contact: NativeContact) {
if (cursor?.moveToFirst() == true) {
do {
if (rawId == null) {
rawId = cursor.getString(cursor.getColumnIndex(RawContacts._ID))
Log.i("[Native Contact Editor] Found raw id $rawId for native contact with id ${contact.nativeId}")
try {
rawId = cursor.getString(cursor.getColumnIndexOrThrow(RawContacts._ID))
Log.i("[Native Contact Editor] Found raw id $rawId for native contact with id ${contact.nativeId}")
} catch (iae: IllegalArgumentException) {
Log.e("[Native Contact Editor] Exception: $iae")
}
}
} while (cursor.moveToNext() && rawId == null)
}
@ -258,11 +262,16 @@ class NativeContactEditor(val contact: NativeContact) {
)
if (cursor?.moveToFirst() == true) {
do {
val accountType =
cursor.getString(cursor.getColumnIndex(RawContacts.ACCOUNT_TYPE))
if (accountType == AppUtils.getString(R.string.sync_account_type) && syncAccountRawId == null) {
syncAccountRawId = cursor.getString(cursor.getColumnIndex(RawContacts._ID))
Log.d("[Native Contact Editor] Found linphone raw id $syncAccountRawId for native contact with id ${contact.nativeId}")
try {
val accountType =
cursor.getString(cursor.getColumnIndexOrThrow(RawContacts.ACCOUNT_TYPE))
if (accountType == AppUtils.getString(R.string.sync_account_type) && syncAccountRawId == null) {
syncAccountRawId =
cursor.getString(cursor.getColumnIndexOrThrow(RawContacts._ID))
Log.d("[Native Contact Editor] Found linphone raw id $syncAccountRawId for native contact with id ${contact.nativeId}")
}
} catch (iae: IllegalArgumentException) {
Log.e("[Native Contact Editor] Exception: $iae")
}
} while (cursor.moveToNext() && syncAccountRawId == null)
}
@ -461,7 +470,11 @@ class NativeContactEditor(val contact: NativeContact) {
val count = cursor?.count ?: 0
val data1 = if (count > 0) {
if (cursor?.moveToFirst() == true) {
cursor.getString(cursor.getColumnIndex("data1"))
try {
cursor.getString(cursor.getColumnIndexOrThrow("data1"))
} catch (iae: IllegalArgumentException) {
Log.e("[Native Contact Editor] Exception: $iae")
}
} else null
} else null
cursor?.close()

View file

@ -87,7 +87,7 @@ class CoreContext(val context: Context, coreConfig: Config) {
"$sdkVersion ($sdkBranch, $sdkBuildType)"
}
val collator = Collator.getInstance()
val collator: Collator = Collator.getInstance()
val contactsManager: ContactsManager by lazy {
ContactsManager(context)
}

View file

@ -633,7 +633,7 @@ class NotificationsManager(private val context: Context) {
context,
notifiable.notificationId,
target,
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE
Compatibility.getUpdateCurrentPendingIntentFlag()
)
val id = LinphoneUtils.getChatRoomId(room.localAddress, room.peerAddress)
@ -888,7 +888,7 @@ class NotificationsManager(private val context: Context) {
context,
notifiable.notificationId,
replyIntent,
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE
Compatibility.getUpdateCurrentPendingIntentFlag()
)
return NotificationCompat.Action.Builder(
R.drawable.chat_send_over,

View file

@ -70,31 +70,31 @@ class FileUtils {
}
fun isPlainTextFile(path: String): Boolean {
val extension = getExtensionFromFileName(path).toLowerCase(Locale.getDefault())
val extension = getExtensionFromFileName(path).lowercase(Locale.getDefault())
val type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension)
return type?.startsWith("text/plain") ?: false
}
fun isExtensionPdf(path: String): Boolean {
val extension = getExtensionFromFileName(path).toLowerCase(Locale.getDefault())
val extension = getExtensionFromFileName(path).lowercase(Locale.getDefault())
val type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension)
return type?.startsWith("application/pdf") ?: false
}
fun isExtensionImage(path: String): Boolean {
val extension = getExtensionFromFileName(path).toLowerCase(Locale.getDefault())
val extension = getExtensionFromFileName(path).lowercase(Locale.getDefault())
val type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension)
return type?.startsWith("image/") ?: false
}
fun isExtensionVideo(path: String): Boolean {
val extension = getExtensionFromFileName(path).toLowerCase(Locale.getDefault())
val extension = getExtensionFromFileName(path).lowercase(Locale.getDefault())
val type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension)
return type?.startsWith("video/") ?: false
}
fun isExtensionAudio(path: String): Boolean {
val extension = getExtensionFromFileName(path).toLowerCase(Locale.getDefault())
val extension = getExtensionFromFileName(path).lowercase(Locale.getDefault())
val type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension)
return type?.startsWith("audio/") ?: false
}

View file

@ -205,7 +205,17 @@ class VoiceRecordProgressBar : View {
}
}
fun setProgressDrawable(drawable: Drawable) {
fun setSecondaryProgressTint(color: Int) {
val drawable = progressDrawable
if (drawable != null) {
if (drawable is LayerDrawable) {
val secondaryProgressDrawable = drawable.findDrawableByLayerId(android.R.id.secondaryProgress)
secondaryProgressDrawable?.setTint(color)
}
}
}
private fun setProgressDrawable(drawable: Drawable) {
val needUpdate: Boolean = if (progressDrawable != null && drawable !== progressDrawable) {
progressDrawable?.callback = null
true
@ -233,16 +243,6 @@ class VoiceRecordProgressBar : View {
}
}
fun setSecondaryProgressTint(color: Int) {
val drawable = progressDrawable
if (drawable != null) {
if (drawable is LayerDrawable) {
val secondaryProgressDrawable = drawable.findDrawableByLayerId(android.R.id.secondaryProgress)
secondaryProgressDrawable?.setTint(color)
}
}
}
private fun refreshProgress(id: Int, progress: Int) {
var scale: Float = if (max > 0) (progress.toFloat() / max) else 0f

View file

@ -97,6 +97,7 @@
android:id="@+id/message"
android:enabled="@{!chatSendingViewModel.isReadOnly}"
android:text="@={chatSendingViewModel.textToSend}"
android:hint="@string/chat_room_sending_message_hint"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"

View file

@ -328,6 +328,7 @@
android:layout_alignParentBottom="true"
android:background="@drawable/round_button_background"
android:padding="13dp"
android:contentDescription="@string/content_descripton_scroll_to_bottom"
android:src="@drawable/scroll_to_bottom" />
<TextView

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:linphone="http://schemas.android.com/apk/res-auto">
xmlns:linphone="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View"/>

View file

@ -192,7 +192,7 @@
<string name="content_description_menu_contacts">Contactos</string>
<string name="content_description_menu_dialer">Marcador telefónico</string>
<string name="content_description_menu_chat">Conversaciones</string>
<string name="content_description_dialer_erase">Eliminar el último caracter</string>
<string name="content_description_dialer_erase">Eliminar el último carácter</string>
<string name="content_description_add_contact">Crear contacto</string>
<string name="content_description_show_all_calls">Mostrar todas las llamadas</string>
<string name="content_description_show_missed_calls">Mostrar solo llamadas perdidad</string>

View file

@ -481,7 +481,7 @@
<string name="content_description_show_all_calls">Tous les appels</string>
<string name="content_description_incoming_call">Appel entrant</string>
<string name="content_description_outgoing_call">Appel sortant</string>
<string name="content_description_create_one_to_one_chat_room">Créer une conversation 1-1</string>
<string name="content_description_create_one_to_one_chat_room">Créer une conversation 11</string>
<string name="content_description_create_group_chat_room">Créer une conversation de groupe</string>
<string name="content_description_security_level_unsafe">Non sécurisé</string>
<string name="content_description_security_level_safe">Sécurisé</string>
@ -626,4 +626,5 @@
<string name="call_settings_use_telecom_manager_summary">Nécessite des permissions supplémentaires</string>
<string name="chat_room_unread_messages">%1$d messages non lus</string>
<string name="chat_room_unread_message">%1$d message non lu</string>
<string name="content_descripton_scroll_to_bottom">Aller au dernier message reçu ou au premier message non lu</string>
</resources>

View file

@ -737,4 +737,5 @@
<string name="content_description_cancel_voice_recording">Cancel voice recording</string>
<string name="content_description_pause_voice_recording_playback">Pause voice recording</string>
<string name="content_description_play_voice_recording">Play voice recording</string>
<string name="content_descripton_scroll_to_bottom">Scroll to bottom or first unread message</string>
</resources>