mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-14 00:05:04 +01:00
Clean up image code in conversation info
This commit is contained in:
parent
c38ebd5687
commit
d73dd44c4a
@ -706,6 +706,10 @@ class ChatController(args: Bundle) : BaseController(), MessagesListAdapter
|
||||
override fun onDetach(view: View) {
|
||||
eventBus.unregister(this)
|
||||
|
||||
if (actionBar != null) {
|
||||
actionBar?.setIcon(null)
|
||||
}
|
||||
|
||||
if (activity != null) {
|
||||
activity?.findViewById<View>(R.id.toolbar)
|
||||
?.setOnClickListener(null)
|
||||
@ -740,15 +744,6 @@ class ChatController(args: Bundle) : BaseController(), MessagesListAdapter
|
||||
public override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
|
||||
if (activity != null) {
|
||||
activity?.findViewById<View>(R.id.toolbar)
|
||||
?.setOnClickListener(null)
|
||||
}
|
||||
|
||||
if (actionBar != null) {
|
||||
actionBar?.setIcon(null)
|
||||
}
|
||||
|
||||
adapter = null
|
||||
inConversation = false
|
||||
}
|
||||
|
@ -69,6 +69,7 @@ import com.nextcloud.talk.models.json.participants.Participant
|
||||
import com.nextcloud.talk.models.json.participants.ParticipantsOverall
|
||||
import com.nextcloud.talk.newarch.local.models.UserNgEntity
|
||||
import com.nextcloud.talk.newarch.local.models.getCredentials
|
||||
import com.nextcloud.talk.newarch.utils.Images
|
||||
import com.nextcloud.talk.utils.ApiUtils
|
||||
import com.nextcloud.talk.utils.DateUtils
|
||||
import com.nextcloud.talk.utils.DisplayUtils
|
||||
@ -658,7 +659,7 @@ class ConversationInfoController(args: Bundle) : BaseController(),
|
||||
deleteConversationAction.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
if (Conversation.ConversationType.SYSTEM_CONVERSATION == conversation!!.type) {
|
||||
if (SYSTEM_CONVERSATION == conversation!!.type) {
|
||||
muteCalls.visibility = View.GONE
|
||||
}
|
||||
|
||||
@ -813,40 +814,18 @@ class ConversationInfoController(args: Bundle) : BaseController(),
|
||||
}
|
||||
|
||||
private fun loadConversationAvatar() {
|
||||
when (conversation!!.type) {
|
||||
ONE_TO_ONE_CONVERSATION -> if (!TextUtils.isEmpty
|
||||
(conversation!!.name)
|
||||
) {
|
||||
conversation?.let {
|
||||
val conversationDrawable = Images().getImageForConversation(context, it)
|
||||
conversationDrawable?.let {
|
||||
conversationAvatarImageView.setImageDrawable(conversationDrawable)
|
||||
} ?: run {
|
||||
conversationAvatarImageView.load(ApiUtils.getUrlForAvatarWithName(
|
||||
conversationUser!!.baseUrl,
|
||||
conversation!!.name, R.dimen.avatar_size_big
|
||||
it.name, R.dimen.avatar_size_big
|
||||
)) {
|
||||
transformations(CircleCropTransformation())
|
||||
}
|
||||
}
|
||||
GROUP_CONVERSATION -> {
|
||||
conversationAvatarImageView.load(R.drawable.ic_people_group_white_24px) {
|
||||
transformations(CircleCropTransformation())
|
||||
}
|
||||
}
|
||||
PUBLIC_CONVERSATION -> {
|
||||
conversationAvatarImageView.load(R.drawable.ic_link_white_24px) {
|
||||
transformations(CircleCropTransformation())
|
||||
}
|
||||
}
|
||||
|
||||
SYSTEM_CONVERSATION -> {
|
||||
val layers = arrayOfNulls<Drawable>(2)
|
||||
layers[0] = context.getDrawable(R.drawable.ic_launcher_background)
|
||||
layers[1] = context.getDrawable(R.drawable.ic_launcher_foreground)
|
||||
val layerDrawable = LayerDrawable(layers)
|
||||
conversationAvatarImageView.load(layerDrawable) {
|
||||
transformations(CircleCropTransformation())
|
||||
}
|
||||
}
|
||||
|
||||
else -> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -589,7 +589,7 @@ class SettingsController : BaseController() {
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.`as`<ObservableSubscribeProxy<UserProfileOverall>>(
|
||||
AutoDispose.autoDisposable<UserProfileOverall>(scopeProvider)
|
||||
AutoDispose.autoDisposable(scopeProvider)
|
||||
)
|
||||
.subscribe({ userProfileOverall ->
|
||||
|
||||
|
@ -19,7 +19,6 @@
|
||||
-->
|
||||
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_margin="@dimen/double_margin_between_elements"
|
||||
|
Loading…
Reference in New Issue
Block a user