Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6f48050 authored by Vincent Breitmoser's avatar Vincent Breitmoser
Browse files

messageview: move MessageCryptoMvpView into a var instead of implementing directly

parent 837aa704
Loading
Loading
Loading
Loading
+27 −25
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ import com.fsck.k9.view.MessageHeader;


public class MessageViewFragment extends Fragment implements ConfirmationDialogFragmentListener,
        AttachmentViewCallback, MessageCryptoMvpView, OnClickShowCryptoKeyListener {
        AttachmentViewCallback, OnClickShowCryptoKeyListener {

    private static final String ARG_REFERENCE = "reference";

@@ -128,7 +128,7 @@ public class MessageViewFragment extends Fragment implements ConfirmationDialogF
        Context context = getActivity().getApplicationContext();
        mController = MessagingController.getInstance(context);
        downloadManager = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
        messageCryptoPresenter = new MessageCryptoPresenter(this);
        messageCryptoPresenter = new MessageCryptoPresenter(messageCryptoMvpView);
        messageLoaderHelper =
                new MessageLoaderHelper(context, getLoaderManager(), getFragmentManager(), messageLoaderCallbacks);
        mInitialized = true;
@@ -643,6 +643,7 @@ public class MessageViewFragment extends Fragment implements ConfirmationDialogF
        // mMessageView.refreshAttachmentThumbnail(attachment);
    }

    private MessageCryptoMvpView messageCryptoMvpView = new MessageCryptoMvpView() {
        @Override
        public void startPendingIntentForCryptoPresenter(IntentSender si, Integer requestCode, Intent fillIntent,
                int flagsMask, int flagValues, int extraFlags) throws SendIntentException {
@@ -659,7 +660,7 @@ public class MessageViewFragment extends Fragment implements ConfirmationDialogF
        @Override
        public void showCryptoInfoDialog(MessageCryptoDisplayStatus displayStatus) {
            CryptoInfoDialog dialog = CryptoInfoDialog.newInstance(displayStatus);
        dialog.setTargetFragment(this, 0);
            dialog.setTargetFragment(MessageViewFragment.this, 0);
            dialog.show(getFragmentManager(), "crypto_info_dialog");
        }

@@ -668,6 +669,7 @@ public class MessageViewFragment extends Fragment implements ConfirmationDialogF
            mMessageView.setToLoadingState();
            messageLoaderHelper.restartMessageCryptoProcessing();
        }
    };

    @Override
    public void onClickShowCryptoKey() {
@@ -691,7 +693,7 @@ public class MessageViewFragment extends Fragment implements ConfirmationDialogF
    }


    MessageLoaderCallbacks messageLoaderCallbacks = new MessageLoaderCallbacks() {
    private MessageLoaderCallbacks messageLoaderCallbacks = new MessageLoaderCallbacks() {
        @Override
        public void onMessageDataLoadFinished(LocalMessage message) {
            mMessage = message;