diff options
Diffstat (limited to 'OpenKeychain/src/main')
120 files changed, 873 insertions, 512 deletions
diff --git a/OpenKeychain/src/main/AndroidManifest.xml b/OpenKeychain/src/main/AndroidManifest.xml index 484c826f5..8d3518a81 100644 --- a/OpenKeychain/src/main/AndroidManifest.xml +++ b/OpenKeychain/src/main/AndroidManifest.xml @@ -53,10 +53,10 @@ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.NFC" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> - <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/> - <uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/> - <uses-permission android:name="android.permission.READ_SYNC_SETTINGS"/> - <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS"/> + <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" /> + <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" /> + <uses-permission android:name="android.permission.READ_SYNC_SETTINGS" /> + <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" /> <uses-permission android:name="android.permission.READ_CONTACTS" /> <uses-permission android:name="android.permission.WRITE_CONTACTS" /> <uses-permission android:name="android.permission.READ_PROFILE" /> @@ -84,17 +84,23 @@ android:name=".ui.FirstTimeActivity" android:configChanges="orientation|screenSize|keyboardHidden|keyboard" android:label="@string/app_name" - android:windowSoftInputMode="stateHidden" /> + android:windowSoftInputMode="stateAlwaysHidden" /> <activity android:name=".ui.CreateKeyActivity" android:configChanges="orientation|screenSize|keyboardHidden|keyboard" - android:label="@string/title_create_key" - android:windowSoftInputMode="stateHidden" /> + android:label="@string/title_create_key"> + <meta-data + android:name="android.support.PARENT_ACTIVITY" + android:value=".ui.KeyListActivity" /> + </activity> <activity android:name=".ui.EditKeyActivity" android:configChanges="orientation|screenSize|keyboardHidden|keyboard" - android:label="@string/title_edit_key" - android:windowSoftInputMode="stateHidden" /> + android:label="@string/title_edit_key" /> + <activity + android:name=".ui.QrCodeActivity" + android:configChanges="orientation|screenSize|keyboardHidden|keyboard" + android:label="@string/share_qr_code_dialog_title" /> <activity android:name=".ui.ViewKeyActivity" android:configChanges="orientation|screenSize|keyboardHidden|keyboard" @@ -464,24 +470,24 @@ <service android:name=".service.DummyAccountService"> <intent-filter> - <action android:name="android.accounts.AccountAuthenticator"/> + <action android:name="android.accounts.AccountAuthenticator" /> </intent-filter> <meta-data - android:name="android.accounts.AccountAuthenticator" - android:resource="@xml/account_desc"/> + android:name="android.accounts.AccountAuthenticator" + android:resource="@xml/account_desc" /> </service> <service android:name=".service.ContactSyncAdapterService"> <intent-filter> - <action android:name="android.content.SyncAdapter"/> + <action android:name="android.content.SyncAdapter" /> </intent-filter> <meta-data - android:name="android.content.SyncAdapter" - android:resource="@xml/sync_adapter_desc"/> + android:name="android.content.SyncAdapter" + android:resource="@xml/sync_adapter_desc" /> <meta-data - android:name="android.provider.CONTACTS_STRUCTURE" - android:resource="@xml/custom_pgp_contacts_structure"/> + android:name="android.provider.CONTACTS_STRUCTURE" + android:resource="@xml/custom_pgp_contacts_structure" /> </service> </application> diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java index c498bad0b..e9d7e5958 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java @@ -422,7 +422,8 @@ public class PgpKeyOperation { } // if this is~ the/a primary user id - if (currentCert.hasSubpackets() && currentCert.getHashedSubPackets().isPrimaryUserID()) { + if (currentCert.getHashedSubPackets() != null + && currentCert.getHashedSubPackets().isPrimaryUserID()) { // if it's the one we want, just leave it as is if (userId.equals(saveParcel.mChangePrimaryUserId)) { ok = true; @@ -749,7 +750,7 @@ public class PgpKeyOperation { int flags = 0; //noinspection unchecked for(PGPSignature sig : new IterableIterator<PGPSignature>(key.getSignatures())) { - if (!sig.hasSubpackets()) { + if (sig.getHashedSubPackets() == null) { continue; } flags |= sig.getHashedSubPackets().getKeyFlags(); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java index 8838075cd..de8c683ff 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/UncachedKeyRing.java @@ -513,7 +513,8 @@ public class UncachedKeyRing { } // if this certificate says it allows signing for the key - if (zert.getHashedSubPackets().hasSubpacket(SignatureSubpacketTags.KEY_FLAGS)) { + if (zert.getHashedSubPackets() != null && + zert.getHashedSubPackets().hasSubpacket(SignatureSubpacketTags.KEY_FLAGS)) { int flags = ((KeyFlags) zert.getHashedSubPackets() .getSubpacket(SignatureSubpacketTags.KEY_FLAGS)).getFlags(); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/WrappedSignature.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/WrappedSignature.java index df19930c4..28e4c51d6 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/WrappedSignature.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/WrappedSignature.java @@ -63,13 +63,17 @@ public class WrappedSignature { } try { PGPSignatureList list; - list = mSig.getHashedSubPackets().getEmbeddedSignatures(); - for(int i = 0; i < list.size(); i++) { - sigs.add(new WrappedSignature(list.get(i))); + if (mSig.getHashedSubPackets() != null) { + list = mSig.getHashedSubPackets().getEmbeddedSignatures(); + for (int i = 0; i < list.size(); i++) { + sigs.add(new WrappedSignature(list.get(i))); + } } - list = mSig.getUnhashedSubPackets().getEmbeddedSignatures(); - for(int i = 0; i < list.size(); i++) { - sigs.add(new WrappedSignature(list.get(i))); + if (mSig.getUnhashedSubPackets() != null) { + list = mSig.getUnhashedSubPackets().getEmbeddedSignatures(); + for (int i = 0; i < list.size(); i++) { + sigs.add(new WrappedSignature(list.get(i))); + } } } catch (PGPException e) { // no matter @@ -97,6 +101,9 @@ public class WrappedSignature { if(!isRevocation()) { throw new PgpGeneralException("Not a revocation signature."); } + if (mSig.getHashedSubPackets() == null) { + return null; + } SignatureSubpacket p = mSig.getHashedSubPackets().getSubpacket( SignatureSubpacketTags.REVOCATION_REASON); // For some reason, this is missing in SignatureSubpacketInputStream:146 @@ -205,7 +212,7 @@ public class WrappedSignature { } public boolean isLocal() { - if (!mSig.hasSubpackets() + if (mSig.getHashedSubPackets() == null || !mSig.getHashedSubPackets().hasSubpacket(SignatureSubpacketTags.EXPORTABLE)) { return false; } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/PassphraseCacheService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/PassphraseCacheService.java index 13d9b497f..cfb3d50f4 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/PassphraseCacheService.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/PassphraseCacheService.java @@ -18,9 +18,9 @@ package org.sufficientlysecure.keychain.service; import android.app.AlarmManager; +import android.app.Notification; import android.app.PendingIntent; import android.app.Service; -import android.app.NotificationManager; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; @@ -70,7 +70,7 @@ public class PassphraseCacheService extends Service { public static final String EXTRA_KEY_ID = "key_id"; public static final String EXTRA_PASSPHRASE = "passphrase"; public static final String EXTRA_MESSENGER = "messenger"; - public static final String EXTRA_USERID = "userid"; + public static final String EXTRA_USER_ID = "user_id"; private static final int REQUEST_ID = 0; private static final long DEFAULT_TTL = 15; @@ -102,7 +102,7 @@ public class PassphraseCacheService extends Service { intent.putExtra(EXTRA_TTL, Preferences.getPreferences(context).getPassphraseCacheTtl()); intent.putExtra(EXTRA_PASSPHRASE, passphrase); intent.putExtra(EXTRA_KEY_ID, keyId); - intent.putExtra(EXTRA_USERID, primaryUserId); + intent.putExtra(EXTRA_USER_ID, primaryUserId); context.startService(intent); } @@ -201,18 +201,18 @@ public class PassphraseCacheService extends Service { // get cached passphrase CachedPassphrase cachedPassphrase = mPassphraseCache.get(keyId); if (cachedPassphrase == null) { - Log.d(Constants.TAG, "PassphraseCacheService Passphrase not (yet) cached, returning null"); + Log.d(Constants.TAG, "PassphraseCacheService: Passphrase not (yet) cached, returning null"); // not really an error, just means the passphrase is not cached but not empty either return null; } // set it again to reset the cache life cycle - Log.d(Constants.TAG, "PassphraseCacheService Cache passphrase again when getting it!"); + Log.d(Constants.TAG, "PassphraseCacheService: Cache passphrase again when getting it!"); addCachedPassphrase(this, keyId, cachedPassphrase.getPassphrase(), cachedPassphrase.getPrimaryUserID()); return cachedPassphrase.getPassphrase(); } catch (ProviderHelper.NotFoundException e) { - Log.e(Constants.TAG, "PassphraseCacheService Passphrase for unknown key was requested!"); + Log.e(Constants.TAG, "PassphraseCacheService: Passphrase for unknown key was requested!"); return null; } } @@ -229,7 +229,7 @@ public class PassphraseCacheService extends Service { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); - Log.d(Constants.TAG, "PassphraseCacheService Received broadcast..."); + Log.d(Constants.TAG, "PassphraseCacheService: Received broadcast..."); if (action.equals(BROADCAST_ACTION_PASSPHRASE_CACHE_SERVICE)) { long keyId = intent.getLongExtra(EXTRA_KEY_ID, -1); @@ -254,10 +254,8 @@ public class PassphraseCacheService extends Service { private static PendingIntent buildIntent(Context context, long keyId) { Intent intent = new Intent(BROADCAST_ACTION_PASSPHRASE_CACHE_SERVICE); intent.putExtra(EXTRA_KEY_ID, keyId); - PendingIntent sender = PendingIntent.getBroadcast(context, REQUEST_ID, intent, + return PendingIntent.getBroadcast(context, REQUEST_ID, intent, PendingIntent.FLAG_CANCEL_CURRENT); - - return sender; } /** @@ -276,11 +274,12 @@ public class PassphraseCacheService extends Service { long keyId = intent.getLongExtra(EXTRA_KEY_ID, -1); String passphrase = intent.getStringExtra(EXTRA_PASSPHRASE); - String primaryUserID = intent.getStringExtra(EXTRA_USERID); + String primaryUserID = intent.getStringExtra(EXTRA_USER_ID); Log.d(Constants.TAG, - "PassphraseCacheService Received ACTION_PASSPHRASE_CACHE_ADD intent in onStartCommand() with keyId: " - + keyId + ", ttl: " + ttl + ", usrId: " + primaryUserID); + "PassphraseCacheService: Received ACTION_PASSPHRASE_CACHE_ADD intent in onStartCommand() with keyId: " + + keyId + ", ttl: " + ttl + ", usrId: " + primaryUserID + ); // add keyId, passphrase and primary user id to memory mPassphraseCache.put(keyId, new CachedPassphrase(passphrase, primaryUserID)); @@ -292,8 +291,7 @@ public class PassphraseCacheService extends Service { am.set(AlarmManager.RTC_WAKEUP, triggerTime, buildIntent(this, keyId)); } - updateNotifications(); - + updateService(); } else if (ACTION_PASSPHRASE_CACHE_GET.equals(intent.getAction())) { long keyId = intent.getLongExtra(EXTRA_KEY_ID, -1); Messenger messenger = intent.getParcelableExtra(EXTRA_MESSENGER); @@ -307,21 +305,21 @@ public class PassphraseCacheService extends Service { try { messenger.send(msg); } catch (RemoteException e) { - Log.e(Constants.TAG, "PassphraseCacheService Sending message failed", e); + Log.e(Constants.TAG, "PassphraseCacheService: Sending message failed", e); } } else if (ACTION_PASSPHRASE_CACHE_CLEAR.equals(intent.getAction())) { AlarmManager am = (AlarmManager) this.getSystemService(Context.ALARM_SERVICE); // Stop all ttl alarms - for(int i = 0; i < mPassphraseCache.size(); i++) { + for (int i = 0; i < mPassphraseCache.size(); i++) { am.cancel(buildIntent(this, mPassphraseCache.keyAt(i))); } mPassphraseCache.clear(); - updateNotifications(); + updateService(); } else { - Log.e(Constants.TAG, "PassphraseCacheService Intent or Intent Action not supported!"); + Log.e(Constants.TAG, "PassphraseCacheService: Intent or Intent Action not supported!"); } } @@ -340,79 +338,74 @@ public class PassphraseCacheService extends Service { Log.d(Constants.TAG, "PassphraseCacheService Timeout of keyId " + keyId + ", removed from memory!"); - // stop whole service if no cached passphrases remaining - if (mPassphraseCache.size() == 0) { - Log.d(Constants.TAG, "PassphraseCacheServic No passphrases remaining in memory, stopping service!"); - stopSelf(); - } - - updateNotifications(); + updateService(); } - private void updateNotifications() { - NotificationManager notificationManager = - (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + private void updateService() { + if (mPassphraseCache.size() > 0) { + startForeground(NOTIFICATION_ID, getNotification()); + } else { + // stop whole service if no cached passphrases remaining + Log.d(Constants.TAG, "PassphraseCacheService: No passphrases remaining in memory, stopping service!"); + stopForeground(true); + } + } - if(mPassphraseCache.size() > 0) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { - NotificationCompat.Builder builder = new NotificationCompat.Builder(this); + private Notification getNotification() { + NotificationCompat.Builder builder = new NotificationCompat.Builder(this); - builder.setSmallIcon(R.drawable.ic_launcher) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { + builder.setSmallIcon(R.drawable.ic_launcher) .setContentTitle(getString(R.string.app_name)) - .setContentText(String.format(getString(R.string.passp_cache_notif_n_keys), mPassphraseCache.size())); + .setContentText(String.format(getString(R.string.passp_cache_notif_n_keys), + mPassphraseCache.size())); - NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle(); + NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle(); - inboxStyle.setBigContentTitle(getString(R.string.passp_cache_notif_keys)); + inboxStyle.setBigContentTitle(getString(R.string.passp_cache_notif_keys)); - // Moves events into the big view - for (int i = 0; i < mPassphraseCache.size(); i++) { - inboxStyle.addLine(mPassphraseCache.valueAt(i).getPrimaryUserID()); - } + // Moves events into the big view + for (int i = 0; i < mPassphraseCache.size(); i++) { + inboxStyle.addLine(mPassphraseCache.valueAt(i).getPrimaryUserID()); + } - // Moves the big view style object into the notification object. - builder.setStyle(inboxStyle); + // Moves the big view style object into the notification object. + builder.setStyle(inboxStyle); - // Add purging action - Intent intent = new Intent(getApplicationContext(), PassphraseCacheService.class); - intent.setAction(ACTION_PASSPHRASE_CACHE_CLEAR); - builder.addAction( + // Add purging action + Intent intent = new Intent(getApplicationContext(), PassphraseCacheService.class); + intent.setAction(ACTION_PASSPHRASE_CACHE_CLEAR); + builder.addAction( R.drawable.abc_ic_clear_normal, getString(R.string.passp_cache_notif_clear), PendingIntent.getService( - getApplicationContext(), - 0, - intent, - PendingIntent.FLAG_UPDATE_CURRENT + getApplicationContext(), + 0, + intent, + PendingIntent.FLAG_UPDATE_CURRENT ) - ); - - notificationManager.notify(NOTIFICATION_ID, builder.build()); - } else { // Fallback, since expandable notifications weren't available back then - NotificationCompat.Builder builder = new NotificationCompat.Builder(this); - - builder.setSmallIcon(R.drawable.ic_launcher) - .setContentTitle(String.format(getString(R.string.passp_cache_notif_n_keys, mPassphraseCache.size()))) + ); + } else { + // Fallback, since expandable notifications weren't available back then + builder.setSmallIcon(R.drawable.ic_launcher) + .setContentTitle(String.format(getString(R.string.passp_cache_notif_n_keys, + mPassphraseCache.size()))) .setContentText(getString(R.string.passp_cache_notif_click_to_clear)); - Intent intent = new Intent(getApplicationContext(), PassphraseCacheService.class); - intent.setAction(ACTION_PASSPHRASE_CACHE_CLEAR); + Intent intent = new Intent(getApplicationContext(), PassphraseCacheService.class); + intent.setAction(ACTION_PASSPHRASE_CACHE_CLEAR); - builder.setContentIntent( + builder.setContentIntent( PendingIntent.getService( - getApplicationContext(), - 0, - intent, - PendingIntent.FLAG_UPDATE_CURRENT + getApplicationContext(), + 0, + intent, + PendingIntent.FLAG_UPDATE_CURRENT ) - ); - - notificationManager.notify(NOTIFICATION_ID, builder.build()); - } - - } else { - notificationManager.cancel(NOTIFICATION_ID); + ); } + + return builder.build(); } @Override @@ -455,6 +448,7 @@ public class PassphraseCacheService extends Service { public String getPrimaryUserID() { return primaryUserID; } + public String getPassphrase() { return passphrase; } @@ -462,6 +456,7 @@ public class PassphraseCacheService extends Service { public void setPrimaryUserID(String primaryUserID) { this.primaryUserID = primaryUserID; } + public void setPassphrase(String passphrase) { this.passphrase = passphrase; } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CertifyKeyActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CertifyKeyActivity.java index 301b4ad40..5e20b24b5 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CertifyKeyActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CertifyKeyActivity.java @@ -20,6 +20,7 @@ package org.sufficientlysecure.keychain.ui; import android.app.ProgressDialog; import android.content.Intent; import android.database.Cursor; +import android.graphics.PorterDuff; import android.net.Uri; import android.os.Bundle; import android.os.Handler; @@ -37,6 +38,7 @@ import android.widget.ArrayAdapter; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.CompoundButton.OnCheckedChangeListener; +import android.widget.ImageView; import android.widget.ListView; import android.widget.Spinner; import android.widget.TextView; @@ -64,7 +66,8 @@ import java.util.ArrayList; */ public class CertifyKeyActivity extends ActionBarActivity implements SelectSecretKeyLayoutFragment.SelectSecretKeyCallback, LoaderManager.LoaderCallbacks<Cursor> { - private View mSignButton; + private View mCertifyButton; + private ImageView mActionCertifyImage; private CheckBox mUploadKeyCheckbox; private Spinner mSelectKeyserverSpinner; @@ -88,10 +91,19 @@ public class CertifyKeyActivity extends ActionBarActivity implements mSelectKeyFragment = (SelectSecretKeyLayoutFragment) getSupportFragmentManager() .findFragmentById(R.id.sign_key_select_key_fragment); + mSelectKeyserverSpinner = (Spinner) findViewById(R.id.upload_key_keyserver); + mUploadKeyCheckbox = (CheckBox) findViewById(R.id.sign_key_upload_checkbox); + mCertifyButton = findViewById(R.id.certify_key_certify_button); + mActionCertifyImage = (ImageView) findViewById(R.id.certify_key_action_certify_image); + mUserIds = (ListView) findViewById(R.id.view_key_user_ids); + + // make certify image gray, like action icons + mActionCertifyImage.setColorFilter(getResources().getColor(R.color.tertiary_text_light), + PorterDuff.Mode.SRC_IN); + mSelectKeyFragment.setCallback(this); mSelectKeyFragment.setFilterCertify(true); - mSelectKeyserverSpinner = (Spinner) findViewById(R.id.upload_key_keyserver); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, Preferences.getPreferences(this) .getKeyServers() @@ -99,7 +111,6 @@ public class CertifyKeyActivity extends ActionBarActivity implements adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); mSelectKeyserverSpinner.setAdapter(adapter); - mUploadKeyCheckbox = (CheckBox) findViewById(R.id.sign_key_upload_checkbox); if (!mUploadKeyCheckbox.isChecked()) { mSelectKeyserverSpinner.setEnabled(false); } else { @@ -118,8 +129,7 @@ public class CertifyKeyActivity extends ActionBarActivity implements } }); - mSignButton = findViewById(R.id.sign_key_sign_button); - mSignButton.setOnClickListener(new OnClickListener() { + mCertifyButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { @@ -141,7 +151,6 @@ public class CertifyKeyActivity extends ActionBarActivity implements } Log.e(Constants.TAG, "uri: " + mDataUri); - mUserIds = (ListView) findViewById(R.id.view_key_user_ids); mUserIdsAdapter = new UserIdsAdapter(this, null, 0, true); mUserIds.setAdapter(mUserIdsAdapter); @@ -230,7 +239,8 @@ public class CertifyKeyActivity extends ActionBarActivity implements startSigning(); } } - }); + } + ); // bail out; need to wait until the user has entered the passphrase before trying again return; } else { diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyActivity.java index fe1b7e688..3cf89f6a4 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyActivity.java @@ -20,6 +20,7 @@ package org.sufficientlysecure.keychain.ui; import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; +import android.net.Uri; import android.os.Bundle; import android.os.Message; import android.os.Messenger; @@ -31,7 +32,11 @@ import android.view.View; import android.widget.ArrayAdapter; import android.widget.AutoCompleteTextView; import android.widget.Button; +import android.widget.CheckBox; import android.widget.EditText; +import android.widget.Spinner; + +import com.devspark.appmsg.AppMsg; import org.spongycastle.bcpg.sig.KeyFlags; import org.sufficientlysecure.keychain.Constants; @@ -48,7 +53,8 @@ public class CreateKeyActivity extends ActionBarActivity { AutoCompleteTextView mNameEdit; AutoCompleteTextView mEmailEdit; EditText mPassphraseEdit; - Button mCreateButton; + View mCreateButton; + CheckBox mUploadCheckbox; @Override protected void onCreate(Bundle savedInstanceState) { @@ -59,7 +65,8 @@ public class CreateKeyActivity extends ActionBarActivity { mNameEdit = (AutoCompleteTextView) findViewById(R.id.name); mEmailEdit = (AutoCompleteTextView) findViewById(R.id.email); mPassphraseEdit = (EditText) findViewById(R.id.passphrase); - mCreateButton = (Button) findViewById(R.id.create_key_button); + mCreateButton = findViewById(R.id.create_key_button); + mUploadCheckbox = (CheckBox) findViewById(R.id.create_key_upload); mEmailEdit.setThreshold(1); // Start working from first character mEmailEdit.setAdapter( @@ -134,10 +141,15 @@ public class CreateKeyActivity extends ActionBarActivity { // handle messages by standard KeychainIntentServiceHandler first super.handleMessage(message); - if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) { - CreateKeyActivity.this.setResult(RESULT_OK); - CreateKeyActivity.this.finish(); - } + // TODO +// if (mUploadCheckbox.isChecked()) { +// uploadKey(); +// } else { + if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) { + CreateKeyActivity.this.setResult(RESULT_OK); + CreateKeyActivity.this.finish(); + } +// } } }; @@ -166,6 +178,54 @@ public class CreateKeyActivity extends ActionBarActivity { startService(intent); } + private void uploadKey() { + // Send all information needed to service to upload key in other thread + Intent intent = new Intent(this, KeychainIntentService.class); + + intent.setAction(KeychainIntentService.ACTION_UPLOAD_KEYRING); + + // set data uri as path to keyring + // TODO +// Uri blobUri = KeychainContract.KeyRingData.buildPublicKeyRingUri(mDataUri); +// intent.setData(blobUri); + + // fill values for this action + Bundle data = new Bundle(); + + Spinner keyServer = (Spinner) findViewById(R.id.upload_key_keyserver); + String server = (String) keyServer.getSelectedItem(); + data.putString(KeychainIntentService.UPLOAD_KEY_SERVER, server); + + intent.putExtra(KeychainIntentService.EXTRA_DATA, data); + + // Message is received after uploading is done in KeychainIntentService + KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(this, + getString(R.string.progress_exporting), ProgressDialog.STYLE_HORIZONTAL) { + public void handleMessage(Message message) { + // handle messages by standard KeychainIntentServiceHandler first + super.handleMessage(message); + + if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) { + AppMsg.makeText(CreateKeyActivity.this, R.string.key_send_success, + AppMsg.STYLE_INFO).show(); + + CreateKeyActivity.this.setResult(RESULT_OK); + CreateKeyActivity.this.finish(); + } + } + }; + + // Create a new Messenger for the communication back + Messenger messenger = new Messenger(saveHandler); + intent.putExtra(KeychainIntentService.EXTRA_MESSENGER, messenger); + + // show progress dialog + saveHandler.showProgressDialog(this); + + // start service with intent + startService(intent); + } + /** * Checks if text of given EditText is not empty. If it is empty an error is * set and the EditText gets the focus. @@ -177,7 +237,7 @@ public class CreateKeyActivity extends ActionBarActivity { private static boolean isEditTextNotEmpty(Context context, EditText editText) { boolean output = true; if (editText.getText().toString().length() == 0) { - editText.setError("empty!"); + editText.setError(context.getString(R.string.create_key_empty)); editText.requestFocus(); output = false; } else { diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java index 6ff8d421b..345e38a0e 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFileFragment.java @@ -57,7 +57,7 @@ public class EncryptFileFragment extends Fragment { public static final String ARG_FILENAME = "filename"; public static final String ARG_ASCII_ARMOR = "ascii_armor"; - private static final int RESULT_CODE_FILE = 0x00007003; + private static final int REQUEST_CODE_FILE = 0x00007003; private EncryptActivityInterface mEncryptInterface; @@ -108,10 +108,10 @@ public class EncryptFileFragment extends Fragment { mBrowse.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { if (Constants.KITKAT) { - FileHelper.openDocument(EncryptFileFragment.this, mInputUri, "*/*", RESULT_CODE_FILE); + FileHelper.openDocument(EncryptFileFragment.this, mInputUri, "*/*", REQUEST_CODE_FILE); } else { FileHelper.openFile(EncryptFileFragment.this, mFilename.getText().toString(), "*/*", - RESULT_CODE_FILE); + REQUEST_CODE_FILE); } } }); @@ -389,7 +389,7 @@ public class EncryptFileFragment extends Fragment { @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { - case RESULT_CODE_FILE: { + case REQUEST_CODE_FILE: { if (resultCode == Activity.RESULT_OK && data != null) { if (Constants.KITKAT) { mInputUri = data.getData(); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/FirstTimeActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/FirstTimeActivity.java index 4271b2d5a..5f3f170a1 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/FirstTimeActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/FirstTimeActivity.java @@ -22,16 +22,19 @@ import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.view.View; import android.view.Window; -import android.widget.Button; +import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.helper.Preferences; +import org.sufficientlysecure.keychain.util.Log; public class FirstTimeActivity extends ActionBarActivity { - Button mCreateKey; - Button mImportKey; - Button mSkipSetup; + View mCreateKey; + View mImportKey; + View mSkipSetup; + + public static final int REQUEST_CODE_CREATE_OR_IMPORT_KEY = 0x00007012; @Override protected void onCreate(Bundle savedInstanceState) { @@ -41,9 +44,9 @@ public class FirstTimeActivity extends ActionBarActivity { setContentView(R.layout.first_time_activity); - mCreateKey = (Button) findViewById(R.id.first_time_create_key); - mImportKey = (Button) findViewById(R.id.first_time_import_key); - mSkipSetup = (Button) findViewById(R.id.first_time_cancel); + mCreateKey = findViewById(R.id.first_time_create_key); + mImportKey = findViewById(R.id.first_time_import_key); + mSkipSetup = findViewById(R.id.first_time_cancel); mSkipSetup.setOnClickListener(new View.OnClickListener() { @Override @@ -57,7 +60,7 @@ public class FirstTimeActivity extends ActionBarActivity { public void onClick(View v) { Intent intent = new Intent(FirstTimeActivity.this, ImportKeysActivity.class); intent.setAction(ImportKeysActivity.ACTION_IMPORT_KEY_FROM_FILE_AND_RETURN); - startActivityForResult(intent, 1); + startActivityForResult(intent, REQUEST_CODE_CREATE_OR_IMPORT_KEY); } }); @@ -65,7 +68,7 @@ public class FirstTimeActivity extends ActionBarActivity { @Override public void onClick(View v) { Intent intent = new Intent(FirstTimeActivity.this, CreateKeyActivity.class); - startActivityForResult(intent, 1); + startActivityForResult(intent, REQUEST_CODE_CREATE_OR_IMPORT_KEY); } }); @@ -75,8 +78,12 @@ public class FirstTimeActivity extends ActionBarActivity { protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); - if (resultCode == RESULT_OK) { - finishSetup(); + if (requestCode == REQUEST_CODE_CREATE_OR_IMPORT_KEY) { + if (resultCode == RESULT_OK) { + finishSetup(); + } + } else { + Log.e(Constants.TAG, "No valid request code!"); } } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListActivity.java index aaf9f7cbf..c74f4c96c 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListActivity.java @@ -108,6 +108,8 @@ public class KeyListActivity extends DrawerActivity { return true; case R.id.menu_key_list_debug_first_time: + Preferences prefs = Preferences.getPreferences(this); + prefs.setFirstTime(true); Intent intent = new Intent(this, FirstTimeActivity.class); startActivity(intent); finish(); 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 5e2e4cb43..9f1ac0cdd 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java @@ -22,6 +22,7 @@ import android.content.Context; import android.content.Intent; import android.database.Cursor; import android.graphics.Color; +import android.graphics.PorterDuff; import android.net.Uri; import android.os.Build; import android.os.Bundle; @@ -85,6 +86,7 @@ public class KeyListFragment extends LoaderFragment private Button mButtonEmptyCreate; private Button mButtonEmptyImport; + public static final int REQUEST_CODE_CREATE_OR_IMPORT_KEY = 0x00007012; /** * Load custom layout with StickyListView from library @@ -104,7 +106,7 @@ public class KeyListFragment extends LoaderFragment @Override public void onClick(View v) { Intent intent = new Intent(getActivity(), CreateKeyActivity.class); - startActivity(intent); + startActivityForResult(intent, REQUEST_CODE_CREATE_OR_IMPORT_KEY); } }); mButtonEmptyImport = (Button) view.findViewById(R.id.key_list_empty_button_import); @@ -113,8 +115,8 @@ public class KeyListFragment extends LoaderFragment @Override public void onClick(View v) { Intent intent = new Intent(getActivity(), ImportKeysActivity.class); - intent.setAction(ImportKeysActivity.ACTION_IMPORT_KEY_FROM_FILE); - startActivityForResult(intent, 0); + intent.setAction(ImportKeysActivity.ACTION_IMPORT_KEY_FROM_FILE_AND_RETURN); + startActivityForResult(intent, REQUEST_CODE_CREATE_OR_IMPORT_KEY); } }); @@ -433,9 +435,7 @@ public class KeyListFragment extends LoaderFragment private class ItemViewHolder { TextView mMainUserId; TextView mMainUserIdRest; - FrameLayout mStatusLayout; - TextView mRevoked; - ImageView mVerified; + ImageView mStatus; } @Override @@ -444,9 +444,7 @@ public class KeyListFragment extends LoaderFragment ItemViewHolder holder = new ItemViewHolder(); holder.mMainUserId = (TextView) view.findViewById(R.id.mainUserId); holder.mMainUserIdRest = (TextView) view.findViewById(R.id.mainUserIdRest); - holder.mStatusLayout = (FrameLayout) view.findViewById(R.id.status_layout); - holder.mRevoked = (TextView) view.findViewById(R.id.revoked); - holder.mVerified = (ImageView) view.findViewById(R.id.verified); + holder.mStatus = (ImageView) view.findViewById(R.id.status_image); view.setTag(holder); return view; } @@ -482,25 +480,36 @@ public class KeyListFragment extends LoaderFragment if (cursor.getInt(KeyListFragment.INDEX_HAS_ANY_SECRET) != 0) { // this is a secret key - h.mStatusLayout.setVisibility(View.VISIBLE); - h.mRevoked.setVisibility(View.GONE); - h.mVerified.setVisibility(View.GONE); + h.mStatus.setVisibility(View.GONE); } else { - // this is a public key - show if it's revoked + // this is a public key - show if it's revoked, expired, or verified boolean isRevoked = cursor.getInt(INDEX_IS_REVOKED) > 0; boolean isExpired = !cursor.isNull(INDEX_EXPIRY) && new Date(cursor.getLong(INDEX_EXPIRY)*1000).before(new Date()); - if(isRevoked || isExpired) { - h.mStatusLayout.setVisibility(View.VISIBLE); - h.mRevoked.setVisibility(View.VISIBLE); - h.mVerified.setVisibility(View.GONE); - h.mRevoked.setText(isRevoked ? R.string.revoked : R.string.expired); + boolean isVerified = cursor.getInt(INDEX_VERIFIED) > 0; + + // Note: order is important! + if (isRevoked) { + h.mStatus.setImageDrawable( + getResources().getDrawable(R.drawable.status_signature_revoked_cutout)); + h.mStatus.setColorFilter(getResources().getColor(R.color.result_red), + PorterDuff.Mode.SRC_ATOP); + h.mStatus.setVisibility(View.VISIBLE); + } else if (isExpired) { + h.mStatus.setImageDrawable( + getResources().getDrawable(R.drawable.status_signature_expired_cutout)); + h.mStatus.setColorFilter(getResources().getColor(R.color.result_orange), + PorterDuff.Mode.SRC_ATOP); + h.mStatus.setVisibility(View.VISIBLE); + } else if (isVerified) { + h.mStatus.setImageDrawable( + getResources().getDrawable(R.drawable.status_signature_verified_cutout)); + h.mStatus.setColorFilter(getResources().getColor(R.color.result_green), + PorterDuff.Mode.SRC_ATOP); + h.mStatus.setVisibility(View.VISIBLE); } else { - boolean isVerified = cursor.getInt(INDEX_VERIFIED) > 0; - h.mStatusLayout.setVisibility(isVerified ? View.VISIBLE : View.GONE); - h.mRevoked.setVisibility(View.GONE); - h.mVerified.setVisibility(isVerified ? View.VISIBLE : View.GONE); + h.mStatus.setVisibility(View.GONE); } } } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/QrCodeActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/QrCodeActivity.java new file mode 100644 index 000000000..f4d395ae6 --- /dev/null +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/QrCodeActivity.java @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2014 Dominik Schürmann <dominik@dominikschuermann.de> + * + * 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 <http://www.gnu.org/licenses/>. + */ + +package org.sufficientlysecure.keychain.ui; + +import android.net.Uri; +import android.os.Bundle; +import android.support.v7.app.ActionBarActivity; +import android.view.View; +import android.widget.ImageView; + +import com.devspark.appmsg.AppMsg; + +import org.sufficientlysecure.keychain.Constants; +import org.sufficientlysecure.keychain.R; +import org.sufficientlysecure.keychain.helper.ActionBarHelper; +import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; +import org.sufficientlysecure.keychain.provider.KeychainContract; +import org.sufficientlysecure.keychain.provider.ProviderHelper; +import org.sufficientlysecure.keychain.util.Log; +import org.sufficientlysecure.keychain.util.QrCodeUtils; + +public class QrCodeActivity extends ActionBarActivity { + + private ImageView mFingerprintQrCode; + + private static final int QR_CODE_SIZE = 1000; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + // Inflate a "Done" custom action bar + ActionBarHelper.setOneButtonView(getSupportActionBar(), + R.string.btn_okay, R.drawable.ic_action_done, + new View.OnClickListener() { + @Override + public void onClick(View v) { + // "Done" + finish(); + } + } + ); + + setContentView(R.layout.qr_code_activity); + + Uri dataUri = getIntent().getData(); + if (dataUri == null) { + Log.e(Constants.TAG, "Data missing. Should be Uri of key!"); + finish(); + return; + } + + mFingerprintQrCode = (ImageView) findViewById(R.id.qr_code_image); + + mFingerprintQrCode.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + finish(); + } + }); + + ProviderHelper providerHelper = new ProviderHelper(this); + try { + byte[] blob = (byte[]) providerHelper.getGenericData( + KeychainContract.KeyRings.buildUnifiedKeyRingUri(dataUri), + KeychainContract.KeyRings.FINGERPRINT, ProviderHelper.FIELD_TYPE_BLOB); + if (blob == null) { + Log.e(Constants.TAG, "key not found!"); + AppMsg.makeText(this, R.string.error_key_not_found, AppMsg.STYLE_ALERT).show(); + finish(); + } + + String fingerprint = PgpKeyHelper.convertFingerprintToHex(blob); + String qrCodeContent = Constants.FINGERPRINT_SCHEME + ":" + fingerprint; + mFingerprintQrCode.setImageBitmap(QrCodeUtils.getQRCodeBitmap(qrCodeContent, QR_CODE_SIZE)); + } catch (ProviderHelper.NotFoundException e) { + Log.e(Constants.TAG, "key not found!", e); + AppMsg.makeText(this, R.string.error_key_not_found, AppMsg.STYLE_ALERT).show(); + finish(); + } + } + + @Override + protected void onResume() { + super.onResume(); + + // custom activity transition to get zoom in effect + this.overridePendingTransition(R.anim.zoom_enter, android.R.anim.fade_out); + } + + @Override + protected void onPause() { + super.onPause(); + + // custom activity transition to get zoom out effect + this.overridePendingTransition(0, R.anim.zoom_exit); + } + +}
\ No newline at end of file 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 f92977dbe..7a833026b 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.PorterDuff; import android.net.Uri; import android.nfc.NdefMessage; import android.nfc.NdefRecord; @@ -42,6 +43,9 @@ import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.Window; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; @@ -79,9 +83,11 @@ public class ViewKeyActivity extends ActionBarActivity implements private ViewPager mViewPager; private SlidingTabLayout mSlidingTabLayout; private PagerTabStripAdapter mTabsAdapter; + + private LinearLayout mStatusLayout; + private TextView mStatusText; + private ImageView mStatusImage; private View mStatusDivider; - private View mStatusRevoked; - private View mStatusExpired; public static final int REQUEST_CODE_LOOKUP_KEY = 0x00007006; @@ -113,9 +119,10 @@ public class ViewKeyActivity extends ActionBarActivity implements setContentView(R.layout.view_key_activity); - mStatusDivider = findViewById(R.id.status_divider); - mStatusRevoked = findViewById(R.id.view_key_revoked); - mStatusExpired = findViewById(R.id.view_key_expired); + mStatusLayout = (LinearLayout) findViewById(R.id.view_key_status_layout); + mStatusText = (TextView) findViewById(R.id.view_key_status_text); + mStatusImage = (ImageView) findViewById(R.id.view_key_status_image); + mStatusDivider = findViewById(R.id.view_key_status_divider); mViewPager = (ViewPager) findViewById(R.id.view_key_pager); mSlidingTabLayout = (SlidingTabLayout) findViewById(R.id.view_key_sliding_tab_layout); @@ -502,22 +509,32 @@ public class ViewKeyActivity extends ActionBarActivity implements String keyIdStr = PgpKeyHelper.convertKeyIdToHex(masterKeyId); getSupportActionBar().setSubtitle(keyIdStr); - // If this key is revoked, it cannot be used for anything! - if (data.getInt(INDEX_UNIFIED_IS_REVOKED) != 0) { + 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()); + + // Note: order is important + if (isRevoked) { + mStatusText.setText(R.string.view_key_revoked); + mStatusText.setTextColor(getResources().getColor(R.color.result_red)); + mStatusImage.setImageDrawable( + getResources().getDrawable(R.drawable.status_signature_revoked_cutout)); + mStatusImage.setColorFilter(getResources().getColor(R.color.result_red), + PorterDuff.Mode.SRC_ATOP); + mStatusDivider.setVisibility(View.VISIBLE); + mStatusLayout.setVisibility(View.VISIBLE); + } else if (isExpired) { + mStatusText.setText(R.string.view_key_expired); + mStatusText.setTextColor(getResources().getColor(R.color.result_orange)); + mStatusImage.setImageDrawable( + getResources().getDrawable(R.drawable.status_signature_expired_cutout)); + mStatusImage.setColorFilter(getResources().getColor(R.color.result_orange), + PorterDuff.Mode.SRC_ATOP); mStatusDivider.setVisibility(View.VISIBLE); - mStatusRevoked.setVisibility(View.VISIBLE); - mStatusExpired.setVisibility(View.GONE); + mStatusLayout.setVisibility(View.VISIBLE); } else { - mStatusRevoked.setVisibility(View.GONE); - - Date expiryDate = new Date(data.getLong(INDEX_UNIFIED_EXPIRY) * 1000); - if (!data.isNull(INDEX_UNIFIED_EXPIRY) && expiryDate.before(new Date())) { - mStatusDivider.setVisibility(View.VISIBLE); - mStatusExpired.setVisibility(View.VISIBLE); - } else { - mStatusDivider.setVisibility(View.GONE); - mStatusExpired.setVisibility(View.GONE); - } + mStatusDivider.setVisibility(View.GONE); + mStatusLayout.setVisibility(View.GONE); } break; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java index ade618840..a156ff5f1 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java @@ -19,6 +19,7 @@ package org.sufficientlysecure.keychain.ui; import android.content.Intent; import android.database.Cursor; +import android.graphics.PorterDuff; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.LoaderManager; @@ -27,6 +28,7 @@ import android.support.v4.content.Loader; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.ImageView; import android.widget.ListView; import org.sufficientlysecure.keychain.Constants; @@ -51,6 +53,8 @@ public class ViewKeyMainFragment extends LoaderFragment implements private View mActionEditDivider; private View mActionEncrypt; private View mActionCertify; + private View mActionCertifyText; + private ImageView mActionCertifyImage; private View mActionCertifyDivider; private ListView mUserIds; @@ -75,6 +79,11 @@ public class ViewKeyMainFragment extends LoaderFragment implements mActionEditDivider = view.findViewById(R.id.view_key_action_edit_divider); mActionEncrypt = view.findViewById(R.id.view_key_action_encrypt); mActionCertify = view.findViewById(R.id.view_key_action_certify); + mActionCertifyText = view.findViewById(R.id.view_key_action_certify_text); + mActionCertifyImage = (ImageView) view.findViewById(R.id.view_key_action_certify_image); + // make certify image gray, like action icons + mActionCertifyImage.setColorFilter(getResources().getColor(R.color.tertiary_text_light), + PorterDuff.Mode.SRC_IN); mActionCertifyDivider = view.findViewById(R.id.view_key_action_certify_divider); return root; @@ -181,6 +190,7 @@ public class ViewKeyMainFragment extends LoaderFragment implements if (data.getInt(INDEX_UNIFIED_IS_REVOKED) != 0) { mActionEdit.setEnabled(false); mActionCertify.setEnabled(false); + mActionCertifyText.setEnabled(false); mActionEncrypt.setEnabled(false); } else { mActionEdit.setEnabled(true); @@ -188,9 +198,11 @@ public class ViewKeyMainFragment extends LoaderFragment implements Date expiryDate = new Date(data.getLong(INDEX_UNIFIED_EXPIRY) * 1000); if (!data.isNull(INDEX_UNIFIED_EXPIRY) && expiryDate.before(new Date())) { mActionCertify.setEnabled(false); + mActionCertifyText.setEnabled(false); mActionEncrypt.setEnabled(false); } else { mActionCertify.setEnabled(true); + mActionCertifyText.setEnabled(true); mActionEncrypt.setEnabled(true); } } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyShareFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyShareFragment.java index c2339c25f..e81d5dbf7 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyShareFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyShareFragment.java @@ -20,7 +20,14 @@ package org.sufficientlysecure.keychain.ui; import android.annotation.TargetApi; import android.content.Intent; import android.database.Cursor; +import android.graphics.Bitmap; +import android.graphics.Color; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.ColorDrawable; +import android.graphics.drawable.Drawable; +import android.graphics.drawable.TransitionDrawable; import android.net.Uri; +import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; import android.provider.Settings; @@ -43,7 +50,6 @@ import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings; import org.sufficientlysecure.keychain.provider.KeychainContract.Keys; import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.ui.dialog.ShareNfcDialogFragment; -import org.sufficientlysecure.keychain.ui.dialog.ShareQrCodeDialogFragment; import org.sufficientlysecure.keychain.util.Log; import org.sufficientlysecure.keychain.util.Notify; import org.sufficientlysecure.keychain.util.QrCodeUtils; @@ -151,7 +157,7 @@ public class ViewKeyShareFragment extends LoaderFragment implements KeyRings.buildUnifiedKeyRingUri(dataUri), Keys.FINGERPRINT, ProviderHelper.FIELD_TYPE_BLOB); String fingerprint = PgpKeyHelper.convertFingerprintToHex(data); - if(!toClipboard){ + if (!toClipboard) { content = Constants.FINGERPRINT_SCHEME + ":" + fingerprint; } else { content = fingerprint; @@ -205,8 +211,9 @@ public class ViewKeyShareFragment extends LoaderFragment implements } private void showQrCodeDialog() { - ShareQrCodeDialogFragment dialog = ShareQrCodeDialogFragment.newInstance(mDataUri); - dialog.show(ViewKeyShareFragment.this.getActivity().getSupportFragmentManager(), "shareQrCodeDialog"); + Intent qrCodeIntent = new Intent(getActivity(), QrCodeActivity.class); + qrCodeIntent.setData(mDataUri); + startActivity(qrCodeIntent); } private void showNfcHelpDialog() { @@ -291,10 +298,7 @@ public class ViewKeyShareFragment extends LoaderFragment implements String fingerprint = PgpKeyHelper.convertFingerprintToHex(fingerprintBlob); mFingerprint.setText(PgpKeyHelper.colorizeFingerprint(fingerprint)); - String qrCodeContent = Constants.FINGERPRINT_SCHEME + ":" + fingerprint; - mFingerprintQrCode.setImageBitmap( - QrCodeUtils.getQRCodeBitmap(qrCodeContent, QR_CODE_SIZE) - ); + loadQrCode(fingerprint); break; } @@ -310,4 +314,35 @@ public class ViewKeyShareFragment extends LoaderFragment implements */ public void onLoaderReset(Loader<Cursor> loader) { } + + /** + * Load QR Code asynchronously and with a fade in animation + * + * @param fingerprint + */ + private void loadQrCode(final String fingerprint) { + AsyncTask<Void, Void, Bitmap> loadTask = + new AsyncTask<Void, Void, Bitmap>() { + protected Bitmap doInBackground(Void... unused) { + String qrCodeContent = Constants.FINGERPRINT_SCHEME + ":" + fingerprint; + return QrCodeUtils.getQRCodeBitmap(qrCodeContent, QR_CODE_SIZE); + } + + protected void onPostExecute(Bitmap qrCode) { + mFingerprintQrCode.setImageBitmap(qrCode); + + // Transition drawable with a transparent drawable and the final bitmap + final TransitionDrawable td = + new TransitionDrawable(new Drawable[]{ + new ColorDrawable(Color.TRANSPARENT), + new BitmapDrawable(getResources(), qrCode) + }); + + mFingerprintQrCode.setImageDrawable(td); + td.startTransition(200); + } + }; + + loadTask.execute(); + } } 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 18312660a..6519915fa 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 @@ -19,6 +19,8 @@ package org.sufficientlysecure.keychain.ui.adapter; import android.content.Context; import android.database.Cursor; +import android.graphics.PorterDuff; +import android.graphics.Typeface; import android.support.v4.widget.CursorAdapter; import android.view.LayoutInflater; import android.view.View; @@ -156,7 +158,10 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC if (isRevoked) { // set revocation icon (can this even be primary?) - vVerified.setImageResource(R.drawable.key_certify_revoke); + vVerified.setImageResource(R.drawable.status_signature_revoked_cutout); + vVerified.setColorFilter( + mContext.getResources().getColor(R.color.bg_gray), + PorterDuff.Mode.SRC_IN); // disable and strike through text for revoked user ids vName.setEnabled(false); @@ -170,22 +175,33 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC vAddress.setEnabled(true); vComment.setEnabled(true); - // verified: has been verified - // isPrimary: show small star icon for primary user ids - int verified = cursor.getInt(INDEX_VERIFIED); - switch (verified) { + if (isPrimary) { + vName.setTypeface(null, Typeface.BOLD); + vAddress.setTypeface(null, Typeface.BOLD); + } else { + vName.setTypeface(null, Typeface.NORMAL); + vAddress.setTypeface(null, Typeface.NORMAL); + } + + int isVerified = cursor.getInt(INDEX_VERIFIED); + switch (isVerified) { case Certs.VERIFIED_SECRET: - vVerified.setImageResource(isPrimary - ? R.drawable.key_certify_primary_ok_depth0 - : R.drawable.key_certify_ok_depth0); + vVerified.setImageResource(R.drawable.status_signature_verified_cutout); + vVerified.setColorFilter( + mContext.getResources().getColor(R.color.result_green), + PorterDuff.Mode.SRC_IN); break; case Certs.VERIFIED_SELF: - vVerified.setImageResource(isPrimary - ? R.drawable.key_certify_primary_ok_self - : R.drawable.key_certify_ok_self); + vVerified.setImageResource(R.drawable.status_signature_unverified_cutout); + vVerified.setColorFilter( + mContext.getResources().getColor(R.color.bg_gray), + PorterDuff.Mode.SRC_IN); break; default: - vVerified.setImageResource(R.drawable.key_certify_error); + vVerified.setImageResource(R.drawable.status_signature_invalid_cutout); + vVerified.setColorFilter( + mContext.getResources().getColor(R.color.result_red), + PorterDuff.Mode.SRC_IN); break; } } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/PassphraseDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/PassphraseDialogFragment.java index d723f88af..7981b717e 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/PassphraseDialogFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/PassphraseDialogFragment.java @@ -33,8 +33,10 @@ import android.support.v4.app.FragmentActivity; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.View; +import android.view.ViewGroup; import android.view.WindowManager.LayoutParams; import android.view.inputmethod.EditorInfo; +import android.view.inputmethod.InputMethodManager; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; @@ -62,7 +64,6 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor private Messenger mMessenger; private EditText mPassphraseEditText; - private boolean mCanKB; /** * Shows passphrase dialog to cache a new passphrase the user enters for using it later for @@ -105,7 +106,7 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor if (!new ProviderHelper(context).getWrappedSecretKeyRing(secretKeyId).hasPassphrase()) { throw new PgpGeneralException("No passphrase! No passphrase dialog needed!"); } - } catch(ProviderHelper.NotFoundException e) { + } catch (ProviderHelper.NotFoundException e) { throw new PgpGeneralException("Error: Key not found!", e); } } @@ -165,7 +166,6 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor } }); alert.setCancelable(false); - mCanKB = false; return alert.create(); } @@ -190,7 +190,7 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor // Early breakout if we are dealing with a symmetric key if (secretRing == null) { PassphraseCacheService.addCachedPassphrase(activity, Constants.key.symmetric, - passphrase, getString(R.string.passp_cache_notif_pwd)); + passphrase, getString(R.string.passp_cache_notif_pwd)); // also return passphrase back to activity Bundle data = new Bundle(); data.putString(MESSAGE_DATA_PASSPHRASE, passphrase); @@ -200,7 +200,7 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor WrappedSecretKey unlockedSecretKey = null; - for(WrappedSecretKey clickSecretKey : secretRing.secretKeyIterator()) { + for (WrappedSecretKey clickSecretKey : secretRing.secretKeyIterator()) { try { boolean unlocked = clickSecretKey.unlock(passphrase); if (unlocked) { @@ -232,9 +232,9 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor try { PassphraseCacheService.addCachedPassphrase(activity, masterKeyId, passphrase, - secretRing.getPrimaryUserIdWithFallback()); - } catch(PgpGeneralException e) { - Log.e(Constants.TAG, "adding of a passhrase failed", e); + secretRing.getPrimaryUserIdWithFallback()); + } catch (PgpGeneralException e) { + Log.e(Constants.TAG, "adding of a passphrase failed", e); } if (unlockedSecretKey.getKeyId() != masterKeyId) { @@ -258,20 +258,30 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor } }); - mCanKB = true; - return alert.show(); - } + // Hack to open keyboard. + // This is the only method that I found to work across all Android versions + // http://turbomanage.wordpress.com/2012/05/02/show-soft-keyboard-automatically-when-edittext-receives-focus/ + // Notes: * onCreateView can't be used because we want to add buttons to the dialog + // * opening in onActivityCreated does not work on Android 4.4 + mPassphraseEditText.setOnFocusChangeListener(new View.OnFocusChangeListener() { + @Override + public void onFocusChange(View v, boolean hasFocus) { + mPassphraseEditText.post(new Runnable() { + @Override + public void run() { + InputMethodManager imm = (InputMethodManager) getActivity() + .getSystemService(Context.INPUT_METHOD_SERVICE); + imm.showSoftInput(mPassphraseEditText, InputMethodManager.SHOW_IMPLICIT); + } + }); + } + }); + mPassphraseEditText.requestFocus(); - @Override - public void onActivityCreated(Bundle arg0) { - super.onActivityCreated(arg0); - if (mCanKB) { - // request focus and open soft keyboard - mPassphraseEditText.requestFocus(); - getDialog().getWindow().setSoftInputMode(LayoutParams.SOFT_INPUT_STATE_VISIBLE); - - mPassphraseEditText.setOnEditorActionListener(this); - } + mPassphraseEditText.setImeActionLabel(getString(android.R.string.ok), EditorInfo.IME_ACTION_DONE); + mPassphraseEditText.setOnEditorActionListener(this); + + return alert.show(); } @Override @@ -282,6 +292,27 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor sendMessageToHandler(MESSAGE_CANCEL); } + @Override + public void onDismiss(DialogInterface dialog) { + super.onDismiss(dialog); + Log.d(Constants.TAG, "onDismiss"); + + // hide keyboard on dismiss + hideKeyboard(); + } + + private void hideKeyboard() { + InputMethodManager inputManager = (InputMethodManager) getActivity() + .getSystemService(Context.INPUT_METHOD_SERVICE); + + //check if no view has focus: + View v = getActivity().getCurrentFocus(); + if (v == null) + return; + + inputManager.hideSoftInputFromWindow(v.getWindowToken(), 0); + } + /** * Associate the "done" button on the soft keyboard with the okay button in the view */ diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/SetPassphraseDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/SetPassphraseDialogFragment.java index 93da48b75..1386ed098 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/SetPassphraseDialogFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/SetPassphraseDialogFragment.java @@ -20,6 +20,7 @@ package org.sufficientlysecure.keychain.ui.dialog; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; +import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; import android.os.Message; @@ -32,6 +33,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.WindowManager.LayoutParams; import android.view.inputmethod.EditorInfo; +import android.view.inputmethod.InputMethodManager; import android.widget.Button; import android.widget.CheckBox; import android.widget.CompoundButton; @@ -164,18 +166,50 @@ public class SetPassphraseDialogFragment extends DialogFragment implements OnEdi } }); + // Hack to open keyboard. + // This is the only method that I found to work across all Android versions + // http://turbomanage.wordpress.com/2012/05/02/show-soft-keyboard-automatically-when-edittext-receives-focus/ + // Notes: * onCreateView can't be used because we want to add buttons to the dialog + // * opening in onActivityCreated does not work on Android 4.4 + mPassphraseEditText.setOnFocusChangeListener(new View.OnFocusChangeListener() { + @Override + public void onFocusChange(View v, boolean hasFocus) { + mPassphraseEditText.post(new Runnable() { + @Override + public void run() { + InputMethodManager imm = (InputMethodManager) getActivity() + .getSystemService(Context.INPUT_METHOD_SERVICE); + imm.showSoftInput(mPassphraseEditText, InputMethodManager.SHOW_IMPLICIT); + } + }); + } + }); + mPassphraseEditText.requestFocus(); + + mPassphraseAgainEditText.setImeActionLabel(getString(android.R.string.ok), EditorInfo.IME_ACTION_DONE); + mPassphraseAgainEditText.setOnEditorActionListener(this); + return alert.show(); } @Override - public void onActivityCreated(Bundle arg0) { - super.onActivityCreated(arg0); + public void onDismiss(DialogInterface dialog) { + super.onDismiss(dialog); - // request focus and open soft keyboard - mPassphraseEditText.requestFocus(); - getDialog().getWindow().setSoftInputMode(LayoutParams.SOFT_INPUT_STATE_VISIBLE); + // hide keyboard on dismiss + hideKeyboard(); + } - mPassphraseAgainEditText.setOnEditorActionListener(this); + private void hideKeyboard() { + InputMethodManager inputManager = (InputMethodManager) getActivity() + .getSystemService(Context.INPUT_METHOD_SERVICE); + + //check if no view has focus: + View v = getActivity().getCurrentFocus(); + if (v == null) + return; + + inputManager.hideSoftInputFromWindow(v.getWindowToken(), 0); } /** diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ShareQrCodeDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ShareQrCodeDialogFragment.java deleted file mode 100644 index eb779f401..000000000 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ShareQrCodeDialogFragment.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2012-2014 Dominik Schürmann <dominik@dominikschuermann.de> - * - * 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 <http://www.gnu.org/licenses/>. - */ - -package org.sufficientlysecure.keychain.ui.dialog; - -import android.app.Activity; -import android.app.Dialog; -import android.net.Uri; -import android.os.Bundle; -import android.support.v4.app.DialogFragment; -import android.view.LayoutInflater; -import android.view.View; -import android.widget.ImageView; -import android.widget.TextView; - -import org.sufficientlysecure.keychain.Constants; -import org.sufficientlysecure.keychain.R; -import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; -import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings; -import org.sufficientlysecure.keychain.provider.ProviderHelper; -import org.sufficientlysecure.keychain.util.Log; -import org.sufficientlysecure.keychain.util.Notify; -import org.sufficientlysecure.keychain.util.QrCodeUtils; - -public class ShareQrCodeDialogFragment extends DialogFragment { - private static final String ARG_KEY_URI = "uri"; - - private ImageView mImage; - private TextView mText; - - private static final int QR_CODE_SIZE = 1000; - - /** - * Creates new instance of this dialog fragment - */ - public static ShareQrCodeDialogFragment newInstance(Uri dataUri) { - ShareQrCodeDialogFragment frag = new ShareQrCodeDialogFragment(); - Bundle args = new Bundle(); - args.putParcelable(ARG_KEY_URI, dataUri); - - frag.setArguments(args); - - return frag; - } - - /** - * Creates dialog - */ - @Override - public Dialog onCreateDialog(Bundle savedInstanceState) { - final Activity activity = getActivity(); - - Uri dataUri = getArguments().getParcelable(ARG_KEY_URI); - - CustomAlertDialogBuilder alert = new CustomAlertDialogBuilder(getActivity()); - alert.setTitle(R.string.share_qr_code_dialog_title); - - LayoutInflater inflater = activity.getLayoutInflater(); - View view = inflater.inflate(R.layout.share_qr_code_dialog, null); - alert.setView(view); - - mImage = (ImageView) view.findViewById(R.id.share_qr_code_dialog_image); - mText = (TextView) view.findViewById(R.id.share_qr_code_dialog_text); - - ProviderHelper providerHelper = new ProviderHelper(getActivity()); - String content; - try { - alert.setPositiveButton(R.string.btn_okay, null); - - byte[] blob = (byte[]) providerHelper.getGenericData( - KeyRings.buildUnifiedKeyRingUri(dataUri), - KeyRings.FINGERPRINT, ProviderHelper.FIELD_TYPE_BLOB); - if (blob == null) { - Log.e(Constants.TAG, "key not found!"); - Notify.showNotify(getActivity(), R.string.error_key_not_found, Notify.Style.ERROR); - return null; - } - - String fingerprint = PgpKeyHelper.convertFingerprintToHex(blob); - mText.setText(getString(R.string.share_qr_code_dialog_fingerprint_text) + " " + fingerprint); - content = Constants.FINGERPRINT_SCHEME + ":" + fingerprint; - setQrCode(content); - } catch (ProviderHelper.NotFoundException e) { - Log.e(Constants.TAG, "key not found!", e); - Notify.showNotify(getActivity(), R.string.error_key_not_found, Notify.Style.ERROR); - return null; - } - - return alert.show(); - } - - private void setQrCode(String data) { - mImage.setImageBitmap(QrCodeUtils.getQRCodeBitmap(data, QR_CODE_SIZE)); - } - -} diff --git a/OpenKeychain/src/main/res/anim/zoom_enter.xml b/OpenKeychain/src/main/res/anim/zoom_enter.xml new file mode 100644 index 000000000..2b95cfba6 --- /dev/null +++ b/OpenKeychain/src/main/res/anim/zoom_enter.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<set xmlns:android="http://schemas.android.com/apk/res/android" + android:interpolator="@android:anim/decelerate_interpolator"> + <scale + android:fromXScale="0.5" + android:toXScale="1.0" + android:fromYScale="0.5" + android:toYScale="1.0" + android:pivotX="50%p" + android:pivotY="50%p" + android:duration="@android:integer/config_mediumAnimTime" /> + <alpha + android:fromAlpha="0" + android:toAlpha="1.0" + android:duration="@android:integer/config_mediumAnimTime" /> +</set>
\ No newline at end of file diff --git a/OpenKeychain/src/main/res/anim/zoom_exit.xml b/OpenKeychain/src/main/res/anim/zoom_exit.xml new file mode 100644 index 000000000..772375739 --- /dev/null +++ b/OpenKeychain/src/main/res/anim/zoom_exit.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<set xmlns:android="http://schemas.android.com/apk/res/android" + android:interpolator="@android:anim/decelerate_interpolator" + android:zAdjustment="top"> + <scale + android:fromXScale="1.0" + android:toXScale="0.5" + android:fromYScale="1.0" + android:toYScale="0.5" + android:pivotX="50%p" + android:pivotY="50%p" + android:duration="@android:integer/config_mediumAnimTime" /> + <alpha + android:fromAlpha="1.0" + android:toAlpha="0" + android:duration="@android:integer/config_mediumAnimTime" /> +</set>
\ No newline at end of file diff --git a/OpenKeychain/src/main/res/drawable-hdpi/key_certify_error.png b/OpenKeychain/src/main/res/drawable-hdpi/key_certify_error.png Binary files differdeleted file mode 100644 index 391d1c988..000000000 --- a/OpenKeychain/src/main/res/drawable-hdpi/key_certify_error.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-hdpi/key_certify_ok_depth0.png b/OpenKeychain/src/main/res/drawable-hdpi/key_certify_ok_depth0.png Binary files differdeleted file mode 100644 index 76944469c..000000000 --- a/OpenKeychain/src/main/res/drawable-hdpi/key_certify_ok_depth0.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-hdpi/key_certify_ok_self.png b/OpenKeychain/src/main/res/drawable-hdpi/key_certify_ok_self.png Binary files differdeleted file mode 100644 index 815701015..000000000 --- a/OpenKeychain/src/main/res/drawable-hdpi/key_certify_ok_self.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-hdpi/key_certify_primary_ok_depth0.png b/OpenKeychain/src/main/res/drawable-hdpi/key_certify_primary_ok_depth0.png Binary files differdeleted file mode 100644 index 026869c14..000000000 --- a/OpenKeychain/src/main/res/drawable-hdpi/key_certify_primary_ok_depth0.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-hdpi/key_certify_primary_ok_self.png b/OpenKeychain/src/main/res/drawable-hdpi/key_certify_primary_ok_self.png Binary files differdeleted file mode 100644 index 12d2e026e..000000000 --- a/OpenKeychain/src/main/res/drawable-hdpi/key_certify_primary_ok_self.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-hdpi/key_certify_revoke.png b/OpenKeychain/src/main/res/drawable-hdpi/key_certify_revoke.png Binary files differdeleted file mode 100644 index c39d3a87c..000000000 --- a/OpenKeychain/src/main/res/drawable-hdpi/key_certify_revoke.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-hdpi/status_lock_closed.png b/OpenKeychain/src/main/res/drawable-hdpi/status_lock_closed.png Binary files differnew file mode 100644 index 000000000..a1b090630 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-hdpi/status_lock_closed.png diff --git a/OpenKeychain/src/main/res/drawable-hdpi/status_lock_error.png b/OpenKeychain/src/main/res/drawable-hdpi/status_lock_error.png Binary files differnew file mode 100644 index 000000000..e567055aa --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-hdpi/status_lock_error.png diff --git a/OpenKeychain/src/main/res/drawable-hdpi/status_lock_open.png b/OpenKeychain/src/main/res/drawable-hdpi/status_lock_open.png Binary files differnew file mode 100644 index 000000000..98e32eadc --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-hdpi/status_lock_open.png diff --git a/OpenKeychain/src/main/res/drawable-hdpi/status_signature_expired.png b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_expired.png Binary files differnew file mode 100644 index 000000000..21e8b536a --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_expired.png diff --git a/OpenKeychain/src/main/res/drawable-hdpi/status_signature_expired_cutout.png b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_expired_cutout.png Binary files differnew file mode 100644 index 000000000..84ac9bec2 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_expired_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-hdpi/status_signature_invalid.png b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_invalid.png Binary files differnew file mode 100644 index 000000000..9ae2a09ab --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_invalid.png diff --git a/OpenKeychain/src/main/res/drawable-hdpi/status_signature_invalid_cutout.png b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_invalid_cutout.png Binary files differnew file mode 100644 index 000000000..967e00e80 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_invalid_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-hdpi/status_signature_revoked.png b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_revoked.png Binary files differnew file mode 100644 index 000000000..16e1d7181 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_revoked.png diff --git a/OpenKeychain/src/main/res/drawable-hdpi/status_signature_revoked_cutout.png b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_revoked_cutout.png Binary files differnew file mode 100644 index 000000000..244dd0708 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_revoked_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-hdpi/status_signature_unknown.png b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_unknown.png Binary files differnew file mode 100644 index 000000000..5c3ba866d --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_unknown.png diff --git a/OpenKeychain/src/main/res/drawable-hdpi/status_signature_unknown_cutout.png b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_unknown_cutout.png Binary files differnew file mode 100644 index 000000000..82cc25a4b --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_unknown_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-hdpi/status_signature_unverified.png b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_unverified.png Binary files differnew file mode 100644 index 000000000..b8b472a5a --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_unverified.png diff --git a/OpenKeychain/src/main/res/drawable-hdpi/status_signature_unverified_cutout.png b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_unverified_cutout.png Binary files differnew file mode 100644 index 000000000..e752eaeab --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_unverified_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-hdpi/status_signature_verified.png b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_verified.png Binary files differnew file mode 100644 index 000000000..d8141b47b --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_verified.png diff --git a/OpenKeychain/src/main/res/drawable-hdpi/status_signature_verified_cutout.png b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_verified_cutout.png Binary files differnew file mode 100644 index 000000000..08a9f464c --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-hdpi/status_signature_verified_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-ldpi/key_certify_error.png b/OpenKeychain/src/main/res/drawable-ldpi/key_certify_error.png Binary files differdeleted file mode 100644 index 79fddf78a..000000000 --- a/OpenKeychain/src/main/res/drawable-ldpi/key_certify_error.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-ldpi/key_certify_ok_depth0.png b/OpenKeychain/src/main/res/drawable-ldpi/key_certify_ok_depth0.png Binary files differdeleted file mode 100644 index c400a1820..000000000 --- a/OpenKeychain/src/main/res/drawable-ldpi/key_certify_ok_depth0.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-ldpi/key_certify_ok_self.png b/OpenKeychain/src/main/res/drawable-ldpi/key_certify_ok_self.png Binary files differdeleted file mode 100644 index fb1654b53..000000000 --- a/OpenKeychain/src/main/res/drawable-ldpi/key_certify_ok_self.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-ldpi/key_certify_revoke.png b/OpenKeychain/src/main/res/drawable-ldpi/key_certify_revoke.png Binary files differdeleted file mode 100644 index 5228a4b6b..000000000 --- a/OpenKeychain/src/main/res/drawable-ldpi/key_certify_revoke.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-mdpi/key_certify_error.png b/OpenKeychain/src/main/res/drawable-mdpi/key_certify_error.png Binary files differdeleted file mode 100644 index 6def8769f..000000000 --- a/OpenKeychain/src/main/res/drawable-mdpi/key_certify_error.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-mdpi/key_certify_ok_depth0.png b/OpenKeychain/src/main/res/drawable-mdpi/key_certify_ok_depth0.png Binary files differdeleted file mode 100644 index e16ec810a..000000000 --- a/OpenKeychain/src/main/res/drawable-mdpi/key_certify_ok_depth0.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-mdpi/key_certify_ok_self.png b/OpenKeychain/src/main/res/drawable-mdpi/key_certify_ok_self.png Binary files differdeleted file mode 100644 index 715a16487..000000000 --- a/OpenKeychain/src/main/res/drawable-mdpi/key_certify_ok_self.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-mdpi/key_certify_primary_ok_depth0.png b/OpenKeychain/src/main/res/drawable-mdpi/key_certify_primary_ok_depth0.png Binary files differdeleted file mode 100644 index c376a2897..000000000 --- a/OpenKeychain/src/main/res/drawable-mdpi/key_certify_primary_ok_depth0.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-mdpi/key_certify_primary_ok_self.png b/OpenKeychain/src/main/res/drawable-mdpi/key_certify_primary_ok_self.png Binary files differdeleted file mode 100644 index 45a261b24..000000000 --- a/OpenKeychain/src/main/res/drawable-mdpi/key_certify_primary_ok_self.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-mdpi/key_certify_revoke.png b/OpenKeychain/src/main/res/drawable-mdpi/key_certify_revoke.png Binary files differdeleted file mode 100644 index 62ee0ca42..000000000 --- a/OpenKeychain/src/main/res/drawable-mdpi/key_certify_revoke.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-mdpi/status_lock_closed.png b/OpenKeychain/src/main/res/drawable-mdpi/status_lock_closed.png Binary files differnew file mode 100644 index 000000000..cfc39f0e7 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-mdpi/status_lock_closed.png diff --git a/OpenKeychain/src/main/res/drawable-mdpi/status_lock_error.png b/OpenKeychain/src/main/res/drawable-mdpi/status_lock_error.png Binary files differnew file mode 100644 index 000000000..824dc2672 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-mdpi/status_lock_error.png diff --git a/OpenKeychain/src/main/res/drawable-mdpi/status_lock_open.png b/OpenKeychain/src/main/res/drawable-mdpi/status_lock_open.png Binary files differnew file mode 100644 index 000000000..9bca59ae3 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-mdpi/status_lock_open.png diff --git a/OpenKeychain/src/main/res/drawable-mdpi/status_signature_expired.png b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_expired.png Binary files differnew file mode 100644 index 000000000..81a900147 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_expired.png diff --git a/OpenKeychain/src/main/res/drawable-mdpi/status_signature_expired_cutout.png b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_expired_cutout.png Binary files differnew file mode 100644 index 000000000..bc91094b5 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_expired_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-mdpi/status_signature_invalid.png b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_invalid.png Binary files differnew file mode 100644 index 000000000..baa78f795 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_invalid.png diff --git a/OpenKeychain/src/main/res/drawable-mdpi/status_signature_invalid_cutout.png b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_invalid_cutout.png Binary files differnew file mode 100644 index 000000000..bc2f56e2a --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_invalid_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-mdpi/status_signature_revoked.png b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_revoked.png Binary files differnew file mode 100644 index 000000000..7cf985274 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_revoked.png diff --git a/OpenKeychain/src/main/res/drawable-mdpi/status_signature_revoked_cutout.png b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_revoked_cutout.png Binary files differnew file mode 100644 index 000000000..2d2593194 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_revoked_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-mdpi/status_signature_unknown.png b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_unknown.png Binary files differnew file mode 100644 index 000000000..3d4665320 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_unknown.png diff --git a/OpenKeychain/src/main/res/drawable-mdpi/status_signature_unknown_cutout.png b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_unknown_cutout.png Binary files differnew file mode 100644 index 000000000..0fc74d07e --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_unknown_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-mdpi/status_signature_unverified.png b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_unverified.png Binary files differnew file mode 100644 index 000000000..8348b32b3 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_unverified.png diff --git a/OpenKeychain/src/main/res/drawable-mdpi/status_signature_unverified_cutout.png b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_unverified_cutout.png Binary files differnew file mode 100644 index 000000000..96a2d1413 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_unverified_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-mdpi/status_signature_verified.png b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_verified.png Binary files differnew file mode 100644 index 000000000..02e53ac8a --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_verified.png diff --git a/OpenKeychain/src/main/res/drawable-mdpi/status_signature_verified_cutout.png b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_verified_cutout.png Binary files differnew file mode 100644 index 000000000..9f7cf837c --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-mdpi/status_signature_verified_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/key_certify_error.png b/OpenKeychain/src/main/res/drawable-xhdpi/key_certify_error.png Binary files differdeleted file mode 100644 index 8278ce2b6..000000000 --- a/OpenKeychain/src/main/res/drawable-xhdpi/key_certify_error.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/key_certify_ok_depth0.png b/OpenKeychain/src/main/res/drawable-xhdpi/key_certify_ok_depth0.png Binary files differdeleted file mode 100644 index e2aef1177..000000000 --- a/OpenKeychain/src/main/res/drawable-xhdpi/key_certify_ok_depth0.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/key_certify_ok_self.png b/OpenKeychain/src/main/res/drawable-xhdpi/key_certify_ok_self.png Binary files differdeleted file mode 100644 index 9bb6ceffa..000000000 --- a/OpenKeychain/src/main/res/drawable-xhdpi/key_certify_ok_self.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/key_certify_primary_ok_depth0.png b/OpenKeychain/src/main/res/drawable-xhdpi/key_certify_primary_ok_depth0.png Binary files differdeleted file mode 100644 index de6614246..000000000 --- a/OpenKeychain/src/main/res/drawable-xhdpi/key_certify_primary_ok_depth0.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/key_certify_primary_ok_self.png b/OpenKeychain/src/main/res/drawable-xhdpi/key_certify_primary_ok_self.png Binary files differdeleted file mode 100644 index ce10da099..000000000 --- a/OpenKeychain/src/main/res/drawable-xhdpi/key_certify_primary_ok_self.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/key_certify_revoke.png b/OpenKeychain/src/main/res/drawable-xhdpi/key_certify_revoke.png Binary files differdeleted file mode 100644 index 1478e726b..000000000 --- a/OpenKeychain/src/main/res/drawable-xhdpi/key_certify_revoke.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/status_lock_closed.png b/OpenKeychain/src/main/res/drawable-xhdpi/status_lock_closed.png Binary files differnew file mode 100644 index 000000000..7c6bb2d18 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xhdpi/status_lock_closed.png diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/status_lock_error.png b/OpenKeychain/src/main/res/drawable-xhdpi/status_lock_error.png Binary files differnew file mode 100644 index 000000000..da4a5d89a --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xhdpi/status_lock_error.png diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/status_lock_open.png b/OpenKeychain/src/main/res/drawable-xhdpi/status_lock_open.png Binary files differnew file mode 100644 index 000000000..cd02fc1e4 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xhdpi/status_lock_open.png diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_expired.png b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_expired.png Binary files differnew file mode 100644 index 000000000..f5105c1ae --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_expired.png diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_expired_cutout.png b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_expired_cutout.png Binary files differnew file mode 100644 index 000000000..83f6fde35 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_expired_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_invalid.png b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_invalid.png Binary files differnew file mode 100644 index 000000000..67880d6db --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_invalid.png diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_invalid_cutout.png b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_invalid_cutout.png Binary files differnew file mode 100644 index 000000000..29830f5ba --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_invalid_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_revoked.png b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_revoked.png Binary files differnew file mode 100644 index 000000000..2ed67419b --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_revoked.png diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_revoked_cutout.png b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_revoked_cutout.png Binary files differnew file mode 100644 index 000000000..2f7695043 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_revoked_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_unknown.png b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_unknown.png Binary files differnew file mode 100644 index 000000000..a6f1f2792 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_unknown.png diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_unknown_cutout.png b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_unknown_cutout.png Binary files differnew file mode 100644 index 000000000..2ce28c7ca --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_unknown_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_unverified.png b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_unverified.png Binary files differnew file mode 100644 index 000000000..c25a84b4d --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_unverified.png diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_unverified_cutout.png b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_unverified_cutout.png Binary files differnew file mode 100644 index 000000000..442c55eee --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_unverified_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_verified.png b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_verified.png Binary files differnew file mode 100644 index 000000000..6f435a85e --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_verified.png diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_verified_cutout.png b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_verified_cutout.png Binary files differnew file mode 100644 index 000000000..160ec7cbe --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xhdpi/status_signature_verified_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/key_certify_error.png b/OpenKeychain/src/main/res/drawable-xxhdpi/key_certify_error.png Binary files differdeleted file mode 100644 index 9416720eb..000000000 --- a/OpenKeychain/src/main/res/drawable-xxhdpi/key_certify_error.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/key_certify_ok_depth0.png b/OpenKeychain/src/main/res/drawable-xxhdpi/key_certify_ok_depth0.png Binary files differdeleted file mode 100644 index 501a75d63..000000000 --- a/OpenKeychain/src/main/res/drawable-xxhdpi/key_certify_ok_depth0.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/key_certify_ok_self.png b/OpenKeychain/src/main/res/drawable-xxhdpi/key_certify_ok_self.png Binary files differdeleted file mode 100644 index 72ada9c1f..000000000 --- a/OpenKeychain/src/main/res/drawable-xxhdpi/key_certify_ok_self.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/key_certify_primary_ok_depth0.png b/OpenKeychain/src/main/res/drawable-xxhdpi/key_certify_primary_ok_depth0.png Binary files differdeleted file mode 100644 index 1b52ef04d..000000000 --- a/OpenKeychain/src/main/res/drawable-xxhdpi/key_certify_primary_ok_depth0.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/key_certify_primary_ok_self.png b/OpenKeychain/src/main/res/drawable-xxhdpi/key_certify_primary_ok_self.png Binary files differdeleted file mode 100644 index baa1c00d2..000000000 --- a/OpenKeychain/src/main/res/drawable-xxhdpi/key_certify_primary_ok_self.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/key_certify_revoke.png b/OpenKeychain/src/main/res/drawable-xxhdpi/key_certify_revoke.png Binary files differdeleted file mode 100644 index 217f4e914..000000000 --- a/OpenKeychain/src/main/res/drawable-xxhdpi/key_certify_revoke.png +++ /dev/null diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/status_lock_closed.png b/OpenKeychain/src/main/res/drawable-xxhdpi/status_lock_closed.png Binary files differnew file mode 100644 index 000000000..5a9664d59 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xxhdpi/status_lock_closed.png diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/status_lock_error.png b/OpenKeychain/src/main/res/drawable-xxhdpi/status_lock_error.png Binary files differnew file mode 100644 index 000000000..608f065af --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xxhdpi/status_lock_error.png diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/status_lock_open.png b/OpenKeychain/src/main/res/drawable-xxhdpi/status_lock_open.png Binary files differnew file mode 100644 index 000000000..ee34dd396 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xxhdpi/status_lock_open.png diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_expired.png b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_expired.png Binary files differnew file mode 100644 index 000000000..f475c9d84 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_expired.png diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_expired_cutout.png b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_expired_cutout.png Binary files differnew file mode 100644 index 000000000..33a3efed1 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_expired_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_invalid.png b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_invalid.png Binary files differnew file mode 100644 index 000000000..f21c2cf52 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_invalid.png diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_invalid_cutout.png b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_invalid_cutout.png Binary files differnew file mode 100644 index 000000000..bc39d3496 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_invalid_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_revoked.png b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_revoked.png Binary files differnew file mode 100644 index 000000000..be1a1d9dc --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_revoked.png diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_revoked_cutout.png b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_revoked_cutout.png Binary files differnew file mode 100644 index 000000000..58929661f --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_revoked_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_unknown.png b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_unknown.png Binary files differnew file mode 100644 index 000000000..841cfa958 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_unknown.png diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_unknown_cutout.png b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_unknown_cutout.png Binary files differnew file mode 100644 index 000000000..3020357a4 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_unknown_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_unverified.png b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_unverified.png Binary files differnew file mode 100644 index 000000000..525d1cf6b --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_unverified.png diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_unverified_cutout.png b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_unverified_cutout.png Binary files differnew file mode 100644 index 000000000..3829bb3a0 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_unverified_cutout.png diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_verified.png b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_verified.png Binary files differnew file mode 100644 index 000000000..54eee5ba0 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_verified.png diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_verified_cutout.png b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_verified_cutout.png Binary files differnew file mode 100644 index 000000000..3548ee2b6 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xxhdpi/status_signature_verified_cutout.png diff --git a/OpenKeychain/src/main/res/layout/certify_key_activity.xml b/OpenKeychain/src/main/res/layout/certify_key_activity.xml index 1443ffd46..d9c1b806b 100644 --- a/OpenKeychain/src/main/res/layout/certify_key_activity.xml +++ b/OpenKeychain/src/main/res/layout/certify_key_activity.xml @@ -106,7 +106,6 @@ style="@style/SectionHeader" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginBottom="4dp" android:layout_marginTop="14dp" android:text="@string/section_uids_to_certify" /> @@ -149,21 +148,35 @@ android:text="@string/section_actions" android:layout_weight="1" /> - <TextView - android:id="@+id/sign_key_sign_button" - android:paddingLeft="8dp" - android:paddingRight="8dp" - android:layout_marginBottom="8dp" - android:textAppearance="?android:attr/textAppearanceMedium" + <LinearLayout + android:id="@+id/certify_key_certify_button" android:layout_width="match_parent" - android:layout_height="match_parent" - android:text="@string/key_view_action_certify" - android:minHeight="?android:attr/listPreferredItemHeight" - android:drawableRight="@drawable/ic_action_good" - android:drawablePadding="8dp" - android:gravity="center_vertical" + android:layout_height="?android:attr/listPreferredItemHeight" android:clickable="true" - style="@style/SelectableItem" /> + android:paddingRight="4dp" + android:layout_marginBottom="8dp" + style="@style/SelectableItem" + android:orientation="horizontal"> + + <TextView + android:paddingLeft="8dp" + android:textAppearance="?android:attr/textAppearanceMedium" + android:layout_width="0dip" + android:layout_height="match_parent" + android:text="@string/key_view_action_certify" + android:layout_weight="1" + android:gravity="center_vertical" /> + + <ImageView + android:id="@+id/certify_key_action_certify_image" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:padding="8dp" + android:src="@drawable/status_signature_verified_cutout" + android:layout_gravity="center_vertical" /> + + </LinearLayout> + </LinearLayout> diff --git a/OpenKeychain/src/main/res/layout/create_key_activity.xml b/OpenKeychain/src/main/res/layout/create_key_activity.xml index 673f43084..9d56950a8 100644 --- a/OpenKeychain/src/main/res/layout/create_key_activity.xml +++ b/OpenKeychain/src/main/res/layout/create_key_activity.xml @@ -1,54 +1,84 @@ <?xml version="1.0" encoding="UTF-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:padding="8dp" - android:orientation="vertical"> +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" + android:layout_height="match_parent"> - <TextView + <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingBottom="4dp" - android:text="Enter Full Name, Email and Passphrase!" - android:textAppearance="?android:attr/textAppearanceMedium" /> + android:paddingLeft="16dp" + android:paddingRight="16dp" + android:orientation="vertical"> - <AutoCompleteTextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:inputType="textPersonName" - android:hint="Name" - android:ems="10" - android:id="@+id/name" /> + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingTop="16dp" + android:paddingBottom="8dp" + android:text="@string/create_key_text" + android:textAppearance="?android:attr/textAppearanceMedium" /> - <AutoCompleteTextView - android:id="@+id/email" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:hint="bla@example.com" - android:layout_weight="1" - android:ems="10" - android:inputType="textEmailAddress" /> + <AutoCompleteTextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="8dp" + android:imeOptions="actionNext" + android:inputType="textPersonName" + android:hint="@string/label_name" + android:ems="10" + android:id="@+id/name" /> - <EditText - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:inputType="textPassword" - android:hint="passphrase" - android:ems="10" - android:id="@+id/passphrase" - android:layout_gravity="center_horizontal" /> + <AutoCompleteTextView + android:id="@+id/email" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="8dp" + android:imeOptions="actionNext" + android:hint="@string/label_email" + android:ems="10" + android:inputType="textEmailAddress" /> + <EditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="8dp" + android:inputType="textPassword" + android:hint="@string/label_passphrase" + android:ems="10" + android:id="@+id/passphrase" + android:layout_gravity="center_horizontal" /> - <Button - android:id="@+id/create_key_button" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_weight="1" - android:layout_gravity="center_horizontal" - android:layout_margin="8dp" - android:text="@string/first_time_create_key" - android:background="@drawable/button_edgy" - android:drawableLeft="@drawable/ic_action_new_account" /> + <CheckBox + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="8dp" + android:text="@string/create_key_upload" + android:id="@+id/create_key_upload" /> + + <View + android:layout_width="match_parent" + android:layout_height="1dip" + android:background="?android:attr/listDivider" /> + + <TextView + android:id="@+id/create_key_button" + android:paddingLeft="8dp" + android:paddingRight="8dp" + android:textAppearance="?android:attr/textAppearanceMedium" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:text="@string/first_time_create_key" + android:minHeight="?android:attr/listPreferredItemHeight" + android:drawableRight="@drawable/ic_action_new_account" + android:drawablePadding="8dp" + android:gravity="center_vertical" + android:clickable="true" + style="@style/SelectableItem" /> + <View + android:layout_width="match_parent" + android:layout_height="1dip" + android:background="?android:attr/listDivider" /> -</LinearLayout>
\ No newline at end of file + </LinearLayout> +</ScrollView>
\ No newline at end of file diff --git a/OpenKeychain/src/main/res/layout/first_time_activity.xml b/OpenKeychain/src/main/res/layout/first_time_activity.xml index 514f34212..e1a67a077 100644 --- a/OpenKeychain/src/main/res/layout/first_time_activity.xml +++ b/OpenKeychain/src/main/res/layout/first_time_activity.xml @@ -2,18 +2,97 @@ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingTop="16dp" - android:paddingBottom="8dp"> + android:paddingTop="16dp"> <LinearLayout + android:id="@+id/first_time_buttons" android:layout_width="match_parent" - android:layout_height="match_parent" + android:layout_height="wrap_content" + android:paddingLeft="16dp" + android:paddingRight="16dp" + android:layout_alignParentBottom="true" android:orientation="vertical"> + <View + android:layout_width="match_parent" + android:layout_height="1dip" + android:background="?android:attr/listDivider" /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + + <TextView + android:id="@+id/first_time_create_key" + android:paddingLeft="8dp" + android:paddingRight="8dp" + android:textAppearance="?android:attr/textAppearanceMedium" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/first_time_create_key" + android:minHeight="?android:attr/listPreferredItemHeight" + android:drawableRight="@drawable/ic_action_new_account" + android:drawablePadding="8dp" + android:gravity="center_vertical" + android:clickable="true" + style="@style/SelectableItem" /> + + <View + android:layout_width="1dp" + android:layout_height="match_parent" + android:layout_marginTop="8dp" + android:layout_marginBottom="8dp" + android:background="?android:attr/listDivider" /> + + <TextView + android:id="@+id/first_time_import_key" + android:paddingLeft="8dp" + android:paddingRight="8dp" + android:textAppearance="?android:attr/textAppearanceMedium" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/first_time_import_key" + android:minHeight="?android:attr/listPreferredItemHeight" + android:drawableRight="@drawable/ic_action_download" + android:drawablePadding="8dp" + android:gravity="center_vertical" + android:clickable="true" + style="@style/SelectableItem" /> + </LinearLayout> + + <View + android:layout_width="match_parent" + android:layout_height="1dip" + android:background="?android:attr/listDivider" /> + + <TextView + android:id="@+id/first_time_cancel" + android:paddingLeft="8dp" + android:paddingRight="8dp" + android:textAppearance="?android:attr/textAppearanceMedium" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/first_time_skip" + android:minHeight="?android:attr/listPreferredItemHeight" + android:gravity="center" + android:clickable="true" + style="@style/SelectableItem" + android:layout_gravity="center_horizontal" /> + + </LinearLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:layout_above="@+id/first_time_buttons"> + <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginLeft="8dp" android:textAppearance="?android:attr/textAppearanceLarge" android:text="@string/app_name" android:drawableLeft="@drawable/ic_launcher" @@ -23,12 +102,15 @@ <ImageView android:layout_width="wrap_content" - android:layout_marginLeft="64dp" - android:layout_marginRight="64dp" + android:layout_height="0dp" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" android:layout_marginTop="16dp" android:layout_marginBottom="16dp" - android:layout_height="256dp" - android:src="@drawable/first_time_1" /> + android:adjustViewBounds="true" + android:src="@drawable/first_time_1" + android:layout_gravity="center_horizontal" + android:layout_weight="1" /> <TextView android:layout_width="wrap_content" @@ -38,51 +120,9 @@ android:textAppearance="?android:attr/textAppearanceMedium" android:text="@string/first_time_text1" android:layout_gravity="center_horizontal" - android:gravity="center_horizontal" /> + android:gravity="center_horizontal" + android:layout_marginBottom="16dp" /> - - </LinearLayout> - - <Button - android:id="@+id/first_time_cancel" - android:layout_alignParentBottom="true" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginLeft="8dp" - android:layout_marginRight="8dp" - android:text="@string/first_time_skip" - android:background="@drawable/button_edgy" /> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_above="@id/first_time_cancel" - android:orientation="horizontal"> - - <Button - android:id="@+id/first_time_create_key" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - android:layout_weight="1" - android:layout_marginLeft="8dp" - android:layout_marginRight="8dp" - android:text="@string/first_time_create_key" - android:background="@drawable/button_edgy" - android:drawableLeft="@drawable/ic_action_new_account" /> - - <Button - android:id="@+id/first_time_import_key" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_weight="1" - android:layout_gravity="center_horizontal" - android:layout_marginLeft="8dp" - android:layout_marginRight="8dp" - android:text="@string/first_time_import_key" - android:background="@drawable/button_edgy" - android:drawableLeft="@drawable/ic_action_download" /> </LinearLayout> diff --git a/OpenKeychain/src/main/res/layout/key_list_item.xml b/OpenKeychain/src/main/res/layout/key_list_item.xml index 99e4c0268..8d600464c 100644 --- a/OpenKeychain/src/main/res/layout/key_list_item.xml +++ b/OpenKeychain/src/main/res/layout/key_list_item.xml @@ -38,30 +38,12 @@ android:textAppearance="?android:attr/textAppearanceSmall" /> </LinearLayout> - <FrameLayout - android:id="@+id/status_layout" + <ImageView android:layout_width="wrap_content" - android:layout_height="match_parent"> - - <TextView - android:id="@+id/revoked" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:singleLine="true" - android:ellipsize="end" - android:textAppearance="?android:attr/textAppearanceSmall" - android:text="@string/revoked" - android:textColor="#e00" - android:layout_gravity="center" - android:padding="12dp" /> - - <ImageView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:id="@+id/verified" - android:layout_gravity="center" - android:src="@drawable/key_certify_ok_depth0" - android:padding="16dp" /> - </FrameLayout> + android:layout_height="wrap_content" + android:id="@+id/status_image" + android:layout_gravity="center" + android:src="@drawable/status_signature_revoked_cutout" + android:padding="16dp" /> </LinearLayout> diff --git a/OpenKeychain/src/main/res/layout/notify_area.xml b/OpenKeychain/src/main/res/layout/notify_area.xml index d2188b2a1..43df1cde8 100644 --- a/OpenKeychain/src/main/res/layout/notify_area.xml +++ b/OpenKeychain/src/main/res/layout/notify_area.xml @@ -1,5 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> - <merge xmlns:android="http://schemas.android.com/apk/res/android"> <LinearLayout diff --git a/OpenKeychain/src/main/res/layout/qr_code_activity.xml b/OpenKeychain/src/main/res/layout/qr_code_activity.xml new file mode 100644 index 000000000..57c869db6 --- /dev/null +++ b/OpenKeychain/src/main/res/layout/qr_code_activity.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + + <ImageView + android:id="@+id/qr_code_image" + android:padding="32dp" + android:layout_width="match_parent" + android:layout_height="match_parent" + style="@style/SelectableItem" /> + +</LinearLayout>
\ No newline at end of file diff --git a/OpenKeychain/src/main/res/layout/share_qr_code_dialog.xml b/OpenKeychain/src/main/res/layout/share_qr_code_dialog.xml deleted file mode 100644 index 0b58ae72f..000000000 --- a/OpenKeychain/src/main/res/layout/share_qr_code_dialog.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical" > - - <TextView - android:id="@+id/share_qr_code_dialog_text" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:padding="8dp" - android:textAppearance="@android:style/TextAppearance.Medium" /> - - <ImageView - android:id="@+id/share_qr_code_dialog_image" - android:layout_width="match_parent" - android:layout_height="wrap_content" /> - -</LinearLayout>
\ No newline at end of file diff --git a/OpenKeychain/src/main/res/layout/view_key_activity.xml b/OpenKeychain/src/main/res/layout/view_key_activity.xml index 3aaa96cda..b15a73c0e 100644 --- a/OpenKeychain/src/main/res/layout/view_key_activity.xml +++ b/OpenKeychain/src/main/res/layout/view_key_activity.xml @@ -6,36 +6,36 @@ <include layout="@layout/notify_area"/> - <TextView - android:layout_width="match_parent" + <LinearLayout + android:id="@+id/view_key_status_layout" + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="This key is expired!" - android:id="@+id/view_key_expired" - android:textColor="@color/alert" - android:textAppearance="?android:attr/textAppearanceSmall" - android:gravity="center_vertical|center_horizontal" + android:layout_gravity="center" android:layout_marginTop="8dp" android:layout_marginBottom="8dp" - android:visibility="gone" /> + android:orientation="horizontal"> - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="This key has been revoked!" - android:id="@+id/view_key_revoked" - android:textColor="@color/alert" - android:textAppearance="?android:attr/textAppearanceSmall" - android:gravity="center_vertical|center_horizontal" - android:visibility="gone" - android:layout_marginTop="8dp" - android:layout_marginBottom="8dp" /> + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:id="@+id/view_key_status_image" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:id="@+id/view_key_status_text" + android:textAppearance="?android:attr/textAppearanceMedium" + android:layout_gravity="center_vertical" + android:layout_marginLeft="8dp"/> + + </LinearLayout> <View android:layout_width="match_parent" android:layout_height="1dip" android:background="?android:attr/listDivider" android:visibility="gone" - android:id="@+id/status_divider" /> + android:id="@+id/view_key_status_divider" /> <org.sufficientlysecure.keychain.ui.widget.SlidingTabLayout android:id="@+id/view_key_sliding_tab_layout" diff --git a/OpenKeychain/src/main/res/layout/view_key_main_fragment.xml b/OpenKeychain/src/main/res/layout/view_key_main_fragment.xml index d93420a99..b11538ba9 100644 --- a/OpenKeychain/src/main/res/layout/view_key_main_fragment.xml +++ b/OpenKeychain/src/main/res/layout/view_key_main_fragment.xml @@ -35,20 +35,34 @@ android:layout_height="1dip" android:background="?android:attr/listDivider" /> - <TextView + <LinearLayout android:id="@+id/view_key_action_certify" - android:paddingLeft="8dp" - android:paddingRight="8dp" - android:textAppearance="?android:attr/textAppearanceMedium" android:layout_width="match_parent" - android:layout_height="match_parent" - android:text="@string/key_view_action_certify" - android:minHeight="?android:attr/listPreferredItemHeight" - android:drawableRight="@drawable/ic_action_good" - android:drawablePadding="8dp" - android:gravity="center_vertical" + android:layout_height="?android:attr/listPreferredItemHeight" android:clickable="true" - style="@style/SelectableItem" /> + android:paddingRight="4dp" + style="@style/SelectableItem" + android:orientation="horizontal"> + + <TextView + android:id="@+id/view_key_action_certify_text" + android:paddingLeft="8dp" + android:textAppearance="?android:attr/textAppearanceMedium" + android:layout_width="0dip" + android:layout_height="match_parent" + android:text="@string/key_view_action_certify" + android:layout_weight="1" + android:gravity="center_vertical" /> + + <ImageView + android:id="@+id/view_key_action_certify_image" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:padding="8dp" + android:src="@drawable/status_signature_verified_cutout" + android:layout_gravity="center_vertical" /> + + </LinearLayout> <TextView style="@style/SectionHeader" diff --git a/OpenKeychain/src/main/res/layout/view_key_user_id_item.xml b/OpenKeychain/src/main/res/layout/view_key_user_id_item.xml index 7de2f9c05..157903000 100644 --- a/OpenKeychain/src/main/res/layout/view_key_user_id_item.xml +++ b/OpenKeychain/src/main/res/layout/view_key_user_id_item.xml @@ -24,7 +24,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/certified" - android:src="@drawable/key_certify_ok_self" android:layout_gravity="center_horizontal" /> </LinearLayout> @@ -64,9 +63,9 @@ </LinearLayout> <ImageView + android:id="@+id/edit_image" android:layout_width="wrap_content" android:layout_height="match_parent" - android:id="@+id/edit_image" android:src="@drawable/ic_action_edit" android:padding="8dp" android:layout_gravity="center_horizontal" /> diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index 46760691d..3a5e77d38 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -487,6 +487,15 @@ <item>Revoke Subkey</item> </string-array> + <!-- Create key --> + <string name="create_key_text">Enter Full Name, Email and Passphrase!</string> + <string name="create_key_upload">Upload key to keyserver</string> + <string name="create_key_empty">This field is required</string> + + <!-- View key --> + <string name="view_key_revoked">This key has been revoked!</string> + <string name="view_key_expired">This key is expired!</string> + <!-- Navigation Drawer --> <string name="nav_keys">Keys</string> <string name="nav_encrypt">Sign and Encrypt</string> |