aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain/res
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2014-01-18 18:44:34 +0100
committerDominik Schürmann <dominik@dominikschuermann.de>2014-01-18 18:44:34 +0100
commit47e3bd6d6556fde0ba2683d5e2e079eb992d6c7d (patch)
tree1403a30edfe3b7e3d004452043a5141fa38b9526 /OpenPGP-Keychain/res
parent68042847df39eaad7c150f532bf65d6e1fd9ae10 (diff)
downloadopen-keychain-47e3bd6d6556fde0ba2683d5e2e079eb992d6c7d.tar.gz
open-keychain-47e3bd6d6556fde0ba2683d5e2e079eb992d6c7d.tar.bz2
open-keychain-47e3bd6d6556fde0ba2683d5e2e079eb992d6c7d.zip
Externalize secret key selection into fragment for reuse in different activities
Diffstat (limited to 'OpenPGP-Keychain/res')
-rw-r--r--OpenPGP-Keychain/res/layout/api_app_settings_fragment.xml46
-rw-r--r--OpenPGP-Keychain/res/layout/key_server_export.xml2
-rw-r--r--OpenPGP-Keychain/res/layout/key_server_query.xml2
-rw-r--r--OpenPGP-Keychain/res/layout/select_secret_key_layout_fragment.xml46
-rw-r--r--OpenPGP-Keychain/res/layout/sign_key_activity.xml37
5 files changed, 70 insertions, 63 deletions
diff --git a/OpenPGP-Keychain/res/layout/api_app_settings_fragment.xml b/OpenPGP-Keychain/res/layout/api_app_settings_fragment.xml
index a88d7afd2..cecb2f93d 100644
--- a/OpenPGP-Keychain/res/layout/api_app_settings_fragment.xml
+++ b/OpenPGP-Keychain/res/layout/api_app_settings_fragment.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:bootstrapbutton="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
@@ -37,49 +38,12 @@
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
- <LinearLayout
+ <fragment
+ android:id="@+id/api_app_settings_select_key_fragment"
+ android:name="org.sufficientlysecure.keychain.ui.SelectSecretKeyLayoutFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal" >
-
- <com.beardedhen.androidbootstrap.BootstrapButton
- android:id="@+id/api_app_settings_select_key_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:layout_margin="4dp"
- android:text="@string/api_settings_select_key"
- bootstrapbutton:bb_icon_left="fa-key"
- bootstrapbutton:bb_size="default"
- bootstrapbutton:bb_type="default" />
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:paddingLeft="16dp" >
-
- <TextView
- android:id="@+id/api_app_settings_user_id"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="right"
- android:ellipsize="end"
- android:singleLine="true"
- android:text="@string/api_settings_no_key"
- android:textAppearance="?android:attr/textAppearanceMedium" />
-
- <TextView
- android:id="@+id/api_app_settings_user_id_rest"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="right"
- android:ellipsize="end"
- android:singleLine="true"
- android:text=""
- android:textAppearance="?android:attr/textAppearanceSmall" />
- </LinearLayout>
- </LinearLayout>
+ tools:layout="@layout/select_secret_key_layout_fragment" />
<com.beardedhen.androidbootstrap.BootstrapButton
android:id="@+id/api_app_settings_advanced_button"
diff --git a/OpenPGP-Keychain/res/layout/key_server_export.xml b/OpenPGP-Keychain/res/layout/key_server_export.xml
index 30e4e0644..bfc4278c4 100644
--- a/OpenPGP-Keychain/res/layout/key_server_export.xml
+++ b/OpenPGP-Keychain/res/layout/key_server_export.xml
@@ -5,7 +5,7 @@
android:orientation="vertical" >
<Spinner
- android:id="@+id/keyServer"
+ android:id="@+id/sign_key_keyserver"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
diff --git a/OpenPGP-Keychain/res/layout/key_server_query.xml b/OpenPGP-Keychain/res/layout/key_server_query.xml
index 20f260a95..ab76d3aed 100644
--- a/OpenPGP-Keychain/res/layout/key_server_query.xml
+++ b/OpenPGP-Keychain/res/layout/key_server_query.xml
@@ -5,7 +5,7 @@
android:orientation="vertical" >
<Spinner
- android:id="@+id/keyServer"
+ android:id="@+id/sign_key_keyserver"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
diff --git a/OpenPGP-Keychain/res/layout/select_secret_key_layout_fragment.xml b/OpenPGP-Keychain/res/layout/select_secret_key_layout_fragment.xml
new file mode 100644
index 000000000..7557a2830
--- /dev/null
+++ b/OpenPGP-Keychain/res/layout/select_secret_key_layout_fragment.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:bootstrapbutton="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal" >
+
+ <com.beardedhen.androidbootstrap.BootstrapButton
+ android:id="@+id/select_secret_key_select_key_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:layout_margin="4dp"
+ android:text="@string/api_settings_select_key"
+ bootstrapbutton:bb_icon_left="fa-key"
+ bootstrapbutton:bb_size="default"
+ bootstrapbutton:bb_type="default" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:paddingLeft="16dp" >
+
+ <TextView
+ android:id="@+id/select_secret_key_user_id"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="right"
+ android:ellipsize="end"
+ android:singleLine="true"
+ android:text="@string/api_settings_no_key"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
+
+ <TextView
+ android:id="@+id/select_secret_key_user_id_rest"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="right"
+ android:ellipsize="end"
+ android:singleLine="true"
+ android:text=""
+ android:textAppearance="?android:attr/textAppearanceSmall" />
+ </LinearLayout>
+
+</LinearLayout> \ No newline at end of file
diff --git a/OpenPGP-Keychain/res/layout/sign_key_activity.xml b/OpenPGP-Keychain/res/layout/sign_key_activity.xml
index b9f66db7f..ada4572ca 100644
--- a/OpenPGP-Keychain/res/layout/sign_key_activity.xml
+++ b/OpenPGP-Keychain/res/layout/sign_key_activity.xml
@@ -1,14 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:bootstrapbutton="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:orientation="vertical" >
+ android:orientation="vertical"
+ android:padding="10dp" >
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal" >
- </LinearLayout>
+ <include layout="@layout/select_secret_key_layout_fragment" />
<LinearLayout
android:layout_width="match_parent"
@@ -16,20 +14,17 @@
android:orientation="horizontal" >
<TextView
- android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_send_key"
- android:textAppearance="?android:attr/textAppearanceMedium" >
- </TextView>
+ android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
- android:id="@+id/sendKey"
+ android:id="@+id/sign_key_upload_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
- android:text="" >
- </CheckBox>
+ android:text="" />
</LinearLayout>
<LinearLayout
@@ -38,17 +33,19 @@
android:orientation="horizontal" >
<Spinner
- android:id="@+id/keyServer"
- android:layout_width="wrap_content"
+ android:id="@+id/sign_key_keyserver"
+ android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
- <Button
- android:id="@+id/sign"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/btn_sign" >
- </Button>
+ <com.beardedhen.androidbootstrap.BootstrapButton
+ android:id="@+id/sign_key_sign_button"
+ android:layout_width="match_parent"
+ android:layout_height="60dp"
+ android:padding="4dp"
+ android:text="@string/btn_sign"
+ bootstrapbutton:bb_icon_left="fa-lock"
+ bootstrapbutton:bb_type="info" />
</LinearLayout> \ No newline at end of file