More UI rework

This commit is contained in:
Dominik Schürmann 2014-09-07 15:30:32 +02:00
parent 0706005732
commit 0e83df21cf
10 changed files with 158 additions and 113 deletions

View File

@ -88,14 +88,14 @@ public final class Constants {
public static final class DrawerItems { public static final class DrawerItems {
public static final Class KEY_LIST = KeyListActivity.class; public static final Class KEY_LIST = KeyListActivity.class;
public static final Class ENCRYPT_FILE = EncryptFileActivity.class;
public static final Class ENCRYPT_TEXT = EncryptTextActivity.class; public static final Class ENCRYPT_TEXT = EncryptTextActivity.class;
public static final Class ENCRYPT_FILE = EncryptFileActivity.class;
public static final Class DECRYPT = DecryptActivity.class; public static final Class DECRYPT = DecryptActivity.class;
public static final Class REGISTERED_APPS_LIST = AppsListActivity.class; public static final Class REGISTERED_APPS_LIST = AppsListActivity.class;
public static final Class[] ARRAY = new Class[]{ public static final Class[] ARRAY = new Class[]{
KEY_LIST, KEY_LIST,
ENCRYPT_FILE,
ENCRYPT_TEXT, ENCRYPT_TEXT,
ENCRYPT_FILE,
DECRYPT, DECRYPT,
REGISTERED_APPS_LIST REGISTERED_APPS_LIST
}; };

View File

@ -83,8 +83,8 @@ public class DrawerActivity extends ActionBarActivity {
NavItem mItemIconTexts[] = new NavItem[]{ NavItem mItemIconTexts[] = new NavItem[]{
new NavItem(R.drawable.ic_action_person, getString(R.string.nav_keys)), new NavItem(R.drawable.ic_action_person, getString(R.string.nav_keys)),
new NavItem(R.drawable.ic_action_secure, getString(R.string.nav_encrypt_files)),
new NavItem(R.drawable.ic_action_secure, getString(R.string.nav_encrypt_text)), new NavItem(R.drawable.ic_action_secure, getString(R.string.nav_encrypt_text)),
new NavItem(R.drawable.ic_action_secure, getString(R.string.nav_encrypt_files)),
new NavItem(R.drawable.ic_action_not_secure, getString(R.string.nav_decrypt)), new NavItem(R.drawable.ic_action_not_secure, getString(R.string.nav_decrypt)),
new NavItem(R.drawable.ic_action_view_as_list, getString(R.string.nav_apps))}; new NavItem(R.drawable.ic_action_view_as_list, getString(R.string.nav_apps))};
@ -248,6 +248,7 @@ public class DrawerActivity extends ActionBarActivity {
/** /**
* NavItem constructor * NavItem constructor
*
* @param icon The icons resource-id * @param icon The icons resource-id
* @param title The title of the menu entry * @param title The title of the menu entry
*/ */

View File

@ -210,9 +210,7 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView {
} }
public String getPrimary() { public String getPrimary() {
if (mUserId[0] != null && mUserId[2] != null) { if (mUserId[0] != null) {
return mUserId[0] + " (" + mUserId[2] + ")";
} else if (mUserId[0] != null) {
return mUserId[0]; return mUserId[0];
} else { } else {
return mUserId[1]; return mUserId[1];
@ -220,7 +218,7 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView {
} }
public String getSecondary() { public String getSecondary() {
if (mUserId[0] != null) { if (mUserId[1] != null) {
return mUserId[1]; return mUserId[1];
} else { } else {
return getKeyIdHex(); return getKeyIdHex();

View File

@ -133,7 +133,7 @@ public abstract class KeySpinner extends Spinner implements LoaderManager.Loader
inner = new CursorAdapter(null, null, 0) { inner = new CursorAdapter(null, null, 0) {
@Override @Override
public View newView(Context context, Cursor cursor, ViewGroup parent) { public View newView(Context context, Cursor cursor, ViewGroup parent) {
return View.inflate(getContext(), R.layout.keyspinner_key, null); return View.inflate(getContext(), R.layout.keyspinner_item, null);
} }
@Override @Override
@ -210,7 +210,7 @@ public abstract class KeySpinner extends Spinner implements LoaderManager.Loader
} else { } else {
v = convertView; v = convertView;
} }
((TextView) v.findViewById(R.id.keyspinner_key_name)).setText("None"); ((TextView) v.findViewById(R.id.keyspinner_key_name)).setText(R.string.choice_none);
v.findViewById(R.id.keyspinner_key_email).setVisibility(View.GONE); v.findViewById(R.id.keyspinner_key_email).setVisibility(View.GONE);
v.findViewById(R.id.keyspinner_key_id).setVisibility(View.GONE); v.findViewById(R.id.keyspinner_key_id).setVisibility(View.GONE);
} else { } else {

View File

@ -41,20 +41,30 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/api_settings_settings" /> android:text="@string/api_settings_settings" />
<TextView <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:padding="0dp"
android:layout_margin="0dp">
<TextView
android:paddingLeft="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/api_settings_key" android:text="@string/api_settings_key"
android:textAppearance="?android:attr/textAppearanceMedium" /> android:paddingRight="8dp" />
<org.sufficientlysecure.keychain.ui.widget.SignKeySpinner <org.sufficientlysecure.keychain.ui.widget.SignKeySpinner
android:id="@+id/api_account_settings_key_spinner" android:id="@+id/api_account_settings_key_spinner"
android:minHeight="56dip"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_gravity="center_vertical" /> android:layout_gravity="center_vertical" />
</LinearLayout>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dip" android:layout_height="1dip"
@ -67,9 +77,8 @@
android:paddingRight="8dp" android:paddingRight="8dp"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/api_settings_create_key" android:text="@string/api_settings_create_key"
android:minHeight="48dp" android:layout_height="?android:attr/listPreferredItemHeight"
android:drawableRight="@drawable/ic_action_new_account" android:drawableRight="@drawable/ic_action_new_account"
android:drawablePadding="8dp" android:drawablePadding="8dp"
android:gravity="center_vertical" android:gravity="center_vertical"
@ -87,39 +96,72 @@
custom:foldedLabel="@string/api_settings_show_advanced" custom:foldedLabel="@string/api_settings_show_advanced"
custom:unFoldedLabel="@string/api_settings_hide_advanced"> custom:unFoldedLabel="@string/api_settings_hide_advanced">
<TextView <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="0dp"
android:layout_margin="0dp">
<TextView
android:paddingLeft="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/label_encryption_algorithm" android:text="@string/label_encryption_algorithm"
android:textAppearance="?android:attr/textAppearanceMedium" /> android:paddingRight="8dp" />
<Spinner <Spinner
android:id="@+id/api_account_settings_encryption_algorithm" android:id="@+id/api_account_settings_encryption_algorithm"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<TextView </LinearLayout>
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="0dp"
android:layout_margin="0dp">
<TextView
android:paddingLeft="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/label_hash_algorithm" android:text="@string/label_hash_algorithm"
android:textAppearance="?android:attr/textAppearanceMedium" /> android:paddingRight="8dp" />
<Spinner <Spinner
android:id="@+id/api_account_settings_hash_algorithm" android:id="@+id/api_account_settings_hash_algorithm"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<TextView </LinearLayout>
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="0dp"
android:layout_margin="0dp">
<TextView
android:paddingLeft="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/label_message_compression" android:text="@string/label_message_compression"
android:textAppearance="?android:attr/textAppearanceMedium" /> android:paddingRight="8dp" />
<Spinner <Spinner
android:id="@+id/api_account_settings_compression" android:id="@+id/api_account_settings_compression"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
</LinearLayout>
</org.sufficientlysecure.keychain.ui.widget.FoldableLinearLayout> </org.sufficientlysecure.keychain.ui.widget.FoldableLinearLayout>
</LinearLayout> </LinearLayout>

View File

@ -22,8 +22,6 @@
<TextView <TextView
android:paddingLeft="12dp" android:paddingLeft="12dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
@ -32,6 +30,7 @@
<org.sufficientlysecure.keychain.ui.widget.SignKeySpinner <org.sufficientlysecure.keychain.ui.widget.SignKeySpinner
android:id="@+id/sign" android:id="@+id/sign"
android:minHeight="56dip"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" /> android:layout_gravity="center_vertical" />

View File

@ -1,17 +1,16 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/attachment_bg_holo"> android:background="@drawable/attachment_bg_holo">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@android:id/text1" android:id="@android:id/text1"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:padding="4dp"/> android:padding="4dp" />
<ImageView <ImageView
android:id="@android:id/icon" android:id="@android:id/icon"
@ -20,5 +19,5 @@
android:layout_marginLeft="12dip" android:layout_marginLeft="12dip"
android:cropToPadding="true" android:cropToPadding="true"
android:background="#ccc" android:background="#ccc"
android:scaleType="centerCrop"/> android:scaleType="centerCrop" />
</LinearLayout> </LinearLayout>

View File

@ -1,27 +1,30 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="48dip" android:minHeight="48dip"
android:orientation="horizontal" android:orientation="horizontal"
android:gravity="center_vertical"> android:gravity="center_vertical">
<LinearLayout <LinearLayout
android:layout_width="0dip" android:layout_width="0dip"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="vertical" android:orientation="vertical"
android:layout_weight="1"> android:layout_weight="1">
<TextView android:id="@android:id/title"
<TextView
android:id="@android:id/title"
android:textColor="?android:attr/textColorSecondary" android:textColor="?android:attr/textColorSecondary"
android:textSize="18sp" android:textSize="18sp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="8dip" android:paddingLeft="8dip"
android:singleLine="true" android:singleLine="true"
android:ellipsize="end"/> android:ellipsize="end" />
<TextView android:id="@android:id/text1"
<TextView
android:id="@android:id/text1"
android:textColor="?android:attr/textColorTertiary" android:textColor="?android:attr/textColorTertiary"
android:textSize="14sp" android:textSize="14sp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -29,8 +32,10 @@
android:paddingLeft="16dip" android:paddingLeft="16dip"
android:singleLine="true" android:singleLine="true"
android:ellipsize="end" android:ellipsize="end"
android:layout_marginTop="-4dip"/> android:layout_marginTop="-4dip" />
<TextView android:id="@android:id/text2"
<TextView
android:id="@android:id/text2"
android:textColor="?android:attr/textColorTertiary" android:textColor="?android:attr/textColorTertiary"
android:textSize="14sp" android:textSize="14sp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -38,8 +43,10 @@
android:paddingLeft="16dip" android:paddingLeft="16dip"
android:singleLine="true" android:singleLine="true"
android:ellipsize="end" android:ellipsize="end"
android:layout_marginTop="-4dip"/> android:typeface="monospace"
android:layout_marginTop="-4dip" />
</LinearLayout> </LinearLayout>
<ImageView <ImageView
android:id="@android:id/icon" android:id="@android:id/icon"
android:layout_width="56dip" android:layout_width="56dip"
@ -47,5 +54,5 @@
android:layout_marginLeft="12dip" android:layout_marginLeft="12dip"
android:cropToPadding="true" android:cropToPadding="true"
android:background="#ccc" android:background="#ccc"
android:scaleType="centerCrop"/> android:scaleType="centerCrop" />
</LinearLayout> </LinearLayout>

View File

@ -90,19 +90,18 @@
<string name="label_passphrase_again">Repeat Passphrase</string> <string name="label_passphrase_again">Repeat Passphrase</string>
<string name="label_algorithm">Algorithm</string> <string name="label_algorithm">Algorithm</string>
<string name="label_ascii_armor">File ASCII Armor</string> <string name="label_ascii_armor">File ASCII Armor</string>
<string name="label_file_ascii_armor">Files: ASCII Armor</string> <string name="label_file_ascii_armor">Enable ASCII Armor</string>
<string name="label_write_version_header">Let others know that you\'re using OpenKeychain</string> <string name="label_write_version_header">Let others know that you\'re using OpenKeychain</string>
<string name="label_write_version_header_summary">Writes \'OpenKeychain v2.7\' to OpenPGP signatures, ciphertext, and exported keys</string> <string name="label_write_version_header_summary">Writes \'OpenKeychain v2.7\' to OpenPGP signatures, ciphertext, and exported keys</string>
<string name="label_use_default_yubikey_pin">Use default Yubikey PIN</string> <string name="label_use_default_yubikey_pin">Use default Yubikey PIN</string>
<string name="label_label_use_default_yubikey_pin_summary">Uses default PIN (123456) to access Yubikeys over NFC</string> <string name="label_label_use_default_yubikey_pin_summary">Uses default PIN (123456) to access Yubikeys over NFC</string>
<string name="label_asymmetric_from">Signed by:</string> <string name="label_asymmetric_from">Signed by:</string>
<string name="label_to">Encrypt to:</string> <string name="label_to">Encrypt to:</string>
<string name="label_delete_after_encryption">Files: Delete After Encryption</string> <string name="label_delete_after_encryption">Delete File After Encryption</string>
<string name="label_delete_after_decryption">Delete After Decryption</string> <string name="label_delete_after_decryption">Delete After Decryption</string>
<string name="label_encryption_algorithm">Encryption Algorithm</string> <string name="label_encryption_algorithm">Encryption Algorithm</string>
<string name="label_hash_algorithm">Hash Algorithm</string> <string name="label_hash_algorithm">Hash Algorithm</string>
<string name="label_asymmetric">With Public Key</string> <string name="label_symmetric">Encrypt With Passphrase</string>
<string name="label_symmetric">With Passphrase</string>
<string name="label_passphrase_cache_ttl">Passphrase Cache</string> <string name="label_passphrase_cache_ttl">Passphrase Cache</string>
<string name="label_message_compression">Message Compression</string> <string name="label_message_compression">Message Compression</string>
<string name="label_file_compression">File Compression</string> <string name="label_file_compression">File Compression</string>
@ -416,7 +415,7 @@
<string name="api_settings_package_signature">SHA-256 of Package Signature</string> <string name="api_settings_package_signature">SHA-256 of Package Signature</string>
<string name="api_settings_accounts">Accounts</string> <string name="api_settings_accounts">Accounts</string>
<string name="api_settings_settings">Settings</string> <string name="api_settings_settings">Settings</string>
<string name="api_settings_key">My key for this account</string> <string name="api_settings_key">Account key:</string>
<string name="api_settings_accounts_empty">No accounts attached to this app.</string> <string name="api_settings_accounts_empty">No accounts attached to this app.</string>
<string name="api_create_account_text">"The app requests the creation of a new account. Please select one of your existing keys or create a new one.\nApps are restricted to the usage of keys you select here!"</string> <string name="api_create_account_text">"The app requests the creation of a new account. Please select one of your existing keys or create a new one.\nApps are restricted to the usage of keys you select here!"</string>
<string name="api_update_account_text">"The key saved for this account has been deleted. Please select a different one!\nApps are restricted to the usage of keys you select here!"</string> <string name="api_update_account_text">"The key saved for this account has been deleted. Please select a different one!\nApps are restricted to the usage of keys you select here!"</string>
@ -512,7 +511,7 @@
<string name="my_keys">My Keys</string> <string name="my_keys">My Keys</string>
<!-- hints --> <!-- hints -->
<string name="encrypt_content_edit_text_hint">The message entered here will be signed using the key selected in \'Signed by\' and encrypted for all recipients selected in \'Encrypt to\'.</string> <string name="encrypt_content_edit_text_hint">Type text</string>
<string name="decrypt_content_edit_text_hint">Enter ciphertext here to decrypt and/or verify…</string> <string name="decrypt_content_edit_text_hint">Enter ciphertext here to decrypt and/or verify…</string>
<!-- certs --> <!-- certs -->
@ -755,7 +754,7 @@
<string name="passp_cache_notif_n_keys">OpenKeychain has cached %d passphrases</string> <string name="passp_cache_notif_n_keys">OpenKeychain has cached %d passphrases</string>
<string name="passp_cache_notif_keys">Cached Passphrases:</string> <string name="passp_cache_notif_keys">Cached Passphrases:</string>
<string name="passp_cache_notif_clear">Clear Cache</string> <string name="passp_cache_notif_clear">Clear Cache</string>
<string name="passp_cache_notif_pwd">Password</string> <string name="passp_cache_notif_pwd">Passphrase</string>
<!-- unsorted --> <!-- unsorted -->
<string name="section_certifier_id">Certifier</string> <string name="section_certifier_id">Certifier</string>