use of com.waz.zclient.core.controllers.tracking.events.filetransfer.SelectedTooLargeFileEvent in project wire-android by wireapp.
the class ConversationFragment method onSyncError.
@Override
public void onSyncError(final ErrorsList.ErrorDescription errorDescription) {
switch(errorDescription.getType()) {
case CANNOT_SEND_ASSET_FILE_NOT_FOUND:
ViewUtils.showAlertDialog(getActivity(), R.string.asset_upload_error__not_found__title, R.string.asset_upload_error__not_found__message, R.string.asset_upload_error__not_found__button, null, true);
errorDescription.dismiss();
break;
case CANNOT_SEND_ASSET_TOO_LARGE:
AlertDialog dialog = ViewUtils.showAlertDialog(getActivity(), R.string.asset_upload_error__file_too_large__title, R.string.asset_upload_error__file_too_large__message_default, R.string.asset_upload_error__file_too_large__button, null, true);
long maxAllowedSizeInBytes = AssetFactory.getMaxAllowedAssetSizeInBytes();
if (maxAllowedSizeInBytes > 0) {
String maxFileSize = Formatter.formatShortFileSize(getContext(), maxAllowedSizeInBytes);
dialog.setMessage(getString(R.string.asset_upload_error__file_too_large__message, maxFileSize));
}
errorDescription.dismiss();
((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new SelectedTooLargeFileEvent());
break;
case RECORDING_FAILURE:
ViewUtils.showAlertDialog(getActivity(), R.string.audio_message__recording__failure__title, R.string.audio_message__recording__failure__message, R.string.alert_dialog__confirmation, null, true);
errorDescription.dismiss();
break;
case CANNOT_SEND_MESSAGE_TO_UNVERIFIED_CONVERSATION:
onErrorCanNotSentMessageToUnverifiedConversation(errorDescription);
break;
}
}
Aggregations