use of com.waz.api.IConversation in project wire-android by wireapp.
the class ScalaConversationStore method loadConnectRequestInboxConversations.
@Override
public void loadConnectRequestInboxConversations(OnInboxLoadedListener onConversationsLoadedListener, InboxLoadRequester inboxLoadRequester) {
final List<IConversation> matches = new ArrayList<>();
for (int i = 0; i < inboxList.size(); i++) {
IConversation conversation = inboxList.get(i);
if (isPendingIncomingConnectRequest(conversation)) {
matches.add(conversation);
}
}
onConversationsLoadedListener.onConnectRequestInboxConversationsLoaded(matches, inboxLoadRequester);
}
use of com.waz.api.IConversation in project wire-android by wireapp.
the class ScalaConversationStore method getNextConversation.
@Override
public IConversation getNextConversation() {
if (conversationsList == null || conversationsList.size() == 0) {
return null;
}
for (int i = 0; i < conversationsList.size(); i++) {
IConversation previousConversation = i >= 1 ? conversationsList.get(i - 1) : null;
IConversation conversation = conversationsList.get(i);
IConversation nextConversation = i == (conversationsList.size() - 1) ? null : conversationsList.get(i + 1);
if (selectedConversation.equals(conversation)) {
if (nextConversation != null) {
return nextConversation;
}
return previousConversation;
}
}
return null;
}
use of com.waz.api.IConversation in project wire-android by wireapp.
the class ScalaConversationStore method setCurrentConversation.
@Override
public void setCurrentConversation(IConversation conversation, ConversationChangeRequester conversationChangerSender) {
if (conversation instanceof InboxLinkConversation) {
conversation = inboxList.get(0);
}
if (conversation != null) {
conversation.setArchived(false);
}
if (conversation != null) {
Timber.i("Set current conversation to %s, requester %s", conversation.getName(), conversationChangerSender);
} else {
Timber.i("Set current conversation to null, requester %s", conversationChangerSender);
}
this.conversationChangeRequester = conversationChangerSender;
IConversation oldConversation = conversationChangerSender == ConversationChangeRequester.FIRST_LOAD ? null : selectedConversation;
conversationsList.setSelectedConversation(conversation);
if (oldConversation == null || (oldConversation != null && conversation != null && oldConversation.getId().equals(conversation.getId()))) {
// Notify explicitly if the conversation doesn't change, the UiSginal notifies only when the conversation changes
notifyCurrentConversationHasChanged(oldConversation, conversation, conversationChangerSender);
}
}
use of com.waz.api.IConversation in project wire-android by wireapp.
the class RootFragment method dismissInboxFragment.
@Override
public void dismissInboxFragment() {
IConversation nextConversation = getStoreFactory().getConversationStore().getNextConversation();
if (nextConversation == null) {
return;
}
getStoreFactory().getConversationStore().setCurrentConversation(nextConversation, ConversationChangeRequester.START_CONVERSATION);
}
use of com.waz.api.IConversation in project wire-android by wireapp.
the class ConnectRequestInboxAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder;
if (convertView == null) {
convertView = new ConnectRequestInboxRow(parent.getContext());
viewHolder = new ViewHolder();
viewHolder.nameView = ViewUtils.getView(convertView, R.id.ttv__connect_request__display_name);
viewHolder.separatorView = ViewUtils.getView(convertView, R.id.v__connect_request__separator_line);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
// Set valuesCon
IConversation request = getItem(position);
viewHolder.nameView.setText(request.getName());
TextViewUtils.boldText(viewHolder.nameView);
((ConnectRequestInboxRow) convertView).setConnectActionCallback(connectActionsCallback);
((ConnectRequestInboxRow) convertView).setAccentColor(accentColor);
((ConnectRequestInboxRow) convertView).loadUser(request.getOtherParticipant());
if (LayoutSpec.isPhone(context)) {
if (position == 0) {
viewHolder.separatorView.setVisibility(View.GONE);
} else {
viewHolder.separatorView.setVisibility(View.VISIBLE);
}
}
return convertView;
}
Aggregations