From 56d38dd68b7248dff54d56affce0af14e8e2e161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Wed, 25 Feb 2015 02:35:09 +0100 Subject: [PATCH] First work on new key view toolbar --- Graphics/drawables/comment-text.svg | 1 + Graphics/drawables/ic_action_encrypt_file.svg | 60 ++ Graphics/drawables/ic_action_encrypt_text.svg | 60 ++ Graphics/drawables/ic_action_qr_code.svg | 826 ------------------ .../drawables/ic_action_verified_cutout.svg | 74 ++ Graphics/update-drawables.sh | 2 +- .../keychain/ui/KeyListFragment.java | 4 +- .../keychain/ui/ViewKeyActivity.java | 151 +++- .../ui/adapter/ImportKeysAdapter.java | 4 +- .../ui/adapter/SelectKeyCursorAdapter.java | 4 +- .../keychain/ui/adapter/UserIdsAdapter.java | 8 +- .../keychain/ui/util/KeyFormattingUtils.java | 48 +- .../ui/widget/AspectRatioImageView.java | 138 +++ .../keychain/ui/widget/CertifyKeySpinner.java | 7 +- .../keychain/ui/widget/SignKeySpinner.java | 7 +- .../drawable-hdpi/ic_action_encrypt_file.png | Bin 0 -> 623 bytes .../drawable-hdpi/ic_action_encrypt_text.png | Bin 0 -> 787 bytes .../ic_action_verified_cutout.png | Bin 0 -> 1080 bytes .../drawable-mdpi/ic_action_encrypt_file.png | Bin 0 -> 480 bytes .../drawable-mdpi/ic_action_encrypt_text.png | Bin 0 -> 572 bytes .../ic_action_verified_cutout.png | Bin 0 -> 751 bytes .../drawable-xhdpi/ic_action_encrypt_file.png | Bin 0 -> 836 bytes .../drawable-xhdpi/ic_action_encrypt_text.png | Bin 0 -> 976 bytes .../ic_action_verified_cutout.png | Bin 0 -> 1455 bytes .../ic_action_encrypt_file.png | Bin 0 -> 1095 bytes .../ic_action_encrypt_text.png | Bin 0 -> 1331 bytes .../ic_action_verified_cutout.png | Bin 0 -> 2168 bytes .../src/main/res/layout/view_key_activity.xml | 106 ++- OpenKeychain/src/main/res/menu/key_view2.xml | 11 + .../src/main/res/values-v21/dimens.xml | 1 + OpenKeychain/src/main/res/values/attr.xml | 9 + OpenKeychain/src/main/res/values/dimens.xml | 1 + OpenKeychain/src/main/res/values/strings.xml | 7 +- 33 files changed, 599 insertions(+), 930 deletions(-) create mode 100644 Graphics/drawables/comment-text.svg create mode 100644 Graphics/drawables/ic_action_encrypt_file.svg create mode 100644 Graphics/drawables/ic_action_encrypt_text.svg delete mode 100644 Graphics/drawables/ic_action_qr_code.svg create mode 100644 Graphics/drawables/ic_action_verified_cutout.svg create mode 100644 OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/AspectRatioImageView.java create mode 100644 OpenKeychain/src/main/res/drawable-hdpi/ic_action_encrypt_file.png create mode 100644 OpenKeychain/src/main/res/drawable-hdpi/ic_action_encrypt_text.png create mode 100644 OpenKeychain/src/main/res/drawable-hdpi/ic_action_verified_cutout.png create mode 100644 OpenKeychain/src/main/res/drawable-mdpi/ic_action_encrypt_file.png create mode 100644 OpenKeychain/src/main/res/drawable-mdpi/ic_action_encrypt_text.png create mode 100644 OpenKeychain/src/main/res/drawable-mdpi/ic_action_verified_cutout.png create mode 100644 OpenKeychain/src/main/res/drawable-xhdpi/ic_action_encrypt_file.png create mode 100644 OpenKeychain/src/main/res/drawable-xhdpi/ic_action_encrypt_text.png create mode 100644 OpenKeychain/src/main/res/drawable-xhdpi/ic_action_verified_cutout.png create mode 100644 OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_encrypt_file.png create mode 100644 OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_encrypt_text.png create mode 100644 OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_verified_cutout.png create mode 100644 OpenKeychain/src/main/res/menu/key_view2.xml diff --git a/Graphics/drawables/comment-text.svg b/Graphics/drawables/comment-text.svg new file mode 100644 index 000000000..b881741b1 --- /dev/null +++ b/Graphics/drawables/comment-text.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Graphics/drawables/ic_action_encrypt_file.svg b/Graphics/drawables/ic_action_encrypt_file.svg new file mode 100644 index 000000000..06575fea0 --- /dev/null +++ b/Graphics/drawables/ic_action_encrypt_file.svg @@ -0,0 +1,60 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/Graphics/drawables/ic_action_encrypt_text.svg b/Graphics/drawables/ic_action_encrypt_text.svg new file mode 100644 index 000000000..92811bc94 --- /dev/null +++ b/Graphics/drawables/ic_action_encrypt_text.svg @@ -0,0 +1,60 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/Graphics/drawables/ic_action_qr_code.svg b/Graphics/drawables/ic_action_qr_code.svg deleted file mode 100644 index ebd147888..000000000 --- a/Graphics/drawables/ic_action_qr_code.svg +++ /dev/null @@ -1,826 +0,0 @@ - - - -image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Graphics/drawables/ic_action_verified_cutout.svg b/Graphics/drawables/ic_action_verified_cutout.svg new file mode 100644 index 000000000..c50b64a4b --- /dev/null +++ b/Graphics/drawables/ic_action_verified_cutout.svg @@ -0,0 +1,74 @@ + + + + + + image/svg+xml + + + + + + + signature-verified-cutout + Created with Sketch. + + + + + + + diff --git a/Graphics/update-drawables.sh b/Graphics/update-drawables.sh index 750a6ee97..d95866dd3 100755 --- a/Graphics/update-drawables.sh +++ b/Graphics/update-drawables.sh @@ -39,7 +39,7 @@ SRC_DIR=./drawables/ # xhdpi: 64x64 # xxhdpi: 96x96 -for NAME in "ic_action_nfc" "ic_action_qr_code" "ic_action_safeslinger" "ic_action_search_cloud" "ic_cloud_search_24px" +for NAME in "ic_action_nfc" "ic_action_qr_code" "ic_action_safeslinger" "ic_action_search_cloud" "ic_cloud_search_24px" "ic_action_encrypt_file" "ic_action_encrypt_text" "ic_action_verified_cutout" do echo $NAME inkscape -w 32 -h 32 -e "$MDPI_DIR/$NAME.png" "$SRC_DIR/$NAME.svg" diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java index 55efd9bb0..f60ddcef6 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java @@ -778,13 +778,13 @@ public class KeyListFragment extends LoaderFragment // Note: order is important! if (isRevoked) { - KeyFormattingUtils.setStatusImage(getActivity(), h.mStatus, null, KeyFormattingUtils.STATE_REVOKED, true); + KeyFormattingUtils.setStatusImage(getActivity(), h.mStatus, null, KeyFormattingUtils.STATE_REVOKED, R.color.bg_gray); h.mStatus.setVisibility(View.VISIBLE); h.mSlinger.setVisibility(View.GONE); h.mMainUserId.setTextColor(context.getResources().getColor(R.color.bg_gray)); h.mMainUserIdRest.setTextColor(context.getResources().getColor(R.color.bg_gray)); } else if (isExpired) { - KeyFormattingUtils.setStatusImage(getActivity(), h.mStatus, null, KeyFormattingUtils.STATE_EXPIRED, true); + KeyFormattingUtils.setStatusImage(getActivity(), h.mStatus, null, KeyFormattingUtils.STATE_EXPIRED, R.color.bg_gray); h.mStatus.setVisibility(View.VISIBLE); h.mSlinger.setVisibility(View.GONE); h.mMainUserId.setTextColor(context.getResources().getColor(R.color.bg_gray)); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java index 18a63f5ad..8ef5d01aa 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java @@ -21,6 +21,7 @@ package org.sufficientlysecure.keychain.ui; import android.annotation.TargetApi; import android.content.Intent; import android.database.Cursor; +import android.graphics.Bitmap; import android.net.Uri; import android.nfc.NdefMessage; import android.nfc.NdefRecord; @@ -35,17 +36,20 @@ import android.provider.ContactsContract; import android.support.v4.app.LoaderManager; import android.support.v4.content.CursorLoader; import android.support.v4.content.Loader; -import android.support.v4.view.ViewPager; import android.support.v7.app.ActionBar; +import android.support.v7.widget.Toolbar; +import android.view.Gravity; import android.view.Menu; import android.view.MenuItem; import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageButton; import android.widget.ImageView; -import android.widget.LinearLayout; +import android.widget.RelativeLayout; import android.widget.TextView; import android.widget.Toast; -import com.astuetz.PagerSlidingTabStrip; +import com.getbase.floatingactionbutton.FloatingActionButton; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; @@ -54,9 +58,9 @@ import org.sufficientlysecure.keychain.pgp.KeyRing; import org.sufficientlysecure.keychain.provider.KeychainContract; import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler; -import org.sufficientlysecure.keychain.ui.adapter.PagerTabStripAdapter; import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils; import org.sufficientlysecure.keychain.ui.util.Notify; +import org.sufficientlysecure.keychain.ui.widget.AspectRatioImageView; import org.sufficientlysecure.keychain.util.ContactHelper; import org.sufficientlysecure.keychain.util.ExportHelper; import org.sufficientlysecure.keychain.util.Log; @@ -72,10 +76,16 @@ public class ViewKeyActivity extends BaseActivity implements protected Uri mDataUri; - private LinearLayout mStatusLayout; + private TextView mName; private TextView mStatusText; private ImageView mStatusImage; - private View mStatusDivider; + private RelativeLayout mBigToolbar; + + private ImageButton mActionEncryptFile; + private ImageButton mActionEncryptText; + private ImageButton mActionVerify; + private FloatingActionButton mFab; + private AspectRatioImageView mPhoto; // NFC private NfcAdapter mNfcAdapter; @@ -93,19 +103,18 @@ public class ViewKeyActivity extends BaseActivity implements mExportHelper = new ExportHelper(this); mProviderHelper = new ProviderHelper(this); - // let the actionbar look like Android's contact app - ActionBar actionBar = getSupportActionBar(); - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setIcon(android.R.color.transparent); - actionBar.setHomeButtonEnabled(true); + setTitle(null); - mStatusLayout = (LinearLayout) findViewById(R.id.view_key_status_layout); - mStatusText = (TextView) findViewById(R.id.view_key_status_text); + mName = (TextView) findViewById(R.id.view_key_name); + mStatusText = (TextView) findViewById(R.id.view_key_status); mStatusImage = (ImageView) findViewById(R.id.view_key_status_image); - mStatusDivider = findViewById(R.id.view_key_status_divider); + mBigToolbar = (RelativeLayout) findViewById(R.id.toolbar_big); - - Intent intent = getIntent(); + mActionEncryptFile = (ImageButton) findViewById(R.id.view_key_action_encrypt_files); + mActionEncryptText = (ImageButton) findViewById(R.id.view_key_action_encrypt_text); + mActionVerify = (ImageButton) findViewById(R.id.view_key_action_verify); + mFab = (FloatingActionButton) findViewById(R.id.fab); + mPhoto = (AspectRatioImageView) findViewById(R.id.view_key_photo); mDataUri = getIntent().getData(); if (mDataUri == null) { @@ -329,25 +338,32 @@ public class ViewKeyActivity extends BaseActivity implements } }; - static final String[] UNIFIED_PROJECTION = new String[]{ + // These are the rows that we will retrieve. + static final String[] PROJECTION = new String[]{ KeychainContract.KeyRings._ID, KeychainContract.KeyRings.MASTER_KEY_ID, KeychainContract.KeyRings.USER_ID, KeychainContract.KeyRings.IS_REVOKED, KeychainContract.KeyRings.EXPIRY, - + KeychainContract.KeyRings.VERIFIED, + KeychainContract.KeyRings.HAS_ANY_SECRET, + KeychainContract.KeyRings.FINGERPRINT }; - static final int INDEX_UNIFIED_MASTER_KEY_ID = 1; - static final int INDEX_UNIFIED_USER_ID = 2; - static final int INDEX_UNIFIED_IS_REVOKED = 3; - static final int INDEX_UNIFIED_EXPIRY = 4; + + static final int INDEX_MASTER_KEY_ID = 1; + static final int INDEX_USER_ID = 2; + static final int INDEX_IS_REVOKED = 3; + static final int INDEX_EXPIRY = 4; + static final int INDEX_VERIFIED = 5; + static final int INDEX_HAS_ANY_SECRET = 6; + static final int INDEX_FINGERPRINT = 7; @Override public Loader onCreateLoader(int id, Bundle args) { switch (id) { case LOADER_ID_UNIFIED: { Uri baseUri = KeychainContract.KeyRings.buildUnifiedKeyRingUri(mDataUri); - return new CursorLoader(this, baseUri, UNIFIED_PROJECTION, null, null, null); + return new CursorLoader(this, baseUri, PROJECTION, null, null, null); } default: @@ -370,36 +386,91 @@ public class ViewKeyActivity extends BaseActivity implements case LOADER_ID_UNIFIED: { if (data.moveToFirst()) { // get name, email, and comment from USER_ID - String[] mainUserId = KeyRing.splitUserId(data.getString(INDEX_UNIFIED_USER_ID)); + String[] mainUserId = KeyRing.splitUserId(data.getString(INDEX_USER_ID)); if (mainUserId[0] != null) { - setTitle(mainUserId[0]); + mName.setText(mainUserId[0]); } else { - setTitle(R.string.user_id_no_name); + mName.setText(R.string.user_id_no_name); } - // get key id from MASTER_KEY_ID - long masterKeyId = data.getLong(INDEX_UNIFIED_MASTER_KEY_ID); - getSupportActionBar().setSubtitle(KeyFormattingUtils.beautifyKeyIdWithPrefix(this, masterKeyId)); + String fingerprint = KeyFormattingUtils.convertFingerprintToHex(data.getBlob(INDEX_FINGERPRINT)); - boolean isRevoked = data.getInt(INDEX_UNIFIED_IS_REVOKED) > 0; - boolean isExpired = !data.isNull(INDEX_UNIFIED_EXPIRY) - && new Date(data.getLong(INDEX_UNIFIED_EXPIRY) * 1000).before(new Date()); + boolean isSecret = data.getInt(INDEX_HAS_ANY_SECRET) != 0; + boolean isRevoked = data.getInt(INDEX_IS_REVOKED) > 0; + boolean isExpired = !data.isNull(INDEX_EXPIRY) + && new Date(data.getLong(INDEX_EXPIRY) * 1000).before(new Date()); + boolean isVerified = data.getInt(INDEX_VERIFIED) > 0; // Note: order is important + int color; if (isRevoked) { mStatusText.setText(R.string.view_key_revoked); - KeyFormattingUtils.setStatusImage(this, mStatusImage, mStatusText, KeyFormattingUtils.STATE_REVOKED); - mStatusDivider.setVisibility(View.VISIBLE); - mStatusLayout.setVisibility(View.VISIBLE); + mStatusImage.setVisibility(View.VISIBLE); + KeyFormattingUtils.setStatusImage(this, mStatusImage, mStatusText, KeyFormattingUtils.STATE_REVOKED, R.color.icons); + color = getResources().getColor(R.color.android_red_light); + + mActionEncryptFile.setVisibility(View.INVISIBLE); + mActionEncryptText.setVisibility(View.INVISIBLE); + mActionVerify.setVisibility(View.INVISIBLE); + mFab.setVisibility(View.INVISIBLE); } else if (isExpired) { mStatusText.setText(R.string.view_key_expired); - KeyFormattingUtils.setStatusImage(this, mStatusImage, mStatusText, KeyFormattingUtils.STATE_EXPIRED); - mStatusDivider.setVisibility(View.VISIBLE); - mStatusLayout.setVisibility(View.VISIBLE); + mStatusImage.setVisibility(View.VISIBLE); + KeyFormattingUtils.setStatusImage(this, mStatusImage, mStatusText, KeyFormattingUtils.STATE_EXPIRED, R.color.icons); + color = getResources().getColor(R.color.android_red_light); + + mActionEncryptFile.setVisibility(View.INVISIBLE); + mActionEncryptText.setVisibility(View.INVISIBLE); + mActionVerify.setVisibility(View.INVISIBLE); + mFab.setVisibility(View.INVISIBLE); + } else if (isSecret) { + mStatusText.setText(R.string.view_key_my_key); + mStatusImage.setVisibility(View.INVISIBLE); + color = getResources().getColor(R.color.primary); + + mActionEncryptFile.setVisibility(View.VISIBLE); + mActionEncryptText.setVisibility(View.VISIBLE); + mActionVerify.setVisibility(View.INVISIBLE); + mFab.setVisibility(View.INVISIBLE); // TODO } else { - mStatusDivider.setVisibility(View.GONE); - mStatusLayout.setVisibility(View.GONE); + mActionEncryptFile.setVisibility(View.VISIBLE); + mActionEncryptText.setVisibility(View.VISIBLE); + + if (isVerified) { + mStatusText.setText(R.string.view_key_verified); + mStatusImage.setVisibility(View.VISIBLE); + KeyFormattingUtils.setStatusImage(this, mStatusImage, mStatusText, KeyFormattingUtils.STATE_VERIFIED, R.color.icons); + color = getResources().getColor(R.color.primary); + + AsyncTask photoTask = + new AsyncTask() { + protected Bitmap doInBackground(String... fingerprint) { + return ContactHelper.photoFromFingerprint(getContentResolver(), fingerprint[0]); + } + + protected void onPostExecute(Bitmap photo) { + mPhoto.setImageBitmap(photo); + mPhoto.setVisibility(View.VISIBLE); + } + }; + + photoTask.execute(fingerprint); + + mActionVerify.setVisibility(View.INVISIBLE); + mFab.setVisibility(View.INVISIBLE); + } else { + mStatusText.setText(R.string.view_key_unverified); + mStatusImage.setVisibility(View.VISIBLE); + KeyFormattingUtils.setStatusImage(this, mStatusImage, mStatusText, KeyFormattingUtils.STATE_UNVERIFIED, R.color.icons); + color = getResources().getColor(R.color.android_orange_light); + + mActionVerify.setVisibility(View.VISIBLE); + mFab.setVisibility(View.VISIBLE); + } } + mToolbar.setBackgroundColor(color); + mStatusBar.setBackgroundColor(color); + mBigToolbar.setBackgroundColor(color); break; } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java index 8e82dd7d0..598793233 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java @@ -175,9 +175,9 @@ public class ImportKeysAdapter extends ArrayAdapter { } if (entry.isRevoked()) { - KeyFormattingUtils.setStatusImage(getContext(), holder.status, null, KeyFormattingUtils.STATE_REVOKED, true); + KeyFormattingUtils.setStatusImage(getContext(), holder.status, null, KeyFormattingUtils.STATE_REVOKED, R.color.bg_gray); } else if (entry.isExpired()) { - KeyFormattingUtils.setStatusImage(getContext(), holder.status, null, KeyFormattingUtils.STATE_EXPIRED, true); + KeyFormattingUtils.setStatusImage(getContext(), holder.status, null, KeyFormattingUtils.STATE_EXPIRED, R.color.bg_gray); } if (entry.isRevoked() || entry.isExpired()) { diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SelectKeyCursorAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SelectKeyCursorAdapter.java index e90b57c1c..a836b35df 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SelectKeyCursorAdapter.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SelectKeyCursorAdapter.java @@ -133,11 +133,11 @@ abstract public class SelectKeyCursorAdapter extends CursorAdapter { boolean enabled; if (cursor.getInt(mIndexIsRevoked) != 0) { h.statusIcon.setVisibility(View.VISIBLE); - KeyFormattingUtils.setStatusImage(mContext, h.statusIcon, null, KeyFormattingUtils.STATE_REVOKED, true); + KeyFormattingUtils.setStatusImage(mContext, h.statusIcon, null, KeyFormattingUtils.STATE_REVOKED, R.color.bg_gray); enabled = false; } else if (cursor.getInt(mIndexIsExpiry) != 0) { h.statusIcon.setVisibility(View.VISIBLE); - KeyFormattingUtils.setStatusImage(mContext, h.statusIcon, null, KeyFormattingUtils.STATE_EXPIRED, true); + KeyFormattingUtils.setStatusImage(mContext, h.statusIcon, null, KeyFormattingUtils.STATE_EXPIRED, R.color.bg_gray); enabled = false; } else { h.statusIcon.setVisibility(View.GONE); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/UserIdsAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/UserIdsAdapter.java index 6281bb8b3..8e86efebe 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/UserIdsAdapter.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/UserIdsAdapter.java @@ -162,7 +162,7 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC if (isRevoked) { // set revocation icon (can this even be primary?) - KeyFormattingUtils.setStatusImage(mContext, vVerified, null, KeyFormattingUtils.STATE_REVOKED, true); + KeyFormattingUtils.setStatusImage(mContext, vVerified, null, KeyFormattingUtils.STATE_REVOKED, R.color.bg_gray); // disable revoked user ids vName.setEnabled(false); @@ -184,13 +184,13 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC int isVerified = cursor.getInt(INDEX_VERIFIED); switch (isVerified) { case Certs.VERIFIED_SECRET: - KeyFormattingUtils.setStatusImage(mContext, vVerified, null, KeyFormattingUtils.STATE_VERIFIED, false); + KeyFormattingUtils.setStatusImage(mContext, vVerified, null, KeyFormattingUtils.STATE_VERIFIED, KeyFormattingUtils.DEFAULT_COLOR); break; case Certs.VERIFIED_SELF: - KeyFormattingUtils.setStatusImage(mContext, vVerified, null, KeyFormattingUtils.STATE_UNVERIFIED, false); + KeyFormattingUtils.setStatusImage(mContext, vVerified, null, KeyFormattingUtils.STATE_UNVERIFIED, KeyFormattingUtils.DEFAULT_COLOR); break; default: - KeyFormattingUtils.setStatusImage(mContext, vVerified, null, KeyFormattingUtils.STATE_INVALID, false); + KeyFormattingUtils.setStatusImage(mContext, vVerified, null, KeyFormattingUtils.STATE_INVALID, KeyFormattingUtils.DEFAULT_COLOR); break; } } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/KeyFormattingUtils.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/KeyFormattingUtils.java index bff7d6b27..1c3dec629 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/KeyFormattingUtils.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/KeyFormattingUtils.java @@ -377,6 +377,8 @@ public class KeyFormattingUtils { ((int) digest[2] + 256) % 256}; } + public static final int DEFAULT_COLOR = -1; + public static final int STATE_REVOKED = 1; public static final int STATE_EXPIRED = 2; public static final int STATE_VERIFIED = 3; @@ -393,20 +395,22 @@ public class KeyFormattingUtils { } public static void setStatusImage(Context context, ImageView statusIcon, TextView statusText, int state) { - setStatusImage(context, statusIcon, statusText, state, false); + setStatusImage(context, statusIcon, statusText, state, KeyFormattingUtils.DEFAULT_COLOR); } /** * Sets status image based on constant */ public static void setStatusImage(Context context, ImageView statusIcon, TextView statusText, - int state, boolean unobtrusive) { + int state, int color) { switch (state) { /** GREEN: everything is good **/ case STATE_VERIFIED: { statusIcon.setImageDrawable( context.getResources().getDrawable(R.drawable.status_signature_verified_cutout)); - int color = R.color.android_green_light; + if (color == KeyFormattingUtils.DEFAULT_COLOR) { + color = R.color.android_green_light; + } statusIcon.setColorFilter(context.getResources().getColor(color), PorterDuff.Mode.SRC_IN); if (statusText != null) { @@ -417,7 +421,9 @@ public class KeyFormattingUtils { case STATE_ENCRYPTED: { statusIcon.setImageDrawable( context.getResources().getDrawable(R.drawable.status_lock_closed)); - int color = R.color.android_green_light; + if (color == KeyFormattingUtils.DEFAULT_COLOR) { + color = R.color.android_green_light; + } statusIcon.setColorFilter(context.getResources().getColor(color), PorterDuff.Mode.SRC_IN); if (statusText != null) { @@ -429,7 +435,9 @@ public class KeyFormattingUtils { case STATE_UNVERIFIED: { statusIcon.setImageDrawable( context.getResources().getDrawable(R.drawable.status_signature_unverified_cutout)); - int color = R.color.android_orange_light; + if (color == KeyFormattingUtils.DEFAULT_COLOR) { + color = R.color.android_orange_light; + } statusIcon.setColorFilter(context.getResources().getColor(color), PorterDuff.Mode.SRC_IN); if (statusText != null) { @@ -440,7 +448,9 @@ public class KeyFormattingUtils { case STATE_UNKNOWN_KEY: { statusIcon.setImageDrawable( context.getResources().getDrawable(R.drawable.status_signature_unknown_cutout)); - int color = R.color.android_orange_light; + if (color == KeyFormattingUtils.DEFAULT_COLOR) { + color = R.color.android_orange_light; + } statusIcon.setColorFilter(context.getResources().getColor(color), PorterDuff.Mode.SRC_IN); if (statusText != null) { @@ -452,9 +462,8 @@ public class KeyFormattingUtils { case STATE_REVOKED: { statusIcon.setImageDrawable( context.getResources().getDrawable(R.drawable.status_signature_revoked_cutout)); - int color = R.color.android_red_light; - if (unobtrusive) { - color = R.color.bg_gray; + if (color == KeyFormattingUtils.DEFAULT_COLOR) { + color = R.color.android_red_light; } statusIcon.setColorFilter(context.getResources().getColor(color), PorterDuff.Mode.SRC_IN); @@ -466,9 +475,8 @@ public class KeyFormattingUtils { case STATE_EXPIRED: { statusIcon.setImageDrawable( context.getResources().getDrawable(R.drawable.status_signature_expired_cutout)); - int color = R.color.android_red_light; - if (unobtrusive) { - color = R.color.bg_gray; + if (color == KeyFormattingUtils.DEFAULT_COLOR) { + color = R.color.android_red_light; } statusIcon.setColorFilter(context.getResources().getColor(color), PorterDuff.Mode.SRC_IN); @@ -480,7 +488,9 @@ public class KeyFormattingUtils { case STATE_NOT_ENCRYPTED: { statusIcon.setImageDrawable( context.getResources().getDrawable(R.drawable.status_lock_open)); - int color = R.color.android_red_light; + if (color == KeyFormattingUtils.DEFAULT_COLOR) { + color = R.color.android_red_light; + } statusIcon.setColorFilter(context.getResources().getColor(color), PorterDuff.Mode.SRC_IN); if (statusText != null) { @@ -491,7 +501,9 @@ public class KeyFormattingUtils { case STATE_NOT_SIGNED: { statusIcon.setImageDrawable( context.getResources().getDrawable(R.drawable.status_signature_unknown_cutout)); - int color = R.color.android_red_light; + if (color == KeyFormattingUtils.DEFAULT_COLOR) { + color = R.color.android_red_light; + } statusIcon.setColorFilter(context.getResources().getColor(color), PorterDuff.Mode.SRC_IN); if (statusText != null) { @@ -502,7 +514,9 @@ public class KeyFormattingUtils { case STATE_INVALID: { statusIcon.setImageDrawable( context.getResources().getDrawable(R.drawable.status_signature_invalid_cutout)); - int color = R.color.android_red_light; + if (color == KeyFormattingUtils.DEFAULT_COLOR) { + color = R.color.android_red_light; + } statusIcon.setColorFilter(context.getResources().getColor(color), PorterDuff.Mode.SRC_IN); if (statusText != null) { @@ -514,7 +528,9 @@ public class KeyFormattingUtils { case STATE_UNAVAILABLE: { statusIcon.setImageDrawable( context.getResources().getDrawable(R.drawable.status_signature_invalid_cutout)); - int color = R.color.bg_gray; + if (color == KeyFormattingUtils.DEFAULT_COLOR) { + color = R.color.bg_gray; + } statusIcon.setColorFilter(context.getResources().getColor(color), PorterDuff.Mode.SRC_IN); if (statusText != null) { diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/AspectRatioImageView.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/AspectRatioImageView.java new file mode 100644 index 000000000..0df5ba5e8 --- /dev/null +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/AspectRatioImageView.java @@ -0,0 +1,138 @@ +/* + * Copyright (C) 2015 Dominik Schürmann + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package org.sufficientlysecure.keychain.ui.widget; + +import android.content.Context; +import android.content.res.TypedArray; +import android.util.AttributeSet; +import android.widget.ImageView; + +import org.sufficientlysecure.keychain.R; + +/** + * Maintains an aspect ratio based on either width or height. Disabled by default. + * + * from https://gist.github.com/JakeWharton/2856179 + */ +public class AspectRatioImageView extends ImageView { + // NOTE: These must be kept in sync with the AspectRatioImageView attributes in attrs.xml. + public static final int MEASUREMENT_WIDTH = 0; + public static final int MEASUREMENT_HEIGHT = 1; + + private static final float DEFAULT_ASPECT_RATIO = 1f; + private static final boolean DEFAULT_ASPECT_RATIO_ENABLED = false; + private static final int DEFAULT_DOMINANT_MEASUREMENT = MEASUREMENT_WIDTH; + + private float aspectRatio; + private boolean aspectRatioEnabled; + private int dominantMeasurement; + + public AspectRatioImageView(Context context) { + this(context, null); + } + + public AspectRatioImageView(Context context, AttributeSet attrs) { + super(context, attrs); + + TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AspectRatioImageView); + aspectRatio = a.getFloat(R.styleable.AspectRatioImageView_aspectRatio, DEFAULT_ASPECT_RATIO); + aspectRatioEnabled = a.getBoolean(R.styleable.AspectRatioImageView_aspectRatioEnabled, + DEFAULT_ASPECT_RATIO_ENABLED); + dominantMeasurement = a.getInt(R.styleable.AspectRatioImageView_dominantMeasurement, + DEFAULT_DOMINANT_MEASUREMENT); + a.recycle(); + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + if (!aspectRatioEnabled) return; + + int newWidth; + int newHeight; + switch (dominantMeasurement) { + case MEASUREMENT_WIDTH: + newWidth = getMeasuredWidth(); + newHeight = (int) (newWidth * aspectRatio); + break; + + case MEASUREMENT_HEIGHT: + newHeight = getMeasuredHeight(); + newWidth = (int) (newHeight * aspectRatio); + break; + + default: + throw new IllegalStateException("Unknown measurement with ID " + dominantMeasurement); + } + + setMeasuredDimension(newWidth, newHeight); + } + + /** + * Get the aspect ratio for this image view. + */ + public float getAspectRatio() { + return aspectRatio; + } + + /** + * Set the aspect ratio for this image view. This will update the view instantly. + */ + public void setAspectRatio(float aspectRatio) { + this.aspectRatio = aspectRatio; + if (aspectRatioEnabled) { + requestLayout(); + } + } + + /** + * Get whether or not forcing the aspect ratio is enabled. + */ + public boolean getAspectRatioEnabled() { + return aspectRatioEnabled; + } + + /** + * set whether or not forcing the aspect ratio is enabled. This will re-layout the view. + */ + public void setAspectRatioEnabled(boolean aspectRatioEnabled) { + this.aspectRatioEnabled = aspectRatioEnabled; + requestLayout(); + } + + /** + * Get the dominant measurement for the aspect ratio. + */ + public int getDominantMeasurement() { + return dominantMeasurement; + } + + /** + * Set the dominant measurement for the aspect ratio. + * + * @see #MEASUREMENT_WIDTH + * @see #MEASUREMENT_HEIGHT + */ + public void setDominantMeasurement(int dominantMeasurement) { + if (dominantMeasurement != MEASUREMENT_HEIGHT && dominantMeasurement != MEASUREMENT_WIDTH) { + throw new IllegalArgumentException("Invalid measurement type."); + } + this.dominantMeasurement = dominantMeasurement; + requestLayout(); + } +} \ No newline at end of file diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/CertifyKeySpinner.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/CertifyKeySpinner.java index 904cde47e..25033658d 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/CertifyKeySpinner.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/CertifyKeySpinner.java @@ -27,6 +27,7 @@ import android.util.AttributeSet; import android.widget.ImageView; import org.sufficientlysecure.keychain.Constants; +import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.provider.KeychainContract; import org.sufficientlysecure.keychain.provider.KeychainDatabase; import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils; @@ -101,16 +102,16 @@ public class CertifyKeySpinner extends KeySpinner { @Override boolean setStatus(Context context, Cursor cursor, ImageView statusView) { if (cursor.getInt(mIndexIsRevoked) != 0) { - KeyFormattingUtils.setStatusImage(getContext(), statusView, null, KeyFormattingUtils.STATE_REVOKED, true); + KeyFormattingUtils.setStatusImage(getContext(), statusView, null, KeyFormattingUtils.STATE_REVOKED, R.color.bg_gray); return false; } if (cursor.getInt(mIndexIsExpired) != 0) { - KeyFormattingUtils.setStatusImage(getContext(), statusView, null, KeyFormattingUtils.STATE_EXPIRED, true); + KeyFormattingUtils.setStatusImage(getContext(), statusView, null, KeyFormattingUtils.STATE_EXPIRED, R.color.bg_gray); return false; } // don't invalidate the "None" entry, which is also null! if (cursor.getPosition() != 0 && cursor.isNull(mIndexHasCertify)) { - KeyFormattingUtils.setStatusImage(getContext(), statusView, null, KeyFormattingUtils.STATE_UNAVAILABLE, true); + KeyFormattingUtils.setStatusImage(getContext(), statusView, null, KeyFormattingUtils.STATE_UNAVAILABLE, R.color.bg_gray); return false; } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SignKeySpinner.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SignKeySpinner.java index 9c8e4aedb..fe91e306e 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SignKeySpinner.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SignKeySpinner.java @@ -26,6 +26,7 @@ import android.support.v4.content.Loader; import android.util.AttributeSet; import android.widget.ImageView; +import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.provider.KeychainContract; import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils; @@ -83,15 +84,15 @@ public class SignKeySpinner extends KeySpinner { @Override boolean setStatus(Context context, Cursor cursor, ImageView statusView) { if (cursor.getInt(mIndexIsRevoked) != 0) { - KeyFormattingUtils.setStatusImage(getContext(), statusView, null, KeyFormattingUtils.STATE_REVOKED, true); + KeyFormattingUtils.setStatusImage(getContext(), statusView, null, KeyFormattingUtils.STATE_REVOKED, R.color.bg_gray); return false; } if (cursor.getInt(mIndexIsExpired) != 0) { - KeyFormattingUtils.setStatusImage(getContext(), statusView, null, KeyFormattingUtils.STATE_EXPIRED, true); + KeyFormattingUtils.setStatusImage(getContext(), statusView, null, KeyFormattingUtils.STATE_EXPIRED, R.color.bg_gray); return false; } if (cursor.getInt(mIndexHasSign) == 0) { - KeyFormattingUtils.setStatusImage(getContext(), statusView, null, KeyFormattingUtils.STATE_UNAVAILABLE, true); + KeyFormattingUtils.setStatusImage(getContext(), statusView, null, KeyFormattingUtils.STATE_UNAVAILABLE, R.color.bg_gray); return false; } diff --git a/OpenKeychain/src/main/res/drawable-hdpi/ic_action_encrypt_file.png b/OpenKeychain/src/main/res/drawable-hdpi/ic_action_encrypt_file.png new file mode 100644 index 0000000000000000000000000000000000000000..1e397ebed49ee109c37ff6543bb8197890f5a20c GIT binary patch literal 623 zcmV-#0+9WQP)4S=B9|*)wkaQv; zLJA8D!7fc&;Tj9MR4D|t3kZr3u~1M#QrM_PBt-9i7Q4oE^X|{?9?o0X4~}KuyqTTf z-J3V}wj_x>^T;}ZtmIz66YB&bbOOUbH?R%-YROBI51%)ZE_9!=q^@SZ)`=r&CX)2N zq*X~*;r))Jr#=hllXNMmCTTn}-XrN-C}Q4c0aIa;Umdo|(6-$uhV?Eq9A3)~TLriT zh8hL17SIu1|2S+_;EEjPWz#6a#d4_%A0^{d?0TEzQhN7IujoOhjnZs_%rt@ zZtzLK3h*(hQ{I-)e-r|&DFj$k2(YFQU`-*w8lMEDI!L($Y-UU(EvcUC60n>xku>ZQ zyq-ynOF#vf;9-7=Ghh)IOB=xI?R4Alsfbfi2(YFQU`-*wnj2M_(Zs-kCMN&@002ov JPDHLkV1gjW14jS= literal 0 HcmV?d00001 diff --git a/OpenKeychain/src/main/res/drawable-hdpi/ic_action_encrypt_text.png b/OpenKeychain/src/main/res/drawable-hdpi/ic_action_encrypt_text.png new file mode 100644 index 0000000000000000000000000000000000000000..1cbd993a7a58a6e4b3d6a3c6177882c1f821a16e GIT binary patch literal 787 zcmV+u1MK{XP)kL2QDGkV0$% z7FsD{V_{=wVPWSVVyO@aLB$_X3sDf^Fd!C6K!gNQL`4j8rx=pgVi$9_PIhN!CO3Nz zEW0za-?#6(yEC&tJ(B2VmcN)L0Ffvf5EF<=^t z+ifue+eyyGmLSsF*|13cpGVUyaCR!Fv;a&n#i64gCUg#WSV5+ z`-iC$S5>?bn@)TSco*=Phsm7963k^QYz*8Wc@_!98sLOu?7eJ7jA8U!ru-9lQ4k}N zhq)`+22&@_R@?{Pmk?OQPGCn%`85mg1*NgM0tZ}^cY-QCN;qM21=jrwnB8msUe`LM<|3S9n#QMn>jK8%tUB)4f RPuKte002ovPDHLkV1g9PR~rBT literal 0 HcmV?d00001 diff --git a/OpenKeychain/src/main/res/drawable-hdpi/ic_action_verified_cutout.png b/OpenKeychain/src/main/res/drawable-hdpi/ic_action_verified_cutout.png new file mode 100644 index 0000000000000000000000000000000000000000..896aca575c6b42f9f2352b0d44b1863accdcd635 GIT binary patch literal 1080 zcmV-81jqY{P)+JgNSO=qD{4^ z1f!%{1hov@6p|IzD1{J2VJH$UqNqhpAo*vk$U>oDL0XLIg* z-uHRVea}7Tytk*akTEjf1lr<~fceIP7qDo^{;mRU1Fi+eftA1#VC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ja4aL@-rI!ptE7b>-auOl0%jmJy$?`G+xQvYD>j*EpC15s*ko$X} zC!i;wCm<}K+2PnP?Fu*o?m8%7Hw`KJBANo$fzdxC7B~a83Dx|x0=kZWWx}3-T<{6c W@hdlOtj<*c0000k}@P)u z!fmbm2^N;Zil88tT4^D^KomPsS*=wNY!nqA9E(k0$R?XHX4V52l9@AePLj)=n>tDS zC+h!I9cXm8cQ-HzWPvT!0CRq?o$l=0WpDcw5o3S=yJ!@vQg zUk7aWtFO3lgc)E6c#I+hldy|&@n}mZXzuq66e%a)888yJAOl+_Z()x#3iuu2Lm6#Rmi-6ec(LKz&OyCz<`f?V8DhL zWgzE;b3_@~02ZsPTL$`F8h8Lss;qlSL%f=SDav^eg-+K7vR*hx)LF1Zxh}*-$(4bc z!TbbfV=(JQQdl<`<{LN$KK~$UV$YTs?1(0S0?=-Zbr60?m8g7D0f)c>aA)PfqR(3l z>Fegw>LZgRVS(yZ@>j4iVCF@t;$Zi0SOj{2ZD1`;ai~nfn&Ss&rZrhB6xu=n0000< KMNUMnLSTaCo9y!d literal 0 HcmV?d00001 diff --git a/OpenKeychain/src/main/res/drawable-mdpi/ic_action_verified_cutout.png b/OpenKeychain/src/main/res/drawable-mdpi/ic_action_verified_cutout.png new file mode 100644 index 0000000000000000000000000000000000000000..0329b488f148461c3eedb1f9f3f4c1ae09e8dbfe GIT binary patch literal 751 zcmVJ7?~>_rC8{ucuDkd+zu9JkLG%obNfe zrqWICH)X5y- z5I@y3>XNDkR;$BJ2#0v6Zq3uE8DEC0fU)|wu7YXc0Pr&FVcsgZQbBw+b-e<(Lo!(x zBQiAo6^8w*x>LO#^k2-<$`W6reym{NSc>bYI#utVQTLWHaH)d$wScR~WJDSmEn{H3 zMe#9pd5Wh)eICTjnv8JNz>XHhzpL8@*8dw@hIt2^>r-7MN|EqdmI)4OM7vWi~5q!6-^?x&n z*{4pZ(`s+<>_Un8GMLT@x8sQn$3IB6?M8Kb3hV~<0IySVeZXMOn`dhTZ%|V|WVn8! zZVF=4ZN24+*SxwRots5=HIn>A9mt5UsSiqsYf={q3(-dPTMo&PNs(#9pD!t{dbo@M z)Ds0n&(zK8ev=ws2H|8bJdoTkAe=ILzGUH@y0TdV-TvLls$gC{7}Lo!fJuFSTtWPe z+LxzMWB`+cpPJN^vD$AR9D2<`BUiGqmOh$oE&5*TX h;Gd%H|AuWh@CWVJ44&4gPwoH!002ovPDHLkV1n)XP#pjO literal 0 HcmV?d00001 diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/ic_action_encrypt_file.png b/OpenKeychain/src/main/res/drawable-xhdpi/ic_action_encrypt_file.png new file mode 100644 index 0000000000000000000000000000000000000000..5f528864d8207cad08a7a8a395621382d6885804 GIT binary patch literal 836 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=EX7WqAsj$Z!;#Vf4nJ zsJsMW#sHP)KY)UgC9V-A!TD(=<%vb94CUqJdYO6I#mR{Use1WE>9gP2NHH)l9rSc@ z45^s&cD8-Ch@-@@`sL4m@@qRg=&&ejtw>lX#2uIuB64v5idGHBjo+Dnh^pL(h;qGP zB6Pv6gJY3K+{%ay0ilEMgt$E)W*b&l#FU+zxp!xE`Hi0k3#xZ-KELPlopWd2y@~O4 zSz)w#3-bjv$px|vW*en9$lbWs@34mL4%0nm-2}cLoHne-_DpqAS!SZ7bpGf$eZieC z7e{vINX%jMOTQi8n3=#R!LFCM?uGq{Rt@$cq1o^&8A!Fk)? zrSAL0(p(sByi}6uX58vHH&|c6Cg&T&Z>xRp8T!7SxPQXVy>YRFaKx5pdXCT2ymz}i zS^MSuqK-S8rv^X!-OzsEtwR*k8@1*CHHzg6^cIBi?wC=&;0&9|zxhk+_ZmqXh-l?E zoHp1YX8dK%#|ycP_qkl3oMSTJ+{3Kau=+q&{KPo695y)y@eiwQ4j4Uq`DSLmgIo+_ zT>9K49HqPsYxmVlcWJ{QL@ZVv5)+jt9(+Q@-1y+b$A31C_9H9pqDulgGY;((yO*8#=FMyRbMRK#*4oRmoWvqYL{229}MT92EACP1U zm3tHJpq_l7u4}Ive`~@&@e4;{7!PWEHrlyxLYpHNJA*5k|1mAssM@#e%eF1R6wl!4 L>gTe~DWM4fQ0H35 literal 0 HcmV?d00001 diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/ic_action_encrypt_text.png b/OpenKeychain/src/main/res/drawable-xhdpi/ic_action_encrypt_text.png new file mode 100644 index 0000000000000000000000000000000000000000..f8867e9229a4f05b9d6c3945919c1d3a8245dc34 GIT binary patch literal 976 zcmV;>126oEP)MlH zQ8XI;2ecFH#KzV)iVzDU7Qu)hMr{N|OQWC$!9-1!#6pAmvzQGzlAXJq-I?84_CBy= z?{@Y(v)`NNZzm-Yp~y_hx&T>IHz4Z*WKG@;m<}vXB9K=D+JINU5YPww0PX=xjg>?s zPsdyl=@vadMdYZ7W+`XGU>C3>IR6B60{y@SU_Yux{{yxH&mt*$@T*2Wj#d29ogy-G z!u1vr840fUgT1&nCYbpT^+dSevf zycn<$m=T^ zoty4hDIzZ=Im04yPM43*^MK312}@c6G!xQ)_}mBVwy0GC_Jv*W*?@-HNs{aNY(Og1 z4am9x3FrsT0$YGPz~49`d6)<2I0(E5&U;WZ#XY7XQ4N?zyxEv5dKrKCF>YbmfJWdV zuoIYXD(sjhU;!{t@m-|F&qQ>6KpA)foW#F}2Q{Q!0v4faW-BU8W{j=|9Aw6`qqsG*6fggHM4`7X=Andm5RT8gK~s=As}W*j}c-3Hvh7 zGeHyHp<;=X$lFZtJMhRLy`bI?bfDfBOv2QFHuMqMH0TA6*c3E1;JnSueV{0PfR@4= zVA=%EP%XqS0flb@g*U*o3EU_CTA(TBeNHhoAXe1HXA0j0 z3U7dE6IcTbTFUz-DwdZirUndRFCOsQl1?J(O~5eyY~Yuryr){yNrb5Z@12w)Lv&5R z*KH%#%cV2mqwS0=VZB^B10E3bb+cnSZ42rQc#T^7hXxWe;sVfZTeQ|LvGu@SU^)8N z-*0BW!GwYevQ0YazgK;6~C6ZIaeRN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fgGnSfEjnE%t%cmj%cplHSuP_zR@^B+g}{{N=mg8~2m002ov JPDHLkV1mf&gjWCn literal 0 HcmV?d00001 diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_encrypt_file.png b/OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_encrypt_file.png new file mode 100644 index 0000000000000000000000000000000000000000..c7732956318d8d5db19ecba0e6d6683a971ed8c4 GIT binary patch literal 1095 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGoEX7WqAsj$Z!;#Vf4nJ zn8$)Jqhx~{kij5X;u=vBoS#-wo>-L1P+nfHmzkGcoSayYs+V7sKKq@G6axeE5lLs6kD`LaBpMaaW;ovj$h!B1Yv`Zi0@EcTyMX zwJ0b_2;SKd;AohV+|ktEI-`Tzlylz!hYN*?Dgqkfrp{GXKHuNYd}Y;ITBq@1mR;%j zwZB$I*UDesyK0q|r_6HK@CEOeG$aH$7-%ZY5E1a<;z;u?VYND;71KKN=Uc8f$ESb3 zy}noNblm}^bw{js6uO+LzR_ks+hd0B1y8x7=5FydGmbLmQ%2kZ`-zNmHeusZ&t2) z^+@%Rd3fm8zX5;TwO2adf8U_~@zsHUjyZ?ymHT$e+>g2wlY8*q(~t%4&o|6&|0Zwr z>rt?GRi2OK(J!$F&K!8Xf5Z9@JNVtE7z@^lZIGMJ_olw}(zhS!GLkp^8Baghv+(au z&VKnGdA-#$?6_aB06n^o_t@O^dF!t~KD6+=*@J_er=rY1RDJ!kQIzj-_Mhk=kNLkC zZ*OEy-#X#7`JMF(@-K)pmOnZ?t@z(sxkEovLjvOGG4``RiD`E~#`@LufT?4pc`x^i z?grysv$pFqS$T7DsIjt4W@_?e^!_||*XM1b{wtQNNvB_0*wOpS?=0^Qm%VLiOWzz% zwz%jJ>HE>{-NBDP|Jqgv%Rj!RCOnlZqB;Fz)6vP7d<_=Mo!c93u5#vKqPqS+rsG$P z)7WSGgxz9!d%%0v{vX_D9>w03khzon(lxxDg=2@SZKZAQE~SN6cW-bxuWDBc{_YMYY-MAI3>5tbgn>=;SldHb!x(Q;_AAWB;WnF&g z$L}k`-`20Nugg33`PI}*lMTw&>`$>c*pG--Tr?Lgo|4?E}vfc=Fp`hwXgo0OL&_(E-#Wv-!@fe z_5vi6;30MpH8H{h61Q-0W~pLSXT#y(^{(49zSelN)EIt^D(Mb8zuo1)x|P=#S%*~Y zKHH+oRQ9+xGkl5io;Ls6J`ukJ>Q4QSKjdd~x$KhX{vBV-Y!>{xJC!$hW#Dd^p#Nq! t^uEr$XI1<2*`0Hf{-R_KyzcqQ|9$SBv%(B^-oQ-H;OXk;vd$@?2>`81;TZq` literal 0 HcmV?d00001 diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_encrypt_text.png b/OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_encrypt_text.png new file mode 100644 index 0000000000000000000000000000000000000000..15650500dd402428394083fdf519f1b1e0d456a8 GIT binary patch literal 1331 zcmV-31t<88FWQhbW?9;ba!ELWdL_~cP?peYja~^ zaAhuUa%Y?FJQ@H11h7d&K~#90?VVkSRaF$nf0I_yWR^YH2Ut-`C8-bPgalcELC^;g z5`9xxqJ6zY&|9w&5d=jKMi0^VLq>&Q51BlGfR5pD)Xo!x8W5JBOhjj+;z2n@o z&$)Y_wYz)$;K1y;>+H2=|L3fI_c?p-GvJ)V(BmZS0CL9!P{ssM#spBt1W?8VP-eDv z00}YxECz;(;}YO|V7NH`4C>6r0c|V--T+o~v3VbO1UL}Fp{1bXJPhohd*cJ#0qg`; zhj3~F2+snq0)w9R=K-66+k16vDG06xz5r&m{B8_*0r(R51y~B)0BitGZn4`BTmkH@ z?cF(-^D*e08*%Myan7ATgZ*;n-0lwhk9&zB_bcED;Ki2mufQ_kNSAXi2EL;`U9AGP z)(If@K44`>`9ZojK8Q%ql+@!*?g9+8{Cp7D=6T+xF7;F*X8{%f7qpbW0etiE@4&v6 zvI$UwvpULS70++A@2tz4oCQb%6F`~VZpO_=^7R7X+>XyK0v@PP*SwaWXBFo<;5T49 zaMY)goW=ngfaieI8u0ZOa1S11gIol-8ThbapNEiJ7=Ls#%B2r@RKe#wU~QREE&^Pp z8L6E5er#fIESIi}Ds= zBk&1uZAeFU1x#lQc!=YTKgBrm#4IQ#z;w1U^Q5ai$Ro*MR82wik>{UR0%wK{BrU1^j^PD3R+K|o%J=v(F+4*20jg2Rdu5R zJ_0O?9!19Z2vB+%8TH9AwXZ^#RJ50LqvE%9sGkgy@7vskunmgN49#k?Kx@5CRNSZD~&xZlliyuoR?> z380J#po|HiOo&c+hzRp#3KmAHHyJ_*aA9#6HLw(a4!lP81#w-$#{14}{5 z_y~~0rgF!$9Qz0`5$mht+3zanFa|QeW zJQX_-B@O`hlXxEh@Dgwf@OQ*mn&wkv75u1X5LI{19Ymf1ub|p)DQl3und>rv?B6in zLmeRB==LD}+Ab3KhS${A#hZZ}Yo0p++y%TBE}V2oeIVA?jSp!HFoEn^(zlHd=?XB3 zH2%BVfy5?70kUa)NKb%Crmlby^V^IJA002ovPDHLkV1ik;P^tg` literal 0 HcmV?d00001 diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_verified_cutout.png b/OpenKeychain/src/main/res/drawable-xxhdpi/ic_action_verified_cutout.png new file mode 100644 index 0000000000000000000000000000000000000000..49b13017c860975dc77f83fb1514063285af5648 GIT binary patch literal 2168 zcmZve_d6R57lvaiwbzH*wW(dBRBaJeTZkDF)E1;>Q)#RaZH@90rM1O~t*98WRjt;l z8darMy6~bt{rx@H^_=@U=eqxZC)L`@jD<;n2><}F0L_hUFX{O=jP#d#JrAjM30j09 z(4O&f;uw8WF7GR$=FW&q-{Nnmr1kGNUOxFFOu!L#A@B&KS2zrSL?Una2L~X$y+UC( zLc)Cu_H_j=C6T|9y?;a?41n?S?_)r^hY9}>Wzr=Ll3l~FNPU?QGfm|zl6;w$E6z~mOQ83%m8T+MB+xO4XpPrDI zf@ru-4_+Hl6#Ye;CiZB5uHssz{KrQ|_%{H|HnVl!f1=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*@|K@GUneFx@@Z~UB{I^l`>tzPx8=~u zNkD^eJ*U%imx=*~Yq_x#2GN{;oWR(c~)~mFfRDKV5~$yj)}rDal|k22aRw^kivp#R$a! zQRmtg%R&%Q!?6ON%JXhUK4;0`siWD4?M`&_FJ${>biPY=m)P`(oXhr4_3%R6tCjg_ rwJNvC_kcpSKj~yFJy3oBi8H=CZup6)*WFJq3jhFUVr5)s=$ZI`o*o8L literal 0 HcmV?d00001 diff --git a/OpenKeychain/src/main/res/layout/view_key_activity.xml b/OpenKeychain/src/main/res/layout/view_key_activity.xml index f9c23f065..ad46a8d62 100644 --- a/OpenKeychain/src/main/res/layout/view_key_activity.xml +++ b/OpenKeychain/src/main/res/layout/view_key_activity.xml @@ -9,11 +9,22 @@ + + - + android:layout_gravity="center_vertical" + android:layout_marginLeft="2dp" /> - + + android:text="" + android:textColor="@color/icons" + android:textAppearance="?android:attr/textAppearanceLarge" /> + - + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OpenKeychain/src/main/res/values-v21/dimens.xml b/OpenKeychain/src/main/res/values-v21/dimens.xml index 3a85cca93..eee21b52e 100644 --- a/OpenKeychain/src/main/res/values-v21/dimens.xml +++ b/OpenKeychain/src/main/res/values-v21/dimens.xml @@ -7,4 +7,5 @@ 24dp 141dp + 233dp \ No newline at end of file diff --git a/OpenKeychain/src/main/res/values/attr.xml b/OpenKeychain/src/main/res/values/attr.xml index 5dfa03987..98ce1c364 100644 --- a/OpenKeychain/src/main/res/values/attr.xml +++ b/OpenKeychain/src/main/res/values/attr.xml @@ -6,4 +6,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/OpenKeychain/src/main/res/values/dimens.xml b/OpenKeychain/src/main/res/values/dimens.xml index 7e361a358..08b072202 100644 --- a/OpenKeychain/src/main/res/values/dimens.xml +++ b/OpenKeychain/src/main/res/values/dimens.xml @@ -3,4 +3,5 @@ 0dp 120dp + 212dp \ No newline at end of file diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index 4a56274d7..730746787 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -582,8 +582,11 @@ "Change key configuration" - "This key has been revoked!" - "This key is expired!" + "Revoked: Key must not be used anymore!" + "Expired: The contact needs to extend the keys validity!" + "My Key" + "Verified Key" + "Unverified: Scan QR Code to verify key!" "Keys"