use of com.fsck.k9.ui.messageview.MessageContainerView.OnRenderingFinishedListener in project k-9 by k9mail.
the class MessageContainerView method displayMessageViewContainer.
public void displayMessageViewContainer(MessageViewInfo messageViewInfo, final OnRenderingFinishedListener onRenderingFinishedListener, boolean automaticallyLoadPictures, boolean hideUnsignedTextDivider, AttachmentViewCallback attachmentCallback) {
this.attachmentCallback = attachmentCallback;
resetView();
renderAttachments(messageViewInfo);
if (mSavedState != null) {
if (mSavedState.showingPictures) {
setLoadPictures(true);
}
mSavedState = null;
}
String textToDisplay = messageViewInfo.text;
if (textToDisplay != null && !isShowingPictures()) {
if (Utility.hasExternalImages(textToDisplay)) {
if (automaticallyLoadPictures) {
setLoadPictures(true);
} else {
hasHiddenExternalImages = true;
}
}
}
if (textToDisplay == null) {
textToDisplay = HtmlConverter.wrapStatusMessage(getContext().getString(R.string.webview_empty_message));
}
OnPageFinishedListener onPageFinishedListener = new OnPageFinishedListener() {
@Override
public void onPageFinished() {
onRenderingFinishedListener.onLoadFinished();
}
};
displayHtmlContentWithInlineAttachments(textToDisplay, messageViewInfo.attachmentResolver, onPageFinishedListener);
if (!TextUtils.isEmpty(messageViewInfo.extraText)) {
unsignedTextContainer.setVisibility(View.VISIBLE);
unsignedTextDivider.setVisibility(hideUnsignedTextDivider ? View.GONE : View.VISIBLE);
unsignedText.setText(messageViewInfo.extraText);
}
}
use of com.fsck.k9.ui.messageview.MessageContainerView.OnRenderingFinishedListener in project k-9 by k9mail.
the class MessageTopView method showMessage.
public void showMessage(Account account, MessageViewInfo messageViewInfo) {
resetAndPrepareMessageView(messageViewInfo);
ShowPictures showPicturesSetting = account.getShowPictures();
boolean automaticallyLoadPictures = shouldAutomaticallyLoadPictures(showPicturesSetting, messageViewInfo.message);
MessageContainerView view = (MessageContainerView) mInflater.inflate(R.layout.message_container, containerView, false);
containerView.addView(view);
boolean hideUnsignedTextDivider = !K9.getOpenPgpSupportSignOnly();
view.displayMessageViewContainer(messageViewInfo, new OnRenderingFinishedListener() {
@Override
public void onLoadFinished() {
displayViewOnLoadFinished(true);
}
}, automaticallyLoadPictures, hideUnsignedTextDivider, attachmentCallback);
if (view.hasHiddenExternalImages()) {
showShowPicturesButton();
}
}
Aggregations