mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-09 13:59:48 +01:00
Merge pull request #5127 from nextcloud/bugfix/5126/fixContactNotClickable
fix that contact in search is clickable
This commit is contained in:
commit
36c8f421c2
@ -194,7 +194,6 @@ class ContactItem(
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val VIEW_TYPE = FlexibleItemViewType.CONTACT_ITEM
|
||||
private const val FULLY_OPAQUE: Float = 1.0f
|
||||
private const val SEMI_TRANSPARENT: Float = 0.38f
|
||||
}
|
||||
|
@ -14,5 +14,4 @@ object FlexibleItemViewType {
|
||||
const val POLL_RESULT_HEADER_ITEM: Int = 1120391234
|
||||
const val POLL_RESULT_VOTER_ITEM: Int = 1120391235
|
||||
const val POLL_RESULT_VOTERS_OVERVIEW_ITEM: Int = 1120391236
|
||||
const val CONTACT_ITEM: Int = 2131558687
|
||||
}
|
||||
|
@ -163,7 +163,6 @@ import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
import retrofit2.HttpException
|
||||
import java.io.File
|
||||
import java.util.Objects
|
||||
import java.util.concurrent.TimeUnit
|
||||
import javax.inject.Inject
|
||||
|
||||
@ -1483,10 +1482,9 @@ class ConversationsListActivity :
|
||||
override fun onItemClick(view: View, position: Int): Boolean {
|
||||
val item = adapter?.getItem(position)
|
||||
if (item != null) {
|
||||
when (item.itemViewType) {
|
||||
MessageResultItem.VIEW_TYPE -> {
|
||||
val messageItem: MessageResultItem = item as MessageResultItem
|
||||
val token = messageItem.messageEntry.conversationToken
|
||||
when (item) {
|
||||
is MessageResultItem -> {
|
||||
val token = item.messageEntry.conversationToken
|
||||
val conversationName = (
|
||||
conversationItems.first {
|
||||
(it is ConversationItem) && it.model.token == token
|
||||
@ -1500,27 +1498,26 @@ class ConversationsListActivity :
|
||||
bundle.putString(BundleKeys.KEY_CREDENTIALS, credentials!!)
|
||||
bundle.putString(BundleKeys.KEY_BASE_URL, currentUser!!.baseUrl)
|
||||
bundle.putString(KEY_ROOM_TOKEN, token)
|
||||
bundle.putString(BundleKeys.KEY_MESSAGE_ID, messageItem.messageEntry.messageId)
|
||||
bundle.putString(BundleKeys.KEY_MESSAGE_ID, item.messageEntry.messageId)
|
||||
bundle.putString(BundleKeys.KEY_CONVERSATION_NAME, conversationName)
|
||||
ContextChatCompose(bundle).GetDialogView(shouldDismiss, context)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LoadMoreResultsItem.VIEW_TYPE -> {
|
||||
is LoadMoreResultsItem -> {
|
||||
loadMoreMessages()
|
||||
}
|
||||
|
||||
ConversationItem.VIEW_TYPE -> {
|
||||
handleConversation((Objects.requireNonNull(item) as ConversationItem).model)
|
||||
is ConversationItem -> {
|
||||
handleConversation(item.model)
|
||||
}
|
||||
|
||||
ContactItem.VIEW_TYPE -> {
|
||||
val contact = item as ContactItem
|
||||
is ContactItem -> {
|
||||
contactsViewModel.createRoom(
|
||||
ROOM_TYPE_ONE_ONE,
|
||||
null,
|
||||
contact.model.actorId!!,
|
||||
item.model.actorId!!,
|
||||
null
|
||||
)
|
||||
}
|
||||
|
@ -148,13 +148,12 @@ class MessageSearchActivity : BaseActivity() {
|
||||
adapter!!.addListener(object : FlexibleAdapter.OnItemClickListener {
|
||||
override fun onItemClick(view: View?, position: Int): Boolean {
|
||||
val item = adapter!!.getItem(position)
|
||||
when (item?.itemViewType) {
|
||||
LoadMoreResultsItem.VIEW_TYPE -> {
|
||||
when (item) {
|
||||
is LoadMoreResultsItem -> {
|
||||
viewModel.loadMore()
|
||||
}
|
||||
MessageResultItem.VIEW_TYPE -> {
|
||||
val messageItem = item as MessageResultItem
|
||||
viewModel.selectMessage(messageItem.messageEntry)
|
||||
is MessageResultItem -> {
|
||||
viewModel.selectMessage(item.messageEntry)
|
||||
}
|
||||
}
|
||||
return false
|
||||
|
Loading…
Reference in New Issue
Block a user