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 {
|
companion object {
|
||||||
const val VIEW_TYPE = FlexibleItemViewType.CONTACT_ITEM
|
|
||||||
private const val FULLY_OPAQUE: Float = 1.0f
|
private const val FULLY_OPAQUE: Float = 1.0f
|
||||||
private const val SEMI_TRANSPARENT: Float = 0.38f
|
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_HEADER_ITEM: Int = 1120391234
|
||||||
const val POLL_RESULT_VOTER_ITEM: Int = 1120391235
|
const val POLL_RESULT_VOTER_ITEM: Int = 1120391235
|
||||||
const val POLL_RESULT_VOTERS_OVERVIEW_ITEM: Int = 1120391236
|
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 org.greenrobot.eventbus.ThreadMode
|
||||||
import retrofit2.HttpException
|
import retrofit2.HttpException
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.util.Objects
|
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@ -1483,10 +1482,9 @@ class ConversationsListActivity :
|
|||||||
override fun onItemClick(view: View, position: Int): Boolean {
|
override fun onItemClick(view: View, position: Int): Boolean {
|
||||||
val item = adapter?.getItem(position)
|
val item = adapter?.getItem(position)
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
when (item.itemViewType) {
|
when (item) {
|
||||||
MessageResultItem.VIEW_TYPE -> {
|
is MessageResultItem -> {
|
||||||
val messageItem: MessageResultItem = item as MessageResultItem
|
val token = item.messageEntry.conversationToken
|
||||||
val token = messageItem.messageEntry.conversationToken
|
|
||||||
val conversationName = (
|
val conversationName = (
|
||||||
conversationItems.first {
|
conversationItems.first {
|
||||||
(it is ConversationItem) && it.model.token == token
|
(it is ConversationItem) && it.model.token == token
|
||||||
@ -1500,27 +1498,26 @@ class ConversationsListActivity :
|
|||||||
bundle.putString(BundleKeys.KEY_CREDENTIALS, credentials!!)
|
bundle.putString(BundleKeys.KEY_CREDENTIALS, credentials!!)
|
||||||
bundle.putString(BundleKeys.KEY_BASE_URL, currentUser!!.baseUrl)
|
bundle.putString(BundleKeys.KEY_BASE_URL, currentUser!!.baseUrl)
|
||||||
bundle.putString(KEY_ROOM_TOKEN, token)
|
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)
|
bundle.putString(BundleKeys.KEY_CONVERSATION_NAME, conversationName)
|
||||||
ContextChatCompose(bundle).GetDialogView(shouldDismiss, context)
|
ContextChatCompose(bundle).GetDialogView(shouldDismiss, context)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadMoreResultsItem.VIEW_TYPE -> {
|
is LoadMoreResultsItem -> {
|
||||||
loadMoreMessages()
|
loadMoreMessages()
|
||||||
}
|
}
|
||||||
|
|
||||||
ConversationItem.VIEW_TYPE -> {
|
is ConversationItem -> {
|
||||||
handleConversation((Objects.requireNonNull(item) as ConversationItem).model)
|
handleConversation(item.model)
|
||||||
}
|
}
|
||||||
|
|
||||||
ContactItem.VIEW_TYPE -> {
|
is ContactItem -> {
|
||||||
val contact = item as ContactItem
|
|
||||||
contactsViewModel.createRoom(
|
contactsViewModel.createRoom(
|
||||||
ROOM_TYPE_ONE_ONE,
|
ROOM_TYPE_ONE_ONE,
|
||||||
null,
|
null,
|
||||||
contact.model.actorId!!,
|
item.model.actorId!!,
|
||||||
null
|
null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -148,13 +148,12 @@ class MessageSearchActivity : BaseActivity() {
|
|||||||
adapter!!.addListener(object : FlexibleAdapter.OnItemClickListener {
|
adapter!!.addListener(object : FlexibleAdapter.OnItemClickListener {
|
||||||
override fun onItemClick(view: View?, position: Int): Boolean {
|
override fun onItemClick(view: View?, position: Int): Boolean {
|
||||||
val item = adapter!!.getItem(position)
|
val item = adapter!!.getItem(position)
|
||||||
when (item?.itemViewType) {
|
when (item) {
|
||||||
LoadMoreResultsItem.VIEW_TYPE -> {
|
is LoadMoreResultsItem -> {
|
||||||
viewModel.loadMore()
|
viewModel.loadMore()
|
||||||
}
|
}
|
||||||
MessageResultItem.VIEW_TYPE -> {
|
is MessageResultItem -> {
|
||||||
val messageItem = item as MessageResultItem
|
viewModel.selectMessage(item.messageEntry)
|
||||||
viewModel.selectMessage(messageItem.messageEntry)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user