use of cx.ring.facades.ConversationFacade in project ring-client-android by savoirfairelinux.
the class ConversationPresenter method update.
@Override
public void update(Observable observable, ServiceEvent event) {
if (observable instanceof AccountService && event != null) {
if (event.getEventType() == ServiceEvent.EventType.REGISTERED_NAME_FOUND) {
final String name = event.getEventInput(ServiceEvent.EventInput.NAME, String.class);
final String address = event.getEventInput(ServiceEvent.EventInput.ADDRESS, String.class);
final int state = event.getEventInput(ServiceEvent.EventInput.STATE, Integer.class);
getView().updateView(address, name, state);
}
} else if (observable instanceof ConversationFacade && event != null) {
switch(event.getEventType()) {
case DATA_TRANSFER:
getView().refreshView(mConversation);
getView().scrollToEnd();
break;
case DATA_TRANSFER_UPDATE:
{
DataTransfer transfer = event.getEventInput(ServiceEvent.EventInput.TRANSFER_INFO, DataTransfer.class);
getView().updateTransfer(transfer);
break;
}
case INCOMING_MESSAGE:
getView().refreshView(mConversation);
getView().scrollToEnd();
break;
case CONVERSATIONS_CHANGED:
loadHistory();
break;
}
}
}
use of cx.ring.facades.ConversationFacade in project ring-client-android by savoirfairelinux.
the class ServiceInjectionModule method provideConversationFacade.
@Provides
@Singleton
ConversationFacade provideConversationFacade(ContactService contactService, HistoryService historyService, CallService callService, AccountService accountService) {
ConversationFacade conversationFacade = new ConversationFacade(historyService, callService, contactService, accountService);
mRingApplication.getRingInjectionComponent().inject(conversationFacade);
return conversationFacade;
}
Aggregations