add drawable and use existing icon

Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
sowjanyakch 2025-05-27 17:01:39 +02:00
parent 364af7908a
commit 799b19d03a
No known key found for this signature in database
GPG Key ID: F7AA2A8B65B50220
7 changed files with 19 additions and 24 deletions

View File

@ -25,6 +25,7 @@ import com.nextcloud.talk.extensions.loadDefaultAvatar
import com.nextcloud.talk.extensions.loadDefaultGroupCallAvatar
import com.nextcloud.talk.extensions.loadFederatedUserAvatar
import com.nextcloud.talk.extensions.loadFirstLetterAvatar
import com.nextcloud.talk.extensions.loadPhoneAvatar
import com.nextcloud.talk.extensions.loadTeamAvatar
import com.nextcloud.talk.extensions.loadUserAvatar
import com.nextcloud.talk.models.domain.ConversationModel
@ -242,6 +243,10 @@ class ParticipantItem(
)
}
Participant.ActorType.PHONES ->{
holder.binding.avatarView.loadPhoneAvatar(viewThemeUtils)
}
else -> {
Log.w(TAG, "Avatar not shown because of unknown ActorType " + model.calculatedActorType)
}

View File

@ -422,7 +422,8 @@ data class ChatMessage(
AVATAR_SET,
AVATAR_REMOVED,
FEDERATED_USER_ADDED,
FEDERATED_USER_REMOVED
FEDERATED_USER_REMOVED,
PHONE_ADDED
}
companion object {

View File

@ -207,8 +207,8 @@ fun ImageView.loadAvatarWithUrl(user: User? = null, url: String): io.reactivex.d
}
fun ImageView.loadPhoneAvatar(viewThemeUtils: ViewThemeUtils): io.reactivex.disposables.Disposable {
val data: Any = viewThemeUtils.talk.themePlaceholderAvatar(this, R.drawable.outline_call_24) as Any
return loadUserAvatar(data)
val drawable = viewThemeUtils.talk.themePlaceholderAvatar(this, R.drawable.ic_phone)
return loadUserAvatar(drawable)
}
fun ImageView.loadThumbnail(url: String, user: User): io.reactivex.disposables.Disposable {

View File

@ -16,6 +16,8 @@ import com.nextcloud.talk.models.json.participants.Participant.ActorType.FEDERAT
import com.nextcloud.talk.models.json.participants.Participant.ActorType.GROUPS
import com.nextcloud.talk.models.json.participants.Participant.ActorType.GUESTS
import com.nextcloud.talk.models.json.participants.Participant.ActorType.USERS
import com.nextcloud.talk.models.json.participants.Participant.ActorType.PHONES
class EnumActorTypeConverter : StringBasedTypeConverter<Participant.ActorType>() {
override fun getFromString(string: String?): Participant.ActorType {
@ -26,6 +28,7 @@ class EnumActorTypeConverter : StringBasedTypeConverter<Participant.ActorType>()
"users" -> USERS
"circles" -> CIRCLES
"federated_users" -> FEDERATED
"phones" -> PHONES
else -> DUMMY
}
}
@ -42,6 +45,7 @@ class EnumActorTypeConverter : StringBasedTypeConverter<Participant.ActorType>()
USERS -> "users"
CIRCLES -> "circles"
FEDERATED -> "federated_users"
PHONES -> "phones"
else -> ""
}
}

View File

@ -71,6 +71,7 @@ import com.nextcloud.talk.chat.data.model.ChatMessage.SystemMessageType.RECORDIN
import com.nextcloud.talk.chat.data.model.ChatMessage.SystemMessageType.RECORDING_STOPPED
import com.nextcloud.talk.chat.data.model.ChatMessage.SystemMessageType.USER_ADDED
import com.nextcloud.talk.chat.data.model.ChatMessage.SystemMessageType.USER_REMOVED
import com.nextcloud.talk.chat.data.model.ChatMessage.SystemMessageType.PHONE_ADDED
/*
* see https://nextcloud-talk.readthedocs.io/en/latest/chat/#system-messages
@ -141,7 +142,8 @@ class EnumSystemMessageTypeConverter : StringBasedTypeConverter<ChatMessage.Syst
"avatar_removed" -> AVATAR_REMOVED
"federated_user_added" -> FEDERATED_USER_ADDED
"federated_user_removed" -> FEDERATED_USER_REMOVED
else -> DUMMY
"phone_added" -> PHONE_ADDED
else -> DUMMY
}
}
@ -210,6 +212,7 @@ class EnumSystemMessageTypeConverter : StringBasedTypeConverter<ChatMessage.Syst
AVATAR_REMOVED -> "avatar_removed"
FEDERATED_USER_ADDED -> "federated_user_added"
FEDERATED_USER_REMOVED -> "federated_user_removed"
PHONE_ADDED -> "phone_added"
else -> ""
}
}

View File

@ -117,7 +117,8 @@ data class Participant(
GUESTS,
USERS,
CIRCLES,
FEDERATED
FEDERATED,
PHONES
}
enum class ParticipantType {

View File

@ -1,19 +0,0 @@
<!--
~ Nextcloud Talk - Android Client
~
~ SPDX-FileCopyrightText: 2025 Sowjanya Kota <sowjanya.kch@gmail.com>
~ SPDX-License-Identifier: Apache-2.0
-->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:tint="#000000"
android:viewportHeight="960"
android:viewportWidth="960"
android:width="24dp">
<path android:fillColor="@android:color/white"
android:pathData="M798,840Q673,840 551,785.5Q429,731 329,631Q229,531 174.5,409Q120,287 120,162Q120,144 132,132Q144,120 162,120L324,120Q338,120 349,129.5Q360,139 362,152L388,292Q390,308 387,319Q384,330 376,338L279,436Q299,473 326.5,507.5Q354,542 387,574Q418,605 452,631.5Q486,658 524,680L618,586Q627,577 641.5,572.5Q656,568 670,570L808,598Q822,602 831,612.5Q840,623 840,636L840,798Q840,816 828,828Q816,840 798,840ZM241,360L307,294Q307,294 307,294Q307,294 307,294L290,200Q290,200 290,200Q290,200 290,200L201,200Q201,200 201,200Q201,200 201,200Q206,241 215,281Q224,321 241,360ZM599,718Q638,735 678.5,745Q719,755 760,758Q760,758 760,758Q760,758 760,758L760,670Q760,670 760,670Q760,670 760,670L666,651Q666,651 666,651Q666,651 666,651L599,718ZM241,360Q241,360 241,360Q241,360 241,360Q241,360 241,360Q241,360 241,360L241,360Q241,360 241,360Q241,360 241,360L241,360Q241,360 241,360Q241,360 241,360ZM599,718L599,718Q599,718 599,718Q599,718 599,718L599,718Q599,718 599,718Q599,718 599,718L599,718Q599,718 599,718Q599,718 599,718Q599,718 599,718Q599,718 599,718Z"/>
</vector>