Merge pull request #1592 from k9mail/hide_crypto_status_icon

Hide crypto status icon if no crypto provider is configured
This commit is contained in:
cketti 2016-09-10 23:29:46 +02:00 committed by GitHub
commit 41d6f3511f
2 changed files with 12 additions and 1 deletions

View file

@ -233,7 +233,11 @@ public class MessageViewFragment extends Fragment implements ConfirmationDialogF
mMessageView, mAccount, messageViewInfo);
if (!handledByCryptoPresenter) {
mMessageView.showMessage(mAccount, messageViewInfo);
mMessageView.getMessageHeaderView().setCryptoStatusDisabled();
if (mAccount.isOpenPgpProviderConfigured()) {
mMessageView.getMessageHeaderView().setCryptoStatusDisabled();
} else {
mMessageView.getMessageHeaderView().hideCryptoStatus();
}
}
}

View file

@ -342,18 +342,25 @@ public class MessageHeader extends LinearLayout implements OnClickListener, OnLo
}
}
public void hideCryptoStatus() {
mCryptoStatusIcon.setVisibility(View.GONE);
}
public void setCryptoStatusLoading() {
mCryptoStatusIcon.setVisibility(View.VISIBLE);
mCryptoStatusIcon.setEnabled(false);
mCryptoStatusIcon.setCryptoDisplayStatus(MessageCryptoDisplayStatus.LOADING);
}
public void setCryptoStatusDisabled() {
mCryptoStatusIcon.setVisibility(View.VISIBLE);
mCryptoStatusIcon.setEnabled(false);
mCryptoStatusIcon.setCryptoDisplayStatus(MessageCryptoDisplayStatus.DISABLED);
}
public void setCryptoStatus(MessageCryptoDisplayStatus displayStatus) {
mCryptoStatusIcon.setVisibility(View.VISIBLE);
mCryptoStatusIcon.setEnabled(true);
mCryptoStatusIcon.setCryptoDisplayStatus(displayStatus);
}