Search in sources :

Example 1 with OnRenderingFinishedListener

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);
    }
}
Also used : OnPageFinishedListener(com.fsck.k9.view.MessageWebView.OnPageFinishedListener)

Example 2 with OnRenderingFinishedListener

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();
    }
}
Also used : OnRenderingFinishedListener(com.fsck.k9.ui.messageview.MessageContainerView.OnRenderingFinishedListener) ShowPictures(com.fsck.k9.Account.ShowPictures)

Aggregations

ShowPictures (com.fsck.k9.Account.ShowPictures)1 OnRenderingFinishedListener (com.fsck.k9.ui.messageview.MessageContainerView.OnRenderingFinishedListener)1 OnPageFinishedListener (com.fsck.k9.view.MessageWebView.OnPageFinishedListener)1