use of com.waz.api.User in project wire-android by wireapp.
the class SingleOtrClientFragmentTest method launchFragmentWithParametersAndClickShowMyFingerprint_shouldCallController.
@Test
public void launchFragmentWithParametersAndClickShowMyFingerprint_shouldCallController() {
User mockUser = mock(User.class);
OtrClient mockOtrClient = mock(OtrClient.class);
setupMocksForOtherOtrClient(mockUser, mockOtrClient);
when(mockOtrClient.getVerified()).thenReturn(Verification.UNVERIFIED);
attachFragment(SingleOtrClientFragment.newInstance(mockOtrClient, mockUser), SingleOtrClientFragment.TAG);
onView(withId(R.id.ttv__single_otr_client__my_fingerprint)).perform(click());
verify(activity.getControllerFactory().getConversationScreenController()).showCurrentOtrClient();
}
use of com.waz.api.User in project wire-android by wireapp.
the class SingleOtrClientFragmentTest method launchFragmentWithParametersAndClickResetSession_shouldCallOtrClientResetSession.
//@Test
// Pending AN-XXX
public void launchFragmentWithParametersAndClickResetSession_shouldCallOtrClientResetSession() {
User mockUser = mock(User.class);
OtrClient mockOtrClient = mock(OtrClient.class);
setupMocksForOtherOtrClient(mockUser, mockOtrClient);
when(mockOtrClient.getVerified()).thenReturn(Verification.UNVERIFIED);
attachFragment(SingleOtrClientFragment.newInstance(mockOtrClient, mockUser), SingleOtrClientFragment.TAG);
onView(withId(R.id.ttv__single_otr_client__reset)).perform(click());
verify(mockOtrClient).resetSession(any(OtrClient.ResetCallback.class));
}
use of com.waz.api.User in project wire-android by wireapp.
the class SingleOtrClientFragmentTest method launchFragmentWithParameters_shouldDisplayDisplayNameInText.
@Test
public void launchFragmentWithParameters_shouldDisplayDisplayNameInText() {
User mockUser = mock(User.class);
OtrClient mockOtrClient = mock(OtrClient.class);
setupMocksForOtherOtrClient(mockUser, mockOtrClient);
attachFragment(SingleOtrClientFragment.newInstance(mockOtrClient, mockUser), SingleOtrClientFragment.TAG);
String text = activity.getString(R.string.otr__participant__single_device__description, DEFAULT_DISPLAY_NAME);
onView(withId(R.id.ttv__single_otr_client__description)).check(hasText(text));
}
use of com.waz.api.User in project wire-android by wireapp.
the class ConnectRequestInboxFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, final ViewGroup viewContainer, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_connect_request_inbox, viewContainer, false);
ConnectActionsCallback connectActionsCallback = new ConnectActionsCallback() {
@Override
public void onAccepted(IConversation conversation) {
onAcceptedUser(conversation);
}
@Override
public void onIgnored(User user) {
onIgnoredUser(user);
}
};
inboxAdapter = new ConnectRequestInboxAdapter(getActivity(), connectActionsCallback);
inboxListView = ViewUtils.getView(rootView, R.id.crlv_connect_request_inbox__list);
if (LayoutSpec.isTablet(getActivity())) {
inboxListView.setStackFromBottom(true);
inboxListView.setTranscriptMode(AbsListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);
}
inboxListView.setAdapter(inboxAdapter);
if (savedInstanceState != null) {
visibleConversationId = savedInstanceState.getString(ARGUMENT_CONVERSATION_ID);
} else if (visibleConversationId.equals(NO_ARGUMENT_PROVIDED_CONVERSATION_ID)) {
visibleConversationId = getArguments().getString(ARGUMENT_CONVERSATION_ID);
}
return rootView;
}
use of com.waz.api.User in project wire-android by wireapp.
the class ConversationListManagerFragment method onSelectedUsers.
//////////////////////////////////////////////////////////////////////////////////////////
//
// PickUserFragment.Container
//
//////////////////////////////////////////////////////////////////////////////////////////
@Override
public void onSelectedUsers(List<User> users, ConversationChangeRequester requester) {
// TODO https://wearezeta.atlassian.net/browse/AN-3730
getControllerFactory().getPickUserController().hidePickUser(getCurrentPickerDestination(), true);
if (users.size() == 1) {
User user = users.get(0);
IConversation conversation = user.getConversation();
if (conversation != null) {
getStoreFactory().getConversationStore().setCurrentConversation(conversation, requester);
}
((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new OpenedConversationEvent(ConversationType.ONE_TO_ONE_CONVERSATION.name()));
} else {
getStoreFactory().getConversationStore().createGroupConversation(users, requester);
((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new CreatedGroupConversationEvent(false, (users.size() + 1)));
((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new OpenedConversationEvent(ConversationType.GROUP_CONVERSATION.name()));
}
}
Aggregations