use of com.waz.zclient.views.menus.FooterMenuCallback in project wire-android by wireapp.
the class SingleParticipantFragment method onUserUpdated.
//////////////////////////////////////////////////////////////////////////////////////////
//
// SingleParticipantStoreObserver
//
//////////////////////////////////////////////////////////////////////////////////////////
@Override
public void onUserUpdated(final User user) {
if (user == null) {
return;
}
imageAssetImageViewProfile.connectImageAsset(user.getPicture());
header.setText(user.getDisplayName());
userDetailsView.setUser(user);
shieldView.setVisibility(user.getVerified() == Verification.VERIFIED ? View.VISIBLE : View.GONE);
// Show footer if profile is not for self user
if (!user.isMe()) {
if (!otherUserProfileScreenWasTracked) {
otherUserProfileScreenWasTracked = true;
}
final boolean showingCommonUser = getArguments().getBoolean(ARGUMENT_SHOWING_COMMON_USER);
final boolean ignoreRightClick = getArguments().getSerializable(ARGUMENT_USER_REQUESTER) == IConnectStore.UserRequester.CALL;
if (ignoreRightClick) {
footerMenu.setRightActionText("");
} else if (showingCommonUser) {
footerMenu.setRightActionText(getResources().getString(R.string.glyph__block));
}
footerMenu.setCallback(new FooterMenuCallback() {
@Override
public void onLeftActionClicked() {
getControllerFactory().getConversationScreenController().hideParticipants(true, false);
// Go to conversation with this user
goToConversationWithUser = true;
getContainer().dismissUserProfile();
getStoreFactory().getConversationStore().setCurrentConversation(user.getConversation(), ConversationChangeRequester.START_CONVERSATION);
}
@Override
public void onRightActionClicked() {
if (ignoreRightClick) {
return;
}
if (showingCommonUser) {
showBlockConfirmation(user);
} else {
getStoreFactory().getNetworkStore().doIfHasInternetOrNotifyUser(new NetworkAction() {
@Override
public void execute(NetworkMode networkMode) {
getContainer().showRemoveConfirmation(user);
}
@Override
public void onNoNetwork() {
ViewUtils.showAlertDialog(getActivity(), R.string.alert_dialog__no_network__header, R.string.remove_from_conversation__no_network__message, R.string.alert_dialog__confirmation, null, true);
}
});
}
}
});
if (getArguments().getSerializable(ARGUMENT_USER_REQUESTER) != IConnectStore.UserRequester.PARTICIPANTS) {
footerMenu.setVisibility(View.VISIBLE);
}
}
}
use of com.waz.zclient.views.menus.FooterMenuCallback in project wire-android by wireapp.
the class BlockedUserProfileFragment method setGroupConversationFooterMenu.
private void setGroupConversationFooterMenu(final User user) {
unblockButton.setVisibility(View.GONE);
toggleUnblockAndFooterMenu(isShowingFooterMenu);
// Hook up callbacks
footerMenu.setLeftActionLabelText(getString(R.string.connect_request__footer__blocked_label));
footerMenu.setRightActionText(getString(R.string.glyph__minus));
footerMenu.setCallback(new FooterMenuCallback() {
@Override
public void onLeftActionClicked() {
toggleUnblockAndFooterMenu(false);
}
@Override
public void onRightActionClicked() {
getContainer().showRemoveConfirmation(user);
}
});
// Split unblock / cancel buttons
cancelButton.setEnabled(true);
cancelButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
toggleUnblockAndFooterMenu(true);
}
});
smallUnblockButton.setEnabled(true);
smallUnblockButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
unblockUser(user);
}
});
}
use of com.waz.zclient.views.menus.FooterMenuCallback in project wire-android by wireapp.
the class PendingConnectRequestFragment method setFooterForOutgoingConnectRequest.
//////////////////////////////////////////////////////////////////////////////////////////
//
// UI
//
//////////////////////////////////////////////////////////////////////////////////////////
private void setFooterForOutgoingConnectRequest(final User user) {
// Show footer
footerMenu.setVisibility(View.VISIBLE);
isShowingFooterMenu = true;
footerMenu.setRightActionText("");
footerMenu.setCallback(new FooterMenuCallback() {
@Override
public void onLeftActionClicked() {
user.cancelConnection();
getActivity().onBackPressed();
}
@Override
public void onRightActionClicked() {
}
});
}
use of com.waz.zclient.views.menus.FooterMenuCallback in project wire-android by wireapp.
the class PendingConnectRequestFragment method setFooterForIncomingConnectRequest.
private void setFooterForIncomingConnectRequest(final User user) {
if (userRequester != IConnectStore.UserRequester.PARTICIPANTS) {
return;
}
footerMenu.setVisibility(View.VISIBLE);
footerMenu.setRightActionText(getString(R.string.glyph__minus));
footerMenu.setCallback(new FooterMenuCallback() {
@Override
public void onLeftActionClicked() {
IConversation conversation = user.acceptConnection();
getContainer().onAcceptedConnectRequest(conversation);
}
@Override
public void onRightActionClicked() {
getContainer().showRemoveConfirmation(user);
}
});
footerMenu.setLeftActionText(getString(R.string.glyph__plus));
footerMenu.setLeftActionLabelText(getString(R.string.send_connect_request__connect_button__text));
}
use of com.waz.zclient.views.menus.FooterMenuCallback in project wire-android by wireapp.
the class PendingConnectRequestFragment method setFooterForIgnoredConnectRequest.
private void setFooterForIgnoredConnectRequest(final User user) {
footerMenu.setVisibility(View.VISIBLE);
footerMenu.setRightActionText("");
footerMenu.setRightActionLabelText("");
footerMenu.setCallback(new FooterMenuCallback() {
@Override
public void onLeftActionClicked() {
IConversation conversation = user.acceptConnection();
getContainer().onAcceptedConnectRequest(conversation);
}
@Override
public void onRightActionClicked() {
}
});
footerMenu.setLeftActionText(getString(R.string.glyph__plus));
footerMenu.setLeftActionLabelText(getString(R.string.send_connect_request__connect_button__text));
}
Aggregations