Redesign "select signing key" api dialog

This commit is contained in:
Vincent Breitmoser
2017-01-26 20:23:58 +01:00
parent 23cb3c9426
commit b92ff86988
20 changed files with 1609 additions and 23 deletions

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?listPreferredItemHeight"
android:gravity="center_vertical"
android:orientation="horizontal"
android:background="?selectableItemBackground"
android:clickable="true"
android:focusable="true">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:id="@+id/key_list_item_icon"
tools:tint="@color/md_grey_600"
tools:src="@drawable/apps_k9"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/key_list_item_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
tools:text="Use key: look@my.amazin.horse"
/>
<TextView
android:id="@+id/key_list_item_creation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:visibility="visible"
tools:text="Created on 10/10/2010 10:00" />
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,431 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:layout_marginTop="24dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:elevation="4dp"
android:gravity="center_horizontal"
android:padding="16dp"
tools:targetApi="lollipop">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:src="@drawable/link_24dp"
/>
<ImageView
android:id="@+id/icon_client_app"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:src="@drawable/apps_k9"
/>
</LinearLayout>
<TextView
android:id="@+id/text_title_select_key"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="22dp"
android:textAppearance="?android:attr/textAppearanceMedium"
tools:text="@string/title_select_key" />
<TextView
android:id="@+id/text_user_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center_vertical"
android:minHeight="?listPreferredItemHeight"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold"
tools:text="look@my.amazin.horse"
/>
<org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator
android:id="@+id/layout_animator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inAnimation="@anim/fade_in"
android:outAnimation="@anim/fade_out"
android:measureAllChildren="true"
custom:initialView="05">
<Space
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/select_key_layout_empty" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/select_key_layout_no_keys"
>
<LinearLayout
android:id="@+id/button_no_keys_new"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:gravity="center_vertical"
android:minHeight="?listPreferredItemHeight"
android:orientation="horizontal">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:src="@drawable/ic_key_plus_grey600_24dp"
/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
style="?android:textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="This is a new address"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Create new end-to-end key in OpenKeychain"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/button_no_keys_existing"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:gravity="center_vertical"
android:minHeight="?listPreferredItemHeight"
android:orientation="horizontal">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:src="@drawable/ic_save_black_24dp"
android:tint="@color/md_grey_600"
/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
style="?android:textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="I already have a key"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Import end-to-end key from other device"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/button_no_keys_cancel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="?selectableItemBackground"
android:gravity="center_vertical"
android:minHeight="?listPreferredItemHeight"
android:orientation="horizontal">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:src="@drawable/ic_close_black_24dp"
android:tint="@color/md_grey_600"
/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
style="?android:textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/select_key_layout_key_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="@+id/identity_key_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:layout_height="?listPreferredItemHeight"
tools:listitem="@layout/api_select_identity_item"
/>
<LinearLayout
android:id="@+id/button_key_list_other"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:gravity="center_vertical"
android:minHeight="?listPreferredItemHeight"
android:orientation="horizontal">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:src="@drawable/ic_save_black_24dp"
android:tint="@color/md_grey_600"
/>
<TextView
style="?android:textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Use a different key"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/button_key_list_cancel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="?selectableItemBackground"
android:gravity="center_vertical"
android:minHeight="?listPreferredItemHeight"
android:orientation="horizontal">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:src="@drawable/ic_close_black_24dp"
android:tint="@color/md_grey_600"
/>
<TextView
style="?android:textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/select_key_layout_import_expl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:text="To use an existing end-to-end key, you can either:\n\n① Open Autocrypt Setup Message from another e-mail app in K-9 Mail\n\n② Manually manage keys in OpenKeychain"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
<LinearLayout
style="?buttonBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginTop="12dp"
android:gravity="end"
android:orientation="horizontal"
android:padding="8dp">
<Button
android:id="@+id/button_expl_back"
style="?buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_back"
/>
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
<Button
android:id="@+id/button_expl_got_it"
style="?buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:text="@string/button_got_it"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?listPreferredItemHeight"
android:orientation="horizontal"
android:id="@+id/select_key_layout_generate_progress"
android:layout_marginTop="36dp"
android:paddingLeft="16dp"
android:paddingRight="16dp">
<ProgressBar
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_gravity="center_vertical"
android:indeterminate="true"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="Generating end-to-end key…"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="36dp"
android:orientation="vertical"
android:id="@+id/select_key_layout_generate_ok"
android:paddingLeft="16dp"
android:paddingRight="16dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?listPreferredItemHeight"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:src="@drawable/ic_check_black_24dp"
android:tint="@color/android_green_light"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="Generated end-to-end key!"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/button_gen_back"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="8dp"
android:background="?selectableItemBackground"
android:orientation="horizontal"
style="?buttonBarStyle">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/button_genok_back"
android:text="Back"
style="?buttonBarButtonStyle"
/>
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/button_genok_finish"
android:text="Finish"
style="?buttonBarButtonStyle"
/>
</LinearLayout>
</LinearLayout>
</org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator>
</LinearLayout>

View File

@@ -2,13 +2,15 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:paddingLeft="4dp"
android:paddingStart="4dp"
android:paddingRight="?android:attr/scrollbarSize"
android:maxLines="1">
android:paddingEnd="?android:attr/scrollbarSize"
android:maxLines="1"
tools:layout_marginTop="24dp">
<CheckBox
android:id="@+id/selected"

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?listPreferredItemHeight"
android:orientation="horizontal"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:background="?android:selectableItemBackground"
tools:layout_marginTop="24dp">
<ImageView
android:id="@+id/select_key_item_status_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="16dp"
tools:src="@drawable/ic_vpn_key_grey_24dp"
/>
<LinearLayout
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:layout_gravity="center_vertical">
<TextView
android:id="@+id/select_key_item_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="Use Key: Alice"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/select_key_item_creation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="Key created Dec 16, 2005, 12:18 PM"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/list_all_keys"
android:title="List all keys"
android:checkable="true"
android:orderInCategory="1" />
</menu>

View File

@@ -1768,6 +1768,8 @@
<string name="requested_key_unavailable_warning">This key is not available. To use it, you must import it as one of your own!</string>
<string name="button_allow">Allow</string>
<string name="button_cancel">Cancel</string>
<string name="button_back">Back</string>
<string name="button_got_it">Got it</string>
<string name="requested_key_label">Requested key:</string>
<string name="error_preselect_sign_key">Error selecting key %s for signing!</string>
<string name="error_preselect_encrypt_key">Error selecting key %s for encryption!</string>
@@ -1987,4 +1989,9 @@
<string name="label_usb_untested_summary">If enabled, USB Smartcard readers can be used that have not been properly tested.</string>
<string name="label_usb_untested">Allow untested USB Devices</string>
<string name="use_key">Use key: %s</string>
<string name="use_key_no_name">Use key: <![CDATA[<no name>]]></string>
<string name="title_select_key">%s wants to end-to-end encrypt with this address:</string>
<string name="select_identity_cancel">Cancel</string>
<string name="select_identity_create">Create a key for me</string>
</resources>

View File

@@ -133,18 +133,17 @@
<item name="windowNoTitle">true</item>
</style>
<style name="Theme.Keychain.AppCompat.Transparent" parent="Theme.AppCompat.NoActionBar">
<style name="Theme.Keychain.AppCompat.Transparent" parent="Theme.AppCompat.Light.Dialog">
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowAnimationStyle">@style/Animation.AppCompat.Dialog</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item>
</style>
<style name="Theme.Keychain.AppCompat.Transparent.Fullscreen" parent="Theme.Keychain.AppCompat.Transparent">
<item name="android:windowFullscreen">true</item>
</style>
<style name="Theme.Keychain.Transparent" parent="@android:style/Theme.NoDisplay" />
<style name="Theme.Keychain.Transparent" parent="Theme.Keychain.AppCompat.Transparent" />
</resources>