mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-23 13:40:43 +01:00
Add long click menu for conversations
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
4df3284a37
commit
d4f941d29f
@ -93,7 +93,8 @@ import retrofit2.HttpException;
|
|||||||
|
|
||||||
@AutoInjector(NextcloudTalkApplication.class)
|
@AutoInjector(NextcloudTalkApplication.class)
|
||||||
public class CallsListController extends BaseController implements SearchView.OnQueryTextListener,
|
public class CallsListController extends BaseController implements SearchView.OnQueryTextListener,
|
||||||
FlexibleAdapter.OnItemClickListener, FastScroller.OnScrollStateChangeListener {
|
FlexibleAdapter.OnItemClickListener, FlexibleAdapter.OnItemLongClickListener, FastScroller
|
||||||
|
.OnScrollStateChangeListener {
|
||||||
|
|
||||||
public static final String TAG = "CallsListController";
|
public static final String TAG = "CallsListController";
|
||||||
|
|
||||||
@ -382,9 +383,9 @@ public class CallsListController extends BaseController implements SearchView.On
|
|||||||
fastScroller.setBubbleTextCreator(position -> {
|
fastScroller.setBubbleTextCreator(position -> {
|
||||||
String displayName;
|
String displayName;
|
||||||
if (shouldUseLastMessageLayout) {
|
if (shouldUseLastMessageLayout) {
|
||||||
displayName = ((ConversationItem)adapter.getItem(position)).getModel().getDisplayName();
|
displayName = ((ConversationItem) adapter.getItem(position)).getModel().getDisplayName();
|
||||||
} else {
|
} else {
|
||||||
displayName = ((CallItem)adapter.getItem(position)).getModel().getDisplayName();
|
displayName = ((CallItem) adapter.getItem(position)).getModel().getDisplayName();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (displayName.length() > 8) {
|
if (displayName.length() > 8) {
|
||||||
@ -522,9 +523,9 @@ public class CallsListController extends BaseController implements SearchView.On
|
|||||||
if (clickedItem != null && getActivity() != null) {
|
if (clickedItem != null && getActivity() != null) {
|
||||||
Conversation conversation;
|
Conversation conversation;
|
||||||
if (shouldUseLastMessageLayout) {
|
if (shouldUseLastMessageLayout) {
|
||||||
conversation = ((ConversationItem)clickedItem).getModel();
|
conversation = ((ConversationItem) clickedItem).getModel();
|
||||||
} else {
|
} else {
|
||||||
conversation = ((CallItem)clickedItem).getModel();
|
conversation = ((CallItem) clickedItem).getModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
@ -556,4 +557,22 @@ public class CallsListController extends BaseController implements SearchView.On
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemLongClick(int position) {
|
||||||
|
if (currentUser.hasSpreedCapabilityWithName("last-room-activity")) {
|
||||||
|
Object clickedItem = adapter.getItem(position);
|
||||||
|
if (clickedItem != null) {
|
||||||
|
Conversation conversation;
|
||||||
|
if (shouldUseLastMessageLayout) {
|
||||||
|
conversation = ((ConversationItem) clickedItem).getModel();
|
||||||
|
} else {
|
||||||
|
conversation = ((CallItem) clickedItem).getModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
MoreMenuClickEvent moreMenuClickEvent = new MoreMenuClickEvent(conversation);
|
||||||
|
onMessageEvent(moreMenuClickEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user