mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-30 13:12:25 -05:00
OpenPGP status texts and sidebar improvements
This commit is contained in:
parent
e513af9529
commit
d46d355f69
@ -4,6 +4,7 @@ package com.fsck.k9.ui.messageview;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
@ -65,68 +66,52 @@ public class OpenPgpHeaderView extends LinearLayout {
|
|||||||
|
|
||||||
if (encrypted) {
|
if (encrypted) {
|
||||||
setStatusImage(mContext, mResultEncryptionIcon, mResultEncryptionText, STATE_ENCRYPTED);
|
setStatusImage(mContext, mResultEncryptionIcon, mResultEncryptionText, STATE_ENCRYPTED);
|
||||||
|
mResultEncryptionText.setText(R.string.openpgp_result_encrypted);
|
||||||
// MessageOpenPgpView.this.setBackgroundColor(mContext.getResources().getColor(
|
|
||||||
// R.color.openpgp_blue));
|
|
||||||
// mText.setText(R.string.openpgp_successful_decryption);
|
|
||||||
} else {
|
} else {
|
||||||
setStatusImage(mContext, mResultEncryptionIcon, mResultEncryptionText, STATE_NOT_ENCRYPTED);
|
setStatusImage(mContext, mResultEncryptionIcon, mResultEncryptionText, STATE_NOT_ENCRYPTED);
|
||||||
|
mResultEncryptionText.setText(R.string.openpgp_result_not_encrypted);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (signatureResult == null) {
|
if (signatureResult == null) {
|
||||||
setStatusImage(mContext, mResultSignatureIcon, mResultSignatureText, STATE_NOT_SIGNED);
|
setStatusImage(mContext, mResultSignatureIcon, mResultSignatureText, STATE_NOT_SIGNED);
|
||||||
|
mResultSignatureText.setText(R.string.openpgp_result_no_signature);
|
||||||
|
mResultSignatureLayout.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
switch (signatureResult.getStatus()) {
|
switch (signatureResult.getStatus()) {
|
||||||
case OpenPgpSignatureResult.SIGNATURE_ERROR:
|
case OpenPgpSignatureResult.SIGNATURE_ERROR: {
|
||||||
setStatusImage(mContext, mResultSignatureIcon, mResultSignatureText, STATE_INVALID);
|
setStatusImage(mContext, mResultSignatureIcon, mResultSignatureText, STATE_INVALID);
|
||||||
// // TODO: signature error but decryption works?
|
mResultSignatureText.setText(R.string.openpgp_result_invalid_signature);
|
||||||
// mText.setText(R.string.openpgp_signature_invalid);
|
|
||||||
// MessageOpenPgpView.this.setBackgroundColor(mContext.getResources().getColor(
|
|
||||||
// R.color.openpgp_red));
|
|
||||||
//
|
|
||||||
// mGetKeyButton.setVisibility(View.GONE);
|
// mGetKeyButton.setVisibility(View.GONE);
|
||||||
// mSignatureStatusImage.setImageResource(R.drawable.overlay_error);
|
// mSignatureStatusImage.setImageResource(R.drawable.overlay_error);
|
||||||
// mSignatureLayout.setVisibility(View.GONE);
|
mResultSignatureLayout.setVisibility(View.GONE);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case OpenPgpSignatureResult.SIGNATURE_SUCCESS_CERTIFIED:
|
case OpenPgpSignatureResult.SIGNATURE_SUCCESS_CERTIFIED: {
|
||||||
setStatusImage(mContext, mResultSignatureIcon, mResultSignatureText, STATE_VERIFIED);
|
setStatusImage(mContext, mResultSignatureIcon, mResultSignatureText, STATE_VERIFIED);
|
||||||
|
mResultSignatureText.setText(R.string.openpgp_result_signature_certified);
|
||||||
|
|
||||||
// if (signatureResult.isSignatureOnly()) {
|
|
||||||
// mText.setText(R.string.openpgp_signature_valid_certified);
|
|
||||||
// } else {
|
|
||||||
// mText.setText(R.string.openpgp_successful_decryption_valid_signature_certified);
|
|
||||||
// }
|
|
||||||
// MessageOpenPgpView.this.setBackgroundColor(mFragment.getResources().getColor(
|
|
||||||
// R.color.openpgp_green));
|
|
||||||
//
|
|
||||||
// mGetKeyButton.setVisibility(View.GONE);
|
// mGetKeyButton.setVisibility(View.GONE);
|
||||||
// mSignatureUserId.setText(signatureResult.getUserId());
|
// mSignatureUserId.setText(signatureResult.getUserId());
|
||||||
// mSignatureStatusImage.setImageResource(R.drawable.overlay_ok);
|
// mSignatureStatusImage.setImageResource(R.drawable.overlay_ok);
|
||||||
// mSignatureLayout.setVisibility(View.VISIBLE);
|
mResultSignatureLayout.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case OpenPgpSignatureResult.SIGNATURE_UNKNOWN_PUB_KEY:
|
case OpenPgpSignatureResult.SIGNATURE_UNKNOWN_PUB_KEY: {
|
||||||
setStatusImage(mContext, mResultSignatureIcon, mResultSignatureText, STATE_UNKNOWN_KEY);
|
setStatusImage(mContext, mResultSignatureIcon, mResultSignatureText, STATE_UNKNOWN_KEY);
|
||||||
|
mResultSignatureText.setText(R.string.openpgp_result_signature_missing_key);
|
||||||
|
|
||||||
// if (signatureResult.isSignatureOnly()) {
|
|
||||||
// mText.setText(R.string.openpgp_signature_unknown_text);
|
|
||||||
// } else {
|
|
||||||
// mText.setText(R.string.openpgp_successful_decryption_unknown_signature);
|
|
||||||
// }
|
|
||||||
// MessageOpenPgpView.this.setBackgroundColor(mFragment.getResources().getColor(
|
|
||||||
// R.color.openpgp_orange));
|
|
||||||
//
|
|
||||||
// mGetKeyButton.setVisibility(View.VISIBLE);
|
// mGetKeyButton.setVisibility(View.VISIBLE);
|
||||||
// mSignatureUserId.setText(R.string.openpgp_signature_unknown);
|
// mSignatureUserId.setText(R.string.openpgp_signature_unknown);
|
||||||
// mSignatureStatusImage.setImageResource(R.drawable.overlay_error);
|
// mSignatureStatusImage.setImageResource(R.drawable.overlay_error);
|
||||||
// mSignatureLayout.setVisibility(View.VISIBLE);
|
mResultSignatureLayout.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case OpenPgpSignatureResult.SIGNATURE_SUCCESS_UNCERTIFIED:
|
case OpenPgpSignatureResult.SIGNATURE_SUCCESS_UNCERTIFIED: {
|
||||||
setStatusImage(mContext, mResultSignatureIcon, mResultSignatureText, STATE_UNVERIFIED);
|
setStatusImage(mContext, mResultSignatureIcon, mResultSignatureText, STATE_UNVERIFIED);
|
||||||
|
mResultSignatureText.setText(R.string.openpgp_result_signature_uncertified);
|
||||||
|
|
||||||
// if (signatureResult.isSignatureOnly()) {
|
// if (signatureResult.isSignatureOnly()) {
|
||||||
// mText.setText(R.string.openpgp_signature_valid_uncertified);
|
// mText.setText(R.string.openpgp_signature_valid_uncertified);
|
||||||
@ -139,9 +124,28 @@ public class OpenPgpHeaderView extends LinearLayout {
|
|||||||
// mGetKeyButton.setVisibility(View.GONE);
|
// mGetKeyButton.setVisibility(View.GONE);
|
||||||
// mSignatureUserId.setText(signatureResult.getUserId());
|
// mSignatureUserId.setText(signatureResult.getUserId());
|
||||||
// mSignatureStatusImage.setImageResource(R.drawable.overlay_ok);
|
// mSignatureStatusImage.setImageResource(R.drawable.overlay_ok);
|
||||||
// mSignatureLayout.setVisibility(View.VISIBLE);
|
mResultSignatureLayout.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
// case OpenPgpSignatureResult.SIGN:
|
||||||
|
// setStatusImage(mContext, mResultSignatureIcon, mResultSignatureText, STATE_UNVERIFIED);
|
||||||
|
// mResultSignatureText.setText(R.string.openpgp_result_signature_uncertified);
|
||||||
|
//
|
||||||
|
//// if (signatureResult.isSignatureOnly()) {
|
||||||
|
//// mText.setText(R.string.openpgp_signature_valid_uncertified);
|
||||||
|
//// } else {
|
||||||
|
//// mText.setText(R.string.openpgp_successful_decryption_valid_signature_uncertified);
|
||||||
|
//// }
|
||||||
|
//// MessageOpenPgpView.this.setBackgroundColor(mFragment.getResources().getColor(
|
||||||
|
//// R.color.openpgp_orange));
|
||||||
|
////
|
||||||
|
//// mGetKeyButton.setVisibility(View.GONE);
|
||||||
|
//// mSignatureUserId.setText(signatureResult.getUserId());
|
||||||
|
//// mSignatureStatusImage.setImageResource(R.drawable.overlay_ok);
|
||||||
|
// mResultSignatureLayout.setVisibility(View.VISIBLE);
|
||||||
|
//
|
||||||
|
// break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -21,8 +21,8 @@
|
|||||||
<View
|
<View
|
||||||
android:id="@+id/message_sidebar"
|
android:id="@+id/message_sidebar"
|
||||||
android:layout_width="8dp"
|
android:layout_width="8dp"
|
||||||
android:layout_marginLeft="16dp"
|
android:layout_marginLeft="10dp"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_marginRight="4dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/openpgp_sidebar"
|
android:background="@color/openpgp_sidebar"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
|
@ -9,8 +9,7 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingLeft="8dp"
|
android:paddingLeft="4dp">
|
||||||
android:paddingRight="8dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
@ -30,9 +29,9 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:text="Not Encrypted (set in-code)"
|
android:text="Not Encrypted (set in-code)"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="4dp"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="2dp"
|
||||||
android:layout_marginBottom="4dp" />
|
android:layout_marginBottom="2dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -53,9 +52,9 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:text="Signed by (set in-code)"
|
android:text="Signed by (set in-code)"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="4dp"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="2dp"
|
||||||
android:layout_marginBottom="4dp" />
|
android:layout_marginBottom="2dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -65,7 +64,7 @@
|
|||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="8dp"
|
android:layout_width="8dp"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="6dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/openpgp_sidebar" />
|
android:background="@color/openpgp_sidebar" />
|
||||||
|
|
||||||
@ -74,17 +73,10 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/result_signature_divider1"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dip"
|
|
||||||
android:layout_marginLeft="16dp"
|
|
||||||
android:background="?android:attr/listDivider" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/result_signature_layout"
|
android:id="@+id/result_signature_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?android:attr/listPreferredItemHeight"
|
android:layout_height="wrap_content"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:layout_marginLeft="16dp"
|
android:layout_marginLeft="16dp"
|
||||||
android:paddingRight="4dp"
|
android:paddingRight="4dp"
|
||||||
@ -92,7 +84,7 @@
|
|||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:paddingRight="4dp"
|
android:paddingRight="4dp"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
@ -123,12 +115,12 @@
|
|||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:background="?android:attr/listDivider" />
|
android:background="?android:attr/listDivider" />
|
||||||
|
|
||||||
<TextView
|
<Button
|
||||||
android:id="@+id/result_signature_action"
|
android:id="@+id/result_signature_action"
|
||||||
android:paddingLeft="8dp"
|
android:paddingLeft="8dp"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:text="Show"
|
android:text="Show"
|
||||||
android:drawablePadding="8dp"
|
android:drawablePadding="8dp"
|
||||||
android:gravity="center_vertical" />
|
android:gravity="center_vertical" />
|
||||||
|
@ -6,6 +6,6 @@
|
|||||||
<color name="openpgp_orange">#FF8800</color>
|
<color name="openpgp_orange">#FF8800</color>
|
||||||
<color name="openpgp_green">#669900</color>
|
<color name="openpgp_green">#669900</color>
|
||||||
<color name="openpgp_blue">#336699</color>
|
<color name="openpgp_blue">#336699</color>
|
||||||
<color name="openpgp_sidebar">#ff444444</color>
|
<color name="openpgp_sidebar">#D8D8D8</color>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1117,6 +1117,18 @@ Please submit bug reports, contribute new features and ask questions at
|
|||||||
<string name="openpgp_error">OpenPGP Error:</string>
|
<string name="openpgp_error">OpenPGP Error:</string>
|
||||||
<string name="openpgp_user_id">User Id</string>
|
<string name="openpgp_user_id">User Id</string>
|
||||||
|
|
||||||
|
<string name="openpgp_result_no_signature">"Not Signed"</string>
|
||||||
|
<string name="openpgp_result_invalid_signature">"Invalid signature!"</string>
|
||||||
|
<string name="openpgp_result_signature_uncertified">"Signed by (not certified!)"</string>
|
||||||
|
<string name="openpgp_result_signature_certified">"Signed by"</string>
|
||||||
|
<string name="openpgp_result_signature_expired_key">"Key is expired!"</string>
|
||||||
|
<string name="openpgp_result_signature_revoked_key">"Key has been revoked!"</string>
|
||||||
|
<string name="openpgp_result_signature_missing_key">"Unknown public key"</string>
|
||||||
|
<string name="openpgp_result_encrypted">"Encrypted"</string>
|
||||||
|
<string name="openpgp_result_not_encrypted">"Not Encrypted"</string>
|
||||||
|
<string name="openpgp_result_action_show">"Show"</string>
|
||||||
|
<string name="openpgp_result_action_Lookup">"Lookup"</string>
|
||||||
|
|
||||||
<!-- === Client certificates specific ================================================================== -->
|
<!-- === Client certificates specific ================================================================== -->
|
||||||
<string name="account_setup_basics_client_certificate">Use client certificate</string>
|
<string name="account_setup_basics_client_certificate">Use client certificate</string>
|
||||||
<string name="client_certificate_spinner_empty">No client certificate</string>
|
<string name="client_certificate_spinner_empty">No client certificate</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user