Updated gradle to 8.1.3, added missing input type to chat text field & correct default icon for group chat rooms

This commit is contained in:
Sylvain Berfini 2023-11-08 13:57:43 +01:00
parent e61a6a0b7f
commit 8cbe832a67
9 changed files with 25 additions and 14 deletions

View file

@ -12,5 +12,7 @@ abstract class AbstractAvatarModel {
val images = MutableLiveData<ArrayList<String>>()
val showConferenceIcon = MutableLiveData<Boolean>()
val forceConferenceIcon = MutableLiveData<Boolean>()
val defaultToConferenceIcon = MutableLiveData<Boolean>()
}

View file

@ -63,7 +63,7 @@ class CallModel @WorkerThread constructor(val call: Call) {
val conferenceInfo = coreContext.core.findConferenceInformationFromUri(call.remoteAddress)
if (conferenceInfo != null) {
displayName.postValue(conferenceInfo.subject)
avatarModel.showConferenceIcon.postValue(true)
avatarModel.forceConferenceIcon.postValue(true)
} else {
displayName.postValue(friend?.name ?: LinphoneUtils.getDisplayName(call.remoteAddress))
}

View file

@ -798,7 +798,7 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() {
fakeFriend.name = conferenceInfo?.subject ?: LinphoneUtils.getDisplayName(address)
fakeFriend.addAddress(address)
val model = ContactAvatarModel(fakeFriend)
model.showConferenceIcon.postValue(conferenceInfo != null)
model.forceConferenceIcon.postValue(conferenceInfo != null)
model.trust.postValue(securityLevel)
contact.postValue(model)
displayedName.postValue(fakeFriend.name)

View file

@ -146,6 +146,7 @@ class ConversationModel @WorkerThread constructor(val chatRoom: ChatRoom) {
if (isGroup) {
val fakeFriend = coreContext.core.createFriend()
val model = ContactAvatarModel(fakeFriend)
model.defaultToConferenceIcon.postValue(true)
model.setPicturesFromFriends(friends)
avatarModel.postValue(model)
} else {

View file

@ -66,7 +66,7 @@ class CallLogModel @WorkerThread constructor(private val callLog: CallLog) {
}
avatarModel = ContactAvatarModel(fakeFriend)
avatarModel.showConferenceIcon.postValue(true)
avatarModel.forceConferenceIcon.postValue(true)
friendRefKey = null
friendExists = false
} else {

View file

@ -98,7 +98,7 @@ class ContactHistoryViewModel @UiThread constructor() : ViewModel() {
val conferenceInfo = coreContext.core.findConferenceInformationFromUri(address)
if (conferenceInfo != null) {
model.avatarModel.name.postValue(conferenceInfo.subject)
model.avatarModel.showConferenceIcon.postValue(true)
model.avatarModel.forceConferenceIcon.postValue(true)
}
callLogModel.postValue(model)

View file

@ -361,7 +361,7 @@ private suspend fun loadContactPictureWithCoil(
val context = imageView.context
if (model != null) {
if (model.showConferenceIcon.value == true) {
if (model.forceConferenceIcon.value == true) {
imageView.load(
ResourcesCompat.getDrawable(
context.resources,
@ -406,11 +406,19 @@ private suspend fun loadContactPictureWithCoil(
withContext(Dispatchers.IO) {
val initials = model.initials.value.orEmpty()
if (initials.isEmpty() || initials == "+") {
ResourcesCompat.getDrawable(
context.resources,
R.drawable.user_circle,
context.theme
)
if (model.defaultToConferenceIcon.value == true) {
ResourcesCompat.getDrawable(
context.resources,
R.drawable.inset_users_three,
context.theme
)
} else {
ResourcesCompat.getDrawable(
context.resources,
R.drawable.inset_user_circle,
context.theme
)
}
} else {
val builder = AvatarGenerator(context)
builder.setInitials(model.initials.value.orEmpty())

View file

@ -89,7 +89,7 @@
android:textColorHint="@color/gray_main2_400"
android:maxLines="3"
android:hint="@string/conversation_text_field_hint"
android:inputType="text"
android:inputType="text|textCapSentences|textAutoCorrect"
app:layout_constraintTop_toBottomOf="@id/emoji_picker"
app:layout_constraintStart_toStartOf="@id/message_area_background"
app:layout_constraintEnd_toStartOf="@id/send_barrier"

View file

@ -9,8 +9,8 @@ buildscript {
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '8.1.2' apply false
id 'com.android.library' version '8.1.2' apply false
id 'com.android.application' version '8.1.3' apply false
id 'com.android.library' version '8.1.3' apply false
id 'org.jetbrains.kotlin.android' version '1.9.0-RC' apply false
id 'com.google.gms.google-services' version '4.3.15' apply false
}