use of com.xabber.android.presentation.ui.contactlist.viewobjects.ContactVO in project xabber-android by redsolution.
the class ContactListPresenter method onItemClick.
public void onItemClick(IFlexible item) {
if (item instanceof ContactVO) {
AccountJid accountJid = ((ContactVO) item).getAccountJid();
UserJid userJid = ((ContactVO) item).getUserJid();
if (view != null)
view.onContactClick(RosterManager.getInstance().getAbstractContact(accountJid, userJid));
} else if (item instanceof ButtonVO) {
ButtonVO button = (ButtonVO) item;
if (view != null)
view.onButtonItemClick(button);
} else if (item instanceof CrowdfundingChatVO) {
if (view != null) {
AccountJid accountJid = CrowdfundingChat.getDefaultAccount();
UserJid userJid = CrowdfundingChat.getDefaultUser();
if (accountJid != null && userJid != null)
view.onContactClick(RosterManager.getInstance().getAbstractContact(accountJid, userJid));
}
}
}
use of com.xabber.android.presentation.ui.contactlist.viewobjects.ContactVO in project xabber-android by redsolution.
the class RecentChatFragment method onContactAvatarClick.
@Override
public void onContactAvatarClick(int adapterPosition) {
IFlexible item = adapter.getItem(adapterPosition);
if (item != null && item instanceof ContactVO) {
Intent intent;
AccountJid accountJid = ((ContactVO) item).getAccountJid();
UserJid userJid = ((ContactVO) item).getUserJid();
if (MUCManager.getInstance().hasRoom(accountJid, userJid)) {
intent = ContactActivity.createIntent(getActivity(), accountJid, userJid);
} else {
intent = ContactEditActivity.createIntent(getActivity(), accountJid, userJid);
}
getActivity().startActivity(intent);
}
}
use of com.xabber.android.presentation.ui.contactlist.viewobjects.ContactVO in project xabber-android by redsolution.
the class ContactListFragment method onContactAvatarClick.
@Override
public void onContactAvatarClick(int adapterPosition) {
IFlexible item = adapter.getItem(adapterPosition);
if (item != null && item instanceof ContactVO) {
Intent intent;
AccountJid accountJid = ((ContactVO) item).getAccountJid();
UserJid userJid = ((ContactVO) item).getUserJid();
if (MUCManager.getInstance().hasRoom(accountJid, userJid)) {
intent = ContactActivity.createIntent(getActivity(), accountJid, userJid);
} else {
intent = ContactEditActivity.createIntent(getActivity(), accountJid, userJid);
}
getActivity().startActivity(intent);
}
}
use of com.xabber.android.presentation.ui.contactlist.viewobjects.ContactVO in project xabber-android by redsolution.
the class ContactListFragment method onItemContextMenu.
@Override
public void onItemContextMenu(int adapterPosition, ContextMenu menu) {
IFlexible item = adapter.getItem(adapterPosition);
if (item != null && item instanceof ContactVO) {
AccountJid accountJid = ((ContactVO) item).getAccountJid();
UserJid userJid = ((ContactVO) item).getUserJid();
AbstractContact abstractContact = RosterManager.getInstance().getAbstractContact(accountJid, userJid);
ContextMenuHelper.createContactContextMenu(getActivity(), presenter, abstractContact, menu);
return;
}
if (item != null && item instanceof GroupVO) {
AccountJid accountJid = ((GroupVO) item).getAccountJid();
ContextMenuHelper.createGroupContextMenu(getActivity(), presenter, accountJid, ((GroupVO) item).getGroupName(), menu);
return;
}
}
Aggregations