aboutsummaryrefslogtreecommitdiffstats
path: root/org_apg
diff options
context:
space:
mode:
Diffstat (limited to 'org_apg')
-rw-r--r--org_apg/AndroidManifest.xml16
-rw-r--r--org_apg/res/drawable-hdpi/create_contact.pngbin0 -> 956 bytes
-rw-r--r--org_apg/res/drawable-hdpi/dashboard_decrypt_default.pngbin0 -> 4996 bytes
-rw-r--r--org_apg/res/drawable-hdpi/dashboard_decrypt_pressed.pngbin0 -> 5032 bytes
-rw-r--r--org_apg/res/drawable-hdpi/dashboard_encrypt_default.pngbin0 -> 4926 bytes
-rw-r--r--org_apg/res/drawable-hdpi/dashboard_encrypt_pressed.pngbin0 -> 4967 bytes
-rw-r--r--org_apg/res/drawable-hdpi/dashboard_help_pressed.pngbin8343 -> 8343 bytes
-rw-r--r--org_apg/res/drawable-hdpi/dashboard_manage_keys_pressed.pngbin7222 -> 7147 bytes
-rw-r--r--org_apg/res/drawable-hdpi/dashboard_my_keys_pressed.pngbin5429 -> 5414 bytes
-rw-r--r--org_apg/res/drawable-hdpi/dashboard_scan_qrcode_default.pngbin0 -> 6370 bytes
-rw-r--r--org_apg/res/drawable-hdpi/dashboard_scan_qrcode_pressed.pngbin0 -> 6370 bytes
-rw-r--r--org_apg/res/drawable-hdpi/ic_menu_find_holo_light.pngbin0 -> 1190 bytes
-rw-r--r--org_apg/res/drawable-hdpi/ic_menu_search_holo_light.pngbin0 -> 1218 bytes
-rw-r--r--org_apg/res/drawable-hdpi/ic_menu_settings_holo_light.pngbin0 -> 1227 bytes
-rw-r--r--org_apg/res/drawable-hdpi/ic_menu_share_holo_light.pngbin0 -> 505 bytes
-rw-r--r--org_apg/res/drawable-hdpi/ic_suggestions_add.pngbin0 -> 373 bytes
-rw-r--r--org_apg/res/drawable-hdpi/ic_suggestions_delete.pngbin0 -> 580 bytes
-rw-r--r--org_apg/res/drawable-mdpi/create_contact.pngbin0 -> 689 bytes
-rw-r--r--org_apg/res/drawable-mdpi/ic_menu_find_holo_light.pngbin0 -> 863 bytes
-rw-r--r--org_apg/res/drawable-mdpi/ic_menu_search_holo_light.pngbin0 -> 858 bytes
-rw-r--r--org_apg/res/drawable-mdpi/ic_menu_settings_holo_light.pngbin0 -> 866 bytes
-rw-r--r--org_apg/res/drawable-mdpi/ic_menu_share_holo_light.pngbin0 -> 355 bytes
-rw-r--r--org_apg/res/drawable-mdpi/ic_suggestions_add.pngbin0 -> 359 bytes
-rw-r--r--org_apg/res/drawable-mdpi/ic_suggestions_delete.pngbin0 -> 460 bytes
-rw-r--r--org_apg/res/drawable-xhdpi/create_contact.pngbin0 -> 1313 bytes
-rw-r--r--org_apg/res/drawable-xhdpi/ic_menu_find_holo_light.pngbin0 -> 1571 bytes
-rw-r--r--org_apg/res/drawable-xhdpi/ic_menu_search_holo_light.pngbin0 -> 1629 bytes
-rw-r--r--org_apg/res/drawable-xhdpi/ic_menu_settings_holo_light.pngbin0 -> 1622 bytes
-rw-r--r--org_apg/res/drawable-xhdpi/ic_menu_share_holo_light.pngbin0 -> 935 bytes
-rw-r--r--org_apg/res/drawable-xhdpi/ic_suggestions_add.pngbin0 -> 419 bytes
-rw-r--r--org_apg/res/drawable-xhdpi/ic_suggestions_delete.pngbin0 -> 771 bytes
-rw-r--r--org_apg/res/drawable/dashboard_decrypt.xml (renamed from org_apg/res/drawable/dashboard_encrypt_decrypt_file.xml)8
-rw-r--r--org_apg/res/drawable/dashboard_encrypt.xml (renamed from org_apg/res/drawable/dashboard_encrypt_decrypt_text.xml)8
-rw-r--r--org_apg/res/drawable/dashboard_scan_qrcode.xml28
-rw-r--r--org_apg/res/layout/about_activity.xml4
-rw-r--r--org_apg/res/layout/encrypt.xml256
-rw-r--r--org_apg/res/layout/main.xml24
-rw-r--r--org_apg/res/values/arrays.xml173
-rw-r--r--org_apg/res/values/strings.xml12
-rw-r--r--org_apg/res/xml/apg_preferences.xml7
-rw-r--r--org_apg/src/org/apg/Id.java4
-rw-r--r--org_apg/src/org/apg/ui/BaseActivity.java45
-rw-r--r--org_apg/src/org/apg/ui/EncryptActivity.java33
-rw-r--r--org_apg/src/org/apg/ui/MailListActivity.java1
-rw-r--r--org_apg/src/org/apg/ui/MainActivity.java263
-rw-r--r--org_apg/src/org/apg/ui/PreferencesActivity.java245
-rw-r--r--org_apg/src/org/apg/ui/PublicKeyListActivity.java70
-rw-r--r--org_apg/src/org/apg/ui/SecretKeyListActivity.java113
-rw-r--r--org_apg/src/org/apg/ui/widget/DashboardLayout.java9
-rw-r--r--org_apg/src/org/apg/ui/widget/SectionView.java173
-rw-r--r--org_apg/src/org/apg/ui/widget/UserIdEditor.java12
51 files changed, 677 insertions, 827 deletions
diff --git a/org_apg/AndroidManifest.xml b/org_apg/AndroidManifest.xml
index 4ee489bbb..12bfd07f3 100644
--- a/org_apg/AndroidManifest.xml
+++ b/org_apg/AndroidManifest.xml
@@ -30,7 +30,7 @@
android:hardwareAccelerated="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
- android:theme="@style/Theme.Sherlock.Light" >
+ android:theme="@style/Theme.Sherlock.Light.ForceOverflow" >
<activity
android:name=".ui.MainActivity"
android:configChanges="keyboardHidden|orientation|keyboard"
@@ -45,7 +45,8 @@
android:name=".ui.PublicKeyListActivity"
android:configChanges="keyboardHidden|orientation|keyboard"
android:label="@string/title_managePublicKeys"
- android:launchMode="singleTop" >
+ android:launchMode="singleTop"
+ android:uiOptions="splitActionBarWhenNarrow" >
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
@@ -58,7 +59,8 @@
android:name=".ui.SecretKeyListActivity"
android:configChanges="keyboardHidden|orientation|keyboard"
android:label="@string/title_manageSecretKeys"
- android:launchMode="singleTop" >
+ android:launchMode="singleTop"
+ android:uiOptions="splitActionBarWhenNarrow" >
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
@@ -110,7 +112,8 @@
<activity
android:name=".ui.EncryptActivity"
android:configChanges="keyboardHidden|orientation|keyboard"
- android:label="@string/title_encrypt" >
+ android:label="@string/title_encrypt"
+ android:uiOptions="splitActionBarWhenNarrow" >
<intent-filter>
<action android:name="org.apg.intent.ENCRYPT" />
<action android:name="org.apg.intent.ENCRYPT_FILE" />
@@ -125,7 +128,8 @@
<activity
android:name=".ui.DecryptActivity"
android:configChanges="keyboardHidden|orientation|keyboard"
- android:label="@string/title_decrypt" >
+ android:label="@string/title_decrypt"
+ android:uiOptions="splitActionBarWhenNarrow" >
<intent-filter>
<action android:name="org.apg.intent.DECRYPT" />
<action android:name="org.apg.intent.DECRYPT_FILE" />
@@ -200,7 +204,7 @@
android:name=".ui.AboutActivity"
android:excludeFromRecents="true"
android:label="@string/title_about"
- android:theme="@android:style/Theme.Dialog" />
+ android:theme="@style/Theme.Sherlock.Light.Dialog" />
<service android:name=".Service" />
<service
diff --git a/org_apg/res/drawable-hdpi/create_contact.png b/org_apg/res/drawable-hdpi/create_contact.png
new file mode 100644
index 000000000..7a29b65b1
--- /dev/null
+++ b/org_apg/res/drawable-hdpi/create_contact.png
Binary files differ
diff --git a/org_apg/res/drawable-hdpi/dashboard_decrypt_default.png b/org_apg/res/drawable-hdpi/dashboard_decrypt_default.png
new file mode 100644
index 000000000..0d51bcb68
--- /dev/null
+++ b/org_apg/res/drawable-hdpi/dashboard_decrypt_default.png
Binary files differ
diff --git a/org_apg/res/drawable-hdpi/dashboard_decrypt_pressed.png b/org_apg/res/drawable-hdpi/dashboard_decrypt_pressed.png
new file mode 100644
index 000000000..d4cc0f8ea
--- /dev/null
+++ b/org_apg/res/drawable-hdpi/dashboard_decrypt_pressed.png
Binary files differ
diff --git a/org_apg/res/drawable-hdpi/dashboard_encrypt_default.png b/org_apg/res/drawable-hdpi/dashboard_encrypt_default.png
new file mode 100644
index 000000000..07617bb9d
--- /dev/null
+++ b/org_apg/res/drawable-hdpi/dashboard_encrypt_default.png
Binary files differ
diff --git a/org_apg/res/drawable-hdpi/dashboard_encrypt_pressed.png b/org_apg/res/drawable-hdpi/dashboard_encrypt_pressed.png
new file mode 100644
index 000000000..b8fe6e1d6
--- /dev/null
+++ b/org_apg/res/drawable-hdpi/dashboard_encrypt_pressed.png
Binary files differ
diff --git a/org_apg/res/drawable-hdpi/dashboard_help_pressed.png b/org_apg/res/drawable-hdpi/dashboard_help_pressed.png
index 4a19c1472..dad8694f8 100644
--- a/org_apg/res/drawable-hdpi/dashboard_help_pressed.png
+++ b/org_apg/res/drawable-hdpi/dashboard_help_pressed.png
Binary files differ
diff --git a/org_apg/res/drawable-hdpi/dashboard_manage_keys_pressed.png b/org_apg/res/drawable-hdpi/dashboard_manage_keys_pressed.png
index b1514d9d4..a86bc1bf9 100644
--- a/org_apg/res/drawable-hdpi/dashboard_manage_keys_pressed.png
+++ b/org_apg/res/drawable-hdpi/dashboard_manage_keys_pressed.png
Binary files differ
diff --git a/org_apg/res/drawable-hdpi/dashboard_my_keys_pressed.png b/org_apg/res/drawable-hdpi/dashboard_my_keys_pressed.png
index e24f5c207..6a5c92138 100644
--- a/org_apg/res/drawable-hdpi/dashboard_my_keys_pressed.png
+++ b/org_apg/res/drawable-hdpi/dashboard_my_keys_pressed.png
Binary files differ
diff --git a/org_apg/res/drawable-hdpi/dashboard_scan_qrcode_default.png b/org_apg/res/drawable-hdpi/dashboard_scan_qrcode_default.png
new file mode 100644
index 000000000..65323e3d0
--- /dev/null
+++ b/org_apg/res/drawable-hdpi/dashboard_scan_qrcode_default.png
Binary files differ
diff --git a/org_apg/res/drawable-hdpi/dashboard_scan_qrcode_pressed.png b/org_apg/res/drawable-hdpi/dashboard_scan_qrcode_pressed.png
new file mode 100644
index 000000000..65323e3d0
--- /dev/null
+++ b/org_apg/res/drawable-hdpi/dashboard_scan_qrcode_pressed.png
Binary files differ
diff --git a/org_apg/res/drawable-hdpi/ic_menu_find_holo_light.png b/org_apg/res/drawable-hdpi/ic_menu_find_holo_light.png
new file mode 100644
index 000000000..efee6dfd2
--- /dev/null
+++ b/org_apg/res/drawable-hdpi/ic_menu_find_holo_light.png
Binary files differ
diff --git a/org_apg/res/drawable-hdpi/ic_menu_search_holo_light.png b/org_apg/res/drawable-hdpi/ic_menu_search_holo_light.png
new file mode 100644
index 000000000..1cb61faf4
--- /dev/null
+++ b/org_apg/res/drawable-hdpi/ic_menu_search_holo_light.png
Binary files differ
diff --git a/org_apg/res/drawable-hdpi/ic_menu_settings_holo_light.png b/org_apg/res/drawable-hdpi/ic_menu_settings_holo_light.png
new file mode 100644
index 000000000..577e05587
--- /dev/null
+++ b/org_apg/res/drawable-hdpi/ic_menu_settings_holo_light.png
Binary files differ
diff --git a/org_apg/res/drawable-hdpi/ic_menu_share_holo_light.png b/org_apg/res/drawable-hdpi/ic_menu_share_holo_light.png
new file mode 100644
index 000000000..682b2fdec
--- /dev/null
+++ b/org_apg/res/drawable-hdpi/ic_menu_share_holo_light.png
Binary files differ
diff --git a/org_apg/res/drawable-hdpi/ic_suggestions_add.png b/org_apg/res/drawable-hdpi/ic_suggestions_add.png
new file mode 100644
index 000000000..919872c1e
--- /dev/null
+++ b/org_apg/res/drawable-hdpi/ic_suggestions_add.png
Binary files differ
diff --git a/org_apg/res/drawable-hdpi/ic_suggestions_delete.png b/org_apg/res/drawable-hdpi/ic_suggestions_delete.png
new file mode 100644
index 000000000..fa42db094
--- /dev/null
+++ b/org_apg/res/drawable-hdpi/ic_suggestions_delete.png
Binary files differ
diff --git a/org_apg/res/drawable-mdpi/create_contact.png b/org_apg/res/drawable-mdpi/create_contact.png
new file mode 100644
index 000000000..5a9360b27
--- /dev/null
+++ b/org_apg/res/drawable-mdpi/create_contact.png
Binary files differ
diff --git a/org_apg/res/drawable-mdpi/ic_menu_find_holo_light.png b/org_apg/res/drawable-mdpi/ic_menu_find_holo_light.png
new file mode 100644
index 000000000..9033f1ec2
--- /dev/null
+++ b/org_apg/res/drawable-mdpi/ic_menu_find_holo_light.png
Binary files differ
diff --git a/org_apg/res/drawable-mdpi/ic_menu_search_holo_light.png b/org_apg/res/drawable-mdpi/ic_menu_search_holo_light.png
new file mode 100644
index 000000000..2369d03f3
--- /dev/null
+++ b/org_apg/res/drawable-mdpi/ic_menu_search_holo_light.png
Binary files differ
diff --git a/org_apg/res/drawable-mdpi/ic_menu_settings_holo_light.png b/org_apg/res/drawable-mdpi/ic_menu_settings_holo_light.png
new file mode 100644
index 000000000..f32a37e44
--- /dev/null
+++ b/org_apg/res/drawable-mdpi/ic_menu_settings_holo_light.png
Binary files differ
diff --git a/org_apg/res/drawable-mdpi/ic_menu_share_holo_light.png b/org_apg/res/drawable-mdpi/ic_menu_share_holo_light.png
new file mode 100644
index 000000000..70fe31aa2
--- /dev/null
+++ b/org_apg/res/drawable-mdpi/ic_menu_share_holo_light.png
Binary files differ
diff --git a/org_apg/res/drawable-mdpi/ic_suggestions_add.png b/org_apg/res/drawable-mdpi/ic_suggestions_add.png
new file mode 100644
index 000000000..e98bdf8f0
--- /dev/null
+++ b/org_apg/res/drawable-mdpi/ic_suggestions_add.png
Binary files differ
diff --git a/org_apg/res/drawable-mdpi/ic_suggestions_delete.png b/org_apg/res/drawable-mdpi/ic_suggestions_delete.png
new file mode 100644
index 000000000..78e6ec18e
--- /dev/null
+++ b/org_apg/res/drawable-mdpi/ic_suggestions_delete.png
Binary files differ
diff --git a/org_apg/res/drawable-xhdpi/create_contact.png b/org_apg/res/drawable-xhdpi/create_contact.png
new file mode 100644
index 000000000..c6d562255
--- /dev/null
+++ b/org_apg/res/drawable-xhdpi/create_contact.png
Binary files differ
diff --git a/org_apg/res/drawable-xhdpi/ic_menu_find_holo_light.png b/org_apg/res/drawable-xhdpi/ic_menu_find_holo_light.png
new file mode 100644
index 000000000..de20fa0e7
--- /dev/null
+++ b/org_apg/res/drawable-xhdpi/ic_menu_find_holo_light.png
Binary files differ
diff --git a/org_apg/res/drawable-xhdpi/ic_menu_search_holo_light.png b/org_apg/res/drawable-xhdpi/ic_menu_search_holo_light.png
new file mode 100644
index 000000000..578cb24eb
--- /dev/null
+++ b/org_apg/res/drawable-xhdpi/ic_menu_search_holo_light.png
Binary files differ
diff --git a/org_apg/res/drawable-xhdpi/ic_menu_settings_holo_light.png b/org_apg/res/drawable-xhdpi/ic_menu_settings_holo_light.png
new file mode 100644
index 000000000..aa33c3880
--- /dev/null
+++ b/org_apg/res/drawable-xhdpi/ic_menu_settings_holo_light.png
Binary files differ
diff --git a/org_apg/res/drawable-xhdpi/ic_menu_share_holo_light.png b/org_apg/res/drawable-xhdpi/ic_menu_share_holo_light.png
new file mode 100644
index 000000000..528e554ab
--- /dev/null
+++ b/org_apg/res/drawable-xhdpi/ic_menu_share_holo_light.png
Binary files differ
diff --git a/org_apg/res/drawable-xhdpi/ic_suggestions_add.png b/org_apg/res/drawable-xhdpi/ic_suggestions_add.png
new file mode 100644
index 000000000..b1edef7ea
--- /dev/null
+++ b/org_apg/res/drawable-xhdpi/ic_suggestions_add.png
Binary files differ
diff --git a/org_apg/res/drawable-xhdpi/ic_suggestions_delete.png b/org_apg/res/drawable-xhdpi/ic_suggestions_delete.png
new file mode 100644
index 000000000..6b1f44754
--- /dev/null
+++ b/org_apg/res/drawable-xhdpi/ic_suggestions_delete.png
Binary files differ
diff --git a/org_apg/res/drawable/dashboard_encrypt_decrypt_file.xml b/org_apg/res/drawable/dashboard_decrypt.xml
index cd49de477..981e38a0b 100644
--- a/org_apg/res/drawable/dashboard_encrypt_decrypt_file.xml
+++ b/org_apg/res/drawable/dashboard_decrypt.xml
@@ -14,15 +14,15 @@
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:drawable="@drawable/dashboard_encrypt_decrypt_file_pressed"
+ <item android:drawable="@drawable/dashboard_decrypt_pressed"
android:state_focused="true"
android:state_pressed="true" />
- <item android:drawable="@drawable/dashboard_encrypt_decrypt_file_pressed"
+ <item android:drawable="@drawable/dashboard_decrypt_pressed"
android:state_focused="false"
android:state_pressed="true" />
- <item android:drawable="@drawable/dashboard_encrypt_decrypt_file_pressed"
+ <item android:drawable="@drawable/dashboard_decrypt_pressed"
android:state_focused="true" />
- <item android:drawable="@drawable/dashboard_encrypt_decrypt_file_default"
+ <item android:drawable="@drawable/dashboard_decrypt_default"
android:state_focused="false"
android:state_pressed="false" />
</selector>
diff --git a/org_apg/res/drawable/dashboard_encrypt_decrypt_text.xml b/org_apg/res/drawable/dashboard_encrypt.xml
index 61c0ebc89..af812dc51 100644
--- a/org_apg/res/drawable/dashboard_encrypt_decrypt_text.xml
+++ b/org_apg/res/drawable/dashboard_encrypt.xml
@@ -14,15 +14,15 @@
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:drawable="@drawable/dashboard_encrypt_decrypt_text_pressed"
+ <item android:drawable="@drawable/dashboard_encrypt_pressed"
android:state_focused="true"
android:state_pressed="true" />
- <item android:drawable="@drawable/dashboard_encrypt_decrypt_text_pressed"
+ <item android:drawable="@drawable/dashboard_encrypt_pressed"
android:state_focused="false"
android:state_pressed="true" />
- <item android:drawable="@drawable/dashboard_encrypt_decrypt_text_pressed"
+ <item android:drawable="@drawable/dashboard_encrypt_pressed"
android:state_focused="true" />
- <item android:drawable="@drawable/dashboard_encrypt_decrypt_text_default"
+ <item android:drawable="@drawable/dashboard_encrypt_default"
android:state_focused="false"
android:state_pressed="false" />
</selector>
diff --git a/org_apg/res/drawable/dashboard_scan_qrcode.xml b/org_apg/res/drawable/dashboard_scan_qrcode.xml
new file mode 100644
index 000000000..400994820
--- /dev/null
+++ b/org_apg/res/drawable/dashboard_scan_qrcode.xml
@@ -0,0 +1,28 @@
+<!--
+ Copyright 2011 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/dashboard_scan_qrcode_pressed"
+ android:state_focused="true"
+ android:state_pressed="true" />
+ <item android:drawable="@drawable/dashboard_scan_qrcode_pressed"
+ android:state_focused="false"
+ android:state_pressed="true" />
+ <item android:drawable="@drawable/dashboard_scan_qrcode_pressed"
+ android:state_focused="true" />
+ <item android:drawable="@drawable/dashboard_scan_qrcode_default"
+ android:state_focused="false"
+ android:state_pressed="false" />
+</selector>
diff --git a/org_apg/res/layout/about_activity.xml b/org_apg/res/layout/about_activity.xml
index a85439ee1..c523f3e76 100644
--- a/org_apg/res/layout/about_activity.xml
+++ b/org_apg/res/layout/about_activity.xml
@@ -8,9 +8,7 @@
android:layout_height="wrap_content"
android:isScrollContainer="true"
android:orientation="vertical"
- android:paddingBottom="15dp"
- android:paddingLeft="15dp"
- android:paddingRight="15dp"
+ android:padding="15dp"
android:scrollbars="vertical" >
<LinearLayout
diff --git a/org_apg/res/layout/encrypt.xml b/org_apg/res/layout/encrypt.xml
index 68808c8bf..0862e4475 100644
--- a/org_apg/res/layout/encrypt.xml
+++ b/org_apg/res/layout/encrypt.xml
@@ -1,382 +1,348 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 Thialfihar <thi@thialfihar.org>
+<!-- Copyright (C) 2010 Thialfihar <thi@thialfihar.org> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
- android:paddingTop="5dip">
+ android:paddingTop="5dip" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
- android:fillViewport="true">
+ android:fillViewport="true"
+ android:padding="10dip" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
- android:orientation="vertical"
- android:layout_marginLeft="5dip">
+ android:layout_marginLeft="5dip"
+ android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal">
+ android:orientation="horizontal" >
<ImageView
android:id="@+id/sourcePrevious"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:src="@drawable/ic_previous"/>
+ android:src="@drawable/ic_previous" />
<TextView
android:id="@+id/sourceLabel"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
- android:text="@string/label_message"
- android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="center_horizontal|center_vertical"
- android:textColor="#ffffffff"/>
+ android:text="@string/label_message"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
<ImageView
android:id="@+id/sourceNext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:src="@drawable/ic_next"/>
-
+ android:src="@drawable/ic_next" />
</LinearLayout>
<ViewFlipper
android:id="@+id/source"
android:layout_width="fill_parent"
android:layout_height="0dip"
- android:layout_weight="1">
+ android:layout_weight="1" >
<LinearLayout
android:id="@+id/sourceMessage"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
- android:orientation="vertical">
+ android:orientation="vertical" >
<EditText
android:id="@+id/message"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="top"
- android:inputType="text|textCapSentences|textMultiLine|textLongMessage"/>
-
+ android:inputType="text|textCapSentences|textMultiLine|textLongMessage" />
</LinearLayout>
<LinearLayout
android:id="@+id/sourceFile"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
- android:orientation="vertical">
+ android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal">
+ android:orientation="horizontal" >
<EditText
android:id="@+id/filename"
android:layout_width="0dip"
android:layout_height="wrap_content"
- android:layout_weight="1"/>
+ android:layout_weight="1" />
<ImageButton
android:id="@+id/btn_browse"
- android:src="@drawable/ic_launcher_folder_small"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_width="wrap_content"/>
-
+ android:src="@drawable/ic_launcher_folder_small" />
</LinearLayout>
<LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
-
- <TextView
- android:id="@+id/label_fileCompression"
- android:text="@string/label_fileCompression"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:layout_height="wrap_content"
- android:layout_width="0dip"
- android:layout_weight="1"
- android:layout_gravity="center_vertical"
- android:paddingRight="10dip"/>
-
- <Spinner
- android:id="@+id/fileCompression"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"/>
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal" >
+
+ <TextView
+ android:id="@+id/label_fileCompression"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:layout_weight="1"
+ android:paddingRight="10dip"
+ android:text="@string/label_fileCompression"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
+ <Spinner
+ android:id="@+id/fileCompression"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal">
+ android:orientation="horizontal" >
<TextView
android:id="@+id/label_deleteAfterEncryption"
- android:text="@string/label_deleteAfterEncryption"
- android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
+ android:layout_weight="1"
android:paddingRight="10dip"
- android:layout_height="wrap_content"
- android:layout_width="0dip"
- android:layout_weight="1"/>
+ android:text="@string/label_deleteAfterEncryption"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/deleteAfterEncryption"
- android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:layout_gravity="center_vertical"/>
-
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal">
+ android:orientation="horizontal" >
<TextView
android:id="@+id/label_asciiArmour"
- android:text="@string/label_asciiArmour"
- android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
+ android:layout_weight="1"
android:paddingRight="10dip"
- android:layout_height="wrap_content"
- android:layout_width="0dip"
- android:layout_weight="1"/>
+ android:text="@string/label_asciiArmour"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/asciiArmour"
- android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:layout_gravity="center_vertical"/>
-
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical" />
</LinearLayout>
-
</LinearLayout>
-
</ViewFlipper>
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
- android:background="?android:attr/listDivider"
- android:layout_marginBottom="5dip"/>
+ android:layout_marginBottom="5dip"
+ android:background="?android:attr/listDivider" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal">
+ android:orientation="horizontal" >
<ImageView
android:id="@+id/modePrevious"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:src="@drawable/ic_previous"/>
+ android:src="@drawable/ic_previous" />
<TextView
android:id="@+id/modeLabel"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
- android:text="@string/label_asymmetric"
- android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="center_horizontal|center_vertical"
- android:textColor="#ffffffff"/>
+ android:text="@string/label_asymmetric"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
<ImageView
android:id="@+id/modeNext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:src="@drawable/ic_next"/>
-
+ android:src="@drawable/ic_next" />
</LinearLayout>
<ViewFlipper
android:id="@+id/mode"
android:layout_width="fill_parent"
- android:layout_height="wrap_content">
+ android:layout_height="wrap_content" >
<LinearLayout
android:id="@+id/modeAsymmetric"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:orientation="vertical">
+ android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal">
+ android:orientation="horizontal" >
<TextView
android:id="@+id/label_sign"
- android:text="@string/label_sign"
- android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="0dip"
- android:layout_weight="1"
android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"/>
+ android:layout_gravity="center_vertical"
+ android:layout_weight="1"
+ android:text="@string/label_sign"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
<LinearLayout
- android:orientation="vertical"
- android:layout_height="wrap_content"
android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
- android:paddingRight="5dip">
+ android:orientation="vertical"
+ android:paddingRight="5dip" >
<TextView
android:id="@+id/mainUserId"
- android:text="Main User Id"
- android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="right"/>
+ android:layout_gravity="right"
+ android:text="Main User Id"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/mainUserIdRest"
- android:text="Main User Id Rest"
- android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="right"/>
-
+ android:layout_gravity="right"
+ android:text="Main User Id Rest"
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<CheckBox
android:id="@+id/sign"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"/>
-
+ android:layout_gravity="center_vertical" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:paddingBottom="3dip"
- android:orientation="horizontal">
+ android:orientation="horizontal"
+ android:paddingBottom="3dip" >
<TextView
android:id="@+id/label_selectPublicKeys"
- android:text="@string/label_selectPublicKeys"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:layout_height="wrap_content"
android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
android:layout_weight="1"
- android:layout_gravity="center_vertical"/>
+ android:text="@string/label_selectPublicKeys"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
<Button
- android:text="@string/btn_selectEncryptKeys"
android:id="@+id/btn_selectEncryptKeys"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"/>
-
+ android:layout_gravity="center_vertical"
+ android:text="@string/btn_selectEncryptKeys" />
</LinearLayout>
</LinearLayout>
<TableLayout
android:id="@+id/modeSymmetric"
- android:layout_height="wrap_content"
android:layout_width="fill_parent"
- android:stretchColumns="1">
+ android:layout_height="wrap_content"
+ android:stretchColumns="1" >
<TableRow>
<TextView
android:id="@+id/label_passPhrase"
- android:text="@string/label_passPhrase"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:layout_height="wrap_content"
android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
- android:paddingRight="10dip"/>
+ android:paddingRight="10dip"
+ android:text="@string/label_passPhrase"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/passPhrase"
- android:layout_height="wrap_content"
android:layout_width="fill_parent"
- android:inputType="textPassword"/>
-
+ android:layout_height="wrap_content"
+ android:inputType="textPassword" />
</TableRow>
<TableRow>
<TextView
android:id="@+id/label_passPhraseAgain"
- android:text="@string/label_passPhraseAgain"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:layout_height="wrap_content"
android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
- android:paddingRight="10dip"/>
+ android:paddingRight="10dip"
+ android:text="@string/label_passPhraseAgain"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/passPhraseAgain"
- android:layout_height="wrap_content"
android:layout_width="fill_parent"
- android:inputType="textPassword"/>
-
+ android:layout_height="wrap_content"
+ android:inputType="textPassword" />
</TableRow>
-
</TableLayout>
-
</ViewFlipper>
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
- android:background="?android:attr/listDivider"
- android:layout_marginBottom="5dip"/>
-
+ android:layout_marginBottom="5dip"
+ android:background="?android:attr/listDivider" />
</LinearLayout>
-
</ScrollView>
<LinearLayout
- android:orientation="horizontal"
+ style="@android:style/ButtonBar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- style="@android:style/ButtonBar">
+ android:orientation="horizontal" >
<Button
android:id="@+id/btn_encryptToClipboard"
- android:text="@string/btn_encryptToClipboard"
- android:layout_weight="1"
android:layout_width="0dip"
- android:layout_height="fill_parent"/>
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
+ android:text="@string/btn_encryptToClipboard" />
<Button
android:id="@+id/btn_encrypt"
- android:text="@string/btn_encrypt"
- android:layout_weight="1"
android:layout_width="0dip"
- android:layout_height="fill_parent"/>
-
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
+ android:text="@string/btn_encrypt" />
</LinearLayout>
-</LinearLayout>
+</LinearLayout> \ No newline at end of file
diff --git a/org_apg/res/layout/main.xml b/org_apg/res/layout/main.xml
index 86a582b7c..6f0a66a71 100644
--- a/org_apg/res/layout/main.xml
+++ b/org_apg/res/layout/main.xml
@@ -39,18 +39,26 @@
android:text="@string/dashboard_my_keys" />
<Button
- android:id="@+id/dashboard_encrypt_decrypt_file"
+ android:id="@+id/dashboard_encrypt"
style="@style/DashboardButton"
- android:drawableTop="@drawable/dashboard_encrypt_decrypt_file"
- android:onClick="encryptDecryptFileOnClick"
- android:text="@string/dashboard_encrypt_decrypt_file" />
+ android:drawableTop="@drawable/dashboard_encrypt"
+ android:onClick="encryptOnClick"
+ android:text="@string/dashboard_encrypt" />
<Button
- android:id="@+id/dashboard_encrypt_decrypt_text"
+ android:id="@+id/dashboard_decrypt"
style="@style/DashboardButton"
- android:drawableTop="@drawable/dashboard_encrypt_decrypt_text"
- android:onClick="encryptDecryptTextOnClick"
- android:text="@string/dashboard_encrypt_decrypt_text" />
+ android:drawableTop="@drawable/dashboard_decrypt"
+ android:onClick="decryptOnClick"
+ android:text="@string/dashboard_decrypt" />
+
+
+ <Button
+ android:id="@+id/dashboard_scan_qrcode"
+ style="@style/DashboardButton"
+ android:drawableTop="@drawable/dashboard_scan_qrcode"
+ android:onClick="scanQrcodeOnClick"
+ android:text="@string/dashboard_scan_qrcode" />
<Button
android:id="@+id/dashboard_help"
diff --git a/org_apg/res/values/arrays.xml b/org_apg/res/values/arrays.xml
index 25a4e66df..05320c609 100644
--- a/org_apg/res/values/arrays.xml
+++ b/org_apg/res/values/arrays.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 Thialfihar <thi@thialfihar.org>
+<!--
+ Copyright (C) 2010 Thialfihar <thi@thialfihar.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -29,7 +30,6 @@
<item>@string/choice_4hours</item>
<item>@string/choice_8hours</item>
</string-array>
-
<string-array name="pass_phrase_cache_ttl_values">
<item>15</item>
<item>60</item>
@@ -44,171 +44,4 @@
<item>28800</item>
</string-array>
- <string-array name="language_entries">
- <item>@string/choice_language_system</item>
- <item>Afrikaans</item>
- <item>Bahasa indonesia</item>
- <item>Bahasa melayu</item>
- <item>Bamanankan</item>
- <item>Català</item>
- <item>Cymraeg</item>
- <item>Dansk</item>
- <item>Deutsch</item>
- <item>Dholuo</item>
- <item>Eesti</item>
- <item>English</item>
- <item>Español</item>
- <item>Fulfulde, Pulaar, Pular</item>
- <item>Gaeilge</item>
- <item>Galego</item>
- <item>Hausa</item>
- <item>Hrvatski</item>
- <item>Kinyarwanda</item>
- <item>Kirundi</item>
- <item>Kiswahili</item>
- <item>Latviešu</item>
- <item>Lietuviškai</item>
- <item>Magyar</item>
- <item>Malti</item>
- <item>Nederlands</item>
- <item>Norsk bokmål</item>
- <item>Pyccĸий</item>
- <item>Română</item>
- <item>Slovenčina</item>
- <item>Slovenščina</item>
- <item>Somali</item>
- <item>Српски</item>
- <item>Tiếng Việt</item>
- <item>Tϋrkçe</item>
- <item>Wolof</item>
- <item>Yorùbá</item>
- <item>Azərbaycan</item>
- <item>Euskera</item>
- <item>Français</item>
- <item>isiXhosa</item>
- <item>isiZulu</item>
- <item>Italiano</item>
- <item>O\'zbek</item>
- <item>Polski</item>
- <item>Português</item>
- <item>Shqip</item>
- <item>Suomi</item>
- <item>Svenska</item>
- <item>Íslenska</item>
- <item>Čeština</item>
- <item>Ɛʋɛ</item>
- <item>Ελληνικά</item>
- <item>Беларуская</item>
- <item>Български</item>
- <item>Кыргыз</item>
- <item>Македонски</item>
- <item>Українська</item>
- <item>аҧсуа бызшәа</item>
- <item>Қазақ</item>
- <item>Հայերեն</item>
- <item>עברית</item>
- <item>اردو</item>
- <item>العربية</item>
- <item>فارسی</item>
- <item>پښتو</item>
- <item>हिंदी</item>
- <item>తెలుగు</item>
- <item>ಕನ್ನಡ</item>
- <item>ภาษาไทย</item>
- <item>አማርኛ</item>
- <item>中文</item>
- <item>日本語</item>
- <item>한국어</item>
- </string-array>
-
- <string-array name="language_values">
- <item></item>
- <item>af</item>
- <item>id</item>
- <item>ms</item>
- <item>bm</item>
- <item>ca</item>
- <item>cy</item>
- <item>da</item>
- <item>de</item>
- <item>luo</item>
- <item>et</item>
- <item>en</item>
- <item>es</item>
- <item>ff</item>
- <item>ga</item>
- <item>gl</item>
- <item>ha</item>
- <item>hr</item>
- <item>rw</item>
- <item>rn</item>
- <item>sw</item>
- <item>lv</item>
- <item>lt</item>
- <item>hu</item>
- <item>mt</item>
- <item>nl</item>
- <item>no</item>
- <item>ru</item>
- <item>ro</item>
- <item>sk</item>
- <item>sl</item>
- <item>so</item>
- <item>sr</item>
- <item>vi</item>
- <item>tr</item>
- <item>wo</item>
- <item>yo</item>
- <item>az</item>
- <item>eu</item>
- <item>fr</item>
- <item>xs</item>
- <item>zu</item>
- <item>it</item>
- <item>uz</item>
- <item>pl</item>
- <item>pt</item>
- <item>sq</item>
- <item>fi</item>
- <item>sv</item>
- <item>is</item>
- <item>cs</item>
- <item>ee</item>
- <item>el</item>
- <item>be</item>
- <item>bg</item>
- <item>ky</item>
- <item>mk</item>
- <item>uk</item>
- <item>ab</item>
- <item>kk</item>
- <item>hy</item>
- <item>he</item>
- <item>ur</item>
- <item>ar</item>
- <item>fa</item>
- <item>ps</item>
- <item>hi</item>
- <item>te</item>
- <item>kn</item>
- <item>th</item>
- <item>am</item>
- <item>zh</item>
- <item>ja</item>
- <item>ko</item>
- </string-array>
-
- <string-array name="supported_languages">
- <item></item>
- <item>da</item>
- <item>de</item>
- <item>en</item>
- <item>es</item>
- <item>it</item>
- <item>no</item>
- <item>pt</item>
- <item>sl</item>
- <item>zh</item>
- </string-array>
-
-</resources>
+</resources> \ No newline at end of file
diff --git a/org_apg/res/values/strings.xml b/org_apg/res/values/strings.xml
index 23574f808..aa0a99a30 100644
--- a/org_apg/res/values/strings.xml
+++ b/org_apg/res/values/strings.xml
@@ -86,7 +86,7 @@
<string name="menu_manageSecretKeys">Manage Secret Keys</string>
<string name="menu_preferences">Settings</string>
<string name="menu_importKeys">Import Keys</string>
- <string name="menu_exportKeys">Export Keys</string>
+ <string name="menu_exportKeys">Export All Keys</string>
<string name="menu_exportKey">Export Key</string>
<string name="menu_deleteKey">Delete Key</string>
<string name="menu_createKey">Create Key</string>
@@ -119,7 +119,6 @@
<string name="label_passPhraseCacheTtl">Pass Phrase Cache</string>
<string name="label_messageCompression">Message Compression</string>
<string name="label_fileCompression">File Compression</string>
- <string name="label_language">Language</string>
<string name="label_forceV3Signature">Force V3 Signatures</string>
<string name="label_keyServers">Key Servers</string>
<string name="label_keyId">Key ID</string>
@@ -323,16 +322,17 @@
<!-- about -->
- <string name="about_description">Android Privacy Guard (APG) is a OpenPGP implementation for Android.</string>
+ <string name="about_description">Android Privacy Guard (APG) is a OpenPGP implementation for Android.\n\nAPG+ is a fork based on the original APG to introduce more features and a new user interface.</string>
<string name="about_license">License: Apache License 2.0</string>
<string name="about_version">Version:</string>
- <string name="about_developer">Developer: Thialfihar (Main developer), Senecaso (QRCode, send key, sign key), Markus Doits (AIDL), Oliver Runge, Dominik Schürmann</string>
+ <string name="about_developer">Developer: Thialfihar (Main developer), Senecaso (QRCode, sign key, upload key), Markus Doits (AIDL), Oliver Runge, Dominik Schürmann (APG+ fork)</string>
<!-- Dashboard -->
<string name="dashboard_manage_keys">Manage Keys</string>
<string name="dashboard_my_keys">My Keys</string>
- <string name="dashboard_encrypt_decrypt_file">Encrypt/Decrypt File</string>
- <string name="dashboard_encrypt_decrypt_text">Encrypt/Decrypt Text</string>
+ <string name="dashboard_encrypt">Encrypt</string>
+ <string name="dashboard_decrypt">Decrypt</string>
<string name="dashboard_help">Help</string>
+ <string name="dashboard_scan_qrcode">Scan QRCode</string>
</resources> \ No newline at end of file
diff --git a/org_apg/res/xml/apg_preferences.xml b/org_apg/res/xml/apg_preferences.xml
index 7c0dd2206..f32c2d73f 100644
--- a/org_apg/res/xml/apg_preferences.xml
+++ b/org_apg/res/xml/apg_preferences.xml
@@ -18,13 +18,6 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
<PreferenceCategory android:title="@string/section_general" >
- <ListPreference
- android:dialogTitle="@string/label_language"
- android:entries="@array/language_entries"
- android:entryValues="@array/language_values"
- android:key="language"
- android:title="@string/label_language" />
-
<org.apg.ui.widget.IntegerListPreference
android:entries="@array/pass_phrase_cache_ttl_entries"
android:entryValues="@array/pass_phrase_cache_ttl_values"
diff --git a/org_apg/src/org/apg/Id.java b/org_apg/src/org/apg/Id.java
index adcad0534..7f5a30a45 100644
--- a/org_apg/src/org/apg/Id.java
+++ b/org_apg/src/org/apg/Id.java
@@ -44,6 +44,10 @@ public final class Id {
public static final int help = 0x21070010;
public static final int key_server = 0x21070011;
public static final int scanQRCode = 0x21070012;
+ public static final int encrypt = 0x21070013;
+ public static final int decrypt = 0x21070014;
+ public static final int encrypt_ = 0x21070015;
+
}
}
diff --git a/org_apg/src/org/apg/ui/BaseActivity.java b/org_apg/src/org/apg/ui/BaseActivity.java
index 2cb04effb..3f0f7a027 100644
--- a/org_apg/src/org/apg/ui/BaseActivity.java
+++ b/org_apg/src/org/apg/ui/BaseActivity.java
@@ -31,6 +31,7 @@ import org.apg.ProgressDialogUpdater;
import org.apg.Service;
import org.apg.R;
+import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
@@ -75,8 +76,11 @@ public class BaseActivity extends SherlockActivity implements Runnable, Progress
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ final ActionBar actionBar = getSupportActionBar();
+ actionBar.setDisplayShowTitleEnabled(true);
+ actionBar.setDisplayHomeAsUpEnabled(true);
+
mPreferences = Preferences.getPreferences(this);
- setLanguage(this, mPreferences.getLanguage());
Apg.initialize(this);
@@ -98,35 +102,21 @@ public class BaseActivity extends SherlockActivity implements Runnable, Progress
}
@Override
- public boolean onCreateOptionsMenu(Menu menu) {
- menu.add(0, Id.menu.option.preferences, 0, R.string.menu_preferences).setIcon(
- android.R.drawable.ic_menu_preferences);
- menu.add(0, Id.menu.option.about, 1, R.string.menu_about).setIcon(
- android.R.drawable.ic_menu_info_details);
- return true;
- }
-
- @Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
- case Id.menu.option.about: {
- startActivity(new Intent(this, AboutActivity.class));
- return true;
- }
- case Id.menu.option.preferences: {
- startActivity(new Intent(this, PreferencesActivity.class));
+ case android.R.id.home:
+ startActivity(new Intent(this, MainActivity.class));
return true;
- }
- case Id.menu.option.search: {
+ // TODO: needed?:
+ case Id.menu.option.search:
startSearch("", false, null, false);
return true;
- }
- default: {
+ default:
break;
- }
+
}
return false;
}
@@ -422,17 +412,4 @@ public class BaseActivity extends SherlockActivity implements Runnable, Progress
protected String getDeleteFile() {
return mDeleteFile;
}
-
- public static void setLanguage(Context context, String language) {
- Locale locale;
- if (language == null || language.equals("")) {
- locale = Locale.getDefault();
- } else {
- locale = new Locale(language);
- }
- Configuration config = new Configuration();
- config.locale = locale;
- context.getResources().updateConfiguration(config,
- context.getResources().getDisplayMetrics());
- }
}
diff --git a/org_apg/src/org/apg/ui/EncryptActivity.java b/org_apg/src/org/apg/ui/EncryptActivity.java
index e5892a4d5..8e19e09a1 100644
--- a/org_apg/src/org/apg/ui/EncryptActivity.java
+++ b/org_apg/src/org/apg/ui/EncryptActivity.java
@@ -33,6 +33,9 @@ import org.spongycastle.openpgp.PGPSecretKey;
import org.spongycastle.openpgp.PGPSecretKeyRing;
import org.apg.R;
+import com.actionbarsherlock.view.Menu;
+import com.actionbarsherlock.view.MenuItem;
+
import android.app.Dialog;
import android.content.ActivityNotFoundException;
import android.content.Intent;
@@ -114,6 +117,36 @@ public class EncryptActivity extends BaseActivity {
private boolean mGenerateSignature = false;
@Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ menu.add(1, Id.menu.option.encrypt, 0, R.string.btn_encrypt)
+ .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
+
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case Id.menu.option.key_server: {
+ startActivity(new Intent(this, KeyServerQueryActivity.class));
+
+ return true;
+ }
+ case Id.menu.option.scanQRCode: {
+ Intent intent = new Intent(this, ImportFromQRCodeActivity.class);
+ intent.setAction(Apg.Intent.IMPORT_FROM_QR_CODE);
+ startActivityForResult(intent, Id.request.import_from_qr_code);
+
+ return true;
+ }
+
+ default: {
+ return super.onOptionsItemSelected(item);
+ }
+ }
+ }
+
+ @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.encrypt);
diff --git a/org_apg/src/org/apg/ui/MailListActivity.java b/org_apg/src/org/apg/ui/MailListActivity.java
index ad1d08068..aee0d2967 100644
--- a/org_apg/src/org/apg/ui/MailListActivity.java
+++ b/org_apg/src/org/apg/ui/MailListActivity.java
@@ -87,7 +87,6 @@ public class MailListActivity extends ListActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
Preferences prefs = Preferences.getPreferences(this);
- BaseActivity.setLanguage(this, prefs.getLanguage());
super.onCreate(savedInstanceState);
diff --git a/org_apg/src/org/apg/ui/MainActivity.java b/org_apg/src/org/apg/ui/MainActivity.java
index 31088cb26..c009b36dd 100644
--- a/org_apg/src/org/apg/ui/MainActivity.java
+++ b/org_apg/src/org/apg/ui/MainActivity.java
@@ -25,6 +25,7 @@ import org.apg.Id;
import org.spongycastle.jce.provider.BouncyCastleProvider;
import org.apg.R;
+import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
@@ -60,20 +61,22 @@ public class MainActivity extends BaseActivity {
}
- public void encryptDecryptFileOnClick(View view) {
+ public void encryptOnClick(View view) {
Intent intent = new Intent(MainActivity.this, EncryptActivity.class);
- intent.setAction(Apg.Intent.ENCRYPT_FILE);
+ intent.setAction(Apg.Intent.ENCRYPT);
startActivity(intent);
-
- // intent.setAction(Apg.Intent.DECRYPT_FILE);
}
- public void encryptDecryptTextOnClick(View view) {
+ public void decryptOnClick(View view) {
Intent intent = new Intent(MainActivity.this, EncryptActivity.class);
- intent.setAction(Apg.Intent.ENCRYPT);
+ intent.setAction(Apg.Intent.DECRYPT);
startActivity(intent);
+ }
- // intent.setAction(Apg.Intent.DECRYPT);
+ public void scanQrcodeOnClick(View view) {
+ Intent intent = new Intent(this, ImportFromQRCodeActivity.class);
+ intent.setAction(Apg.Intent.IMPORT_FROM_QR_CODE);
+ startActivityForResult(intent, Id.request.import_from_qr_code);
}
public void helpOnClick(View view) {
@@ -85,88 +88,92 @@ public class MainActivity extends BaseActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
-// if (!mPreferences.hasSeenHelp()) {
-// showDialog(Id.dialog.help);
-// }
-//
-// if (Apg.isReleaseVersion(this) && !mPreferences.hasSeenChangeLog(Apg.getVersion(this))) {
-// showDialog(Id.dialog.change_log);
-// }
+ final ActionBar actionBar = getSupportActionBar();
+ actionBar.setDisplayShowTitleEnabled(true);
+ actionBar.setDisplayHomeAsUpEnabled(false);
+
+ // if (!mPreferences.hasSeenHelp()) {
+ // showDialog(Id.dialog.help);
+ // }
+ //
+ // if (Apg.isReleaseVersion(this) && !mPreferences.hasSeenChangeLog(Apg.getVersion(this))) {
+ // showDialog(Id.dialog.change_log);
+ // }
}
@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
-// case Id.dialog.change_log: {
-// AlertDialog.Builder alert = new AlertDialog.Builder(this);
-//
-// alert.setTitle("Changes " + Apg.getFullVersion(this));
-// LayoutInflater inflater = (LayoutInflater) this
-// .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-// View layout = inflater.inflate(R.layout.info, null);
-// TextView message = (TextView) layout.findViewById(R.id.message);
-//
-// message.setText("Changes:\n" + "* \n" + "\n"
-// + "WARNING: be careful editing your existing keys, as they "
-// + "WILL be stripped of certificates right now.\n" + "\n"
-// + "Also: key cross-certification is NOT supported, so signing "
-// + "with those keys will get a warning when the signature is " + "checked.\n"
-// + "\n" + "I hope APG continues to be useful to you, please send "
-// + "bug reports, feature wishes, feedback.");
-// alert.setView(layout);
-//
-// alert.setCancelable(false);
-// alert.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
-// public void onClick(DialogInterface dialog, int id) {
-// MainActivity.this.removeDialog(Id.dialog.change_log);
-// mPreferences.setHasSeenChangeLog(Apg.getVersion(MainActivity.this), true);
-// }
-// });
-//
-// return alert.create();
-// }
-
-// case Id.dialog.help: {
-// AlertDialog.Builder alert = new AlertDialog.Builder(this);
-//
-// alert.setTitle(R.string.title_help);
-//
-// LayoutInflater inflater = (LayoutInflater) this
-// .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-// View layout = inflater.inflate(R.layout.info, null);
-// TextView message = (TextView) layout.findViewById(R.id.message);
-// message.setText(R.string.text_help);
-//
-// TransformFilter packageNames = new TransformFilter() {
-// public final String transformUrl(final Matcher match, String url) {
-// String name = match.group(1).toLowerCase();
-// if (name.equals("astro")) {
-// return "com.metago.astro";
-// } else if (name.equals("k-9 mail")) {
-// return "com.fsck.k9";
-// } else {
-// return "org.openintents.filemanager";
-// }
-// }
-// };
-//
-// Pattern pattern = Pattern.compile("(OI File Manager|ASTRO|K-9 Mail)");
-// String scheme = "market://search?q=pname:";
-// message.setAutoLinkMask(0);
-// Linkify.addLinks(message, pattern, scheme, null, packageNames);
-//
-// alert.setView(layout);
-//
-// alert.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
-// public void onClick(DialogInterface dialog, int id) {
-// MainActivity.this.removeDialog(Id.dialog.help);
-// mPreferences.setHasSeenHelp(true);
-// }
-// });
-//
-// return alert.create();
-// }
+ // case Id.dialog.change_log: {
+ // AlertDialog.Builder alert = new AlertDialog.Builder(this);
+ //
+ // alert.setTitle("Changes " + Apg.getFullVersion(this));
+ // LayoutInflater inflater = (LayoutInflater) this
+ // .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ // View layout = inflater.inflate(R.layout.info, null);
+ // TextView message = (TextView) layout.findViewById(R.id.message);
+ //
+ // message.setText("Changes:\n" + "* \n" + "\n"
+ // + "WARNING: be careful editing your existing keys, as they "
+ // + "WILL be stripped of certificates right now.\n" + "\n"
+ // + "Also: key cross-certification is NOT supported, so signing "
+ // + "with those keys will get a warning when the signature is " + "checked.\n"
+ // + "\n" + "I hope APG continues to be useful to you, please send "
+ // + "bug reports, feature wishes, feedback.");
+ // alert.setView(layout);
+ //
+ // alert.setCancelable(false);
+ // alert.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
+ // public void onClick(DialogInterface dialog, int id) {
+ // MainActivity.this.removeDialog(Id.dialog.change_log);
+ // mPreferences.setHasSeenChangeLog(Apg.getVersion(MainActivity.this), true);
+ // }
+ // });
+ //
+ // return alert.create();
+ // }
+
+ // case Id.dialog.help: {
+ // AlertDialog.Builder alert = new AlertDialog.Builder(this);
+ //
+ // alert.setTitle(R.string.title_help);
+ //
+ // LayoutInflater inflater = (LayoutInflater) this
+ // .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ // View layout = inflater.inflate(R.layout.info, null);
+ // TextView message = (TextView) layout.findViewById(R.id.message);
+ // message.setText(R.string.text_help);
+ //
+ // TransformFilter packageNames = new TransformFilter() {
+ // public final String transformUrl(final Matcher match, String url) {
+ // String name = match.group(1).toLowerCase();
+ // if (name.equals("astro")) {
+ // return "com.metago.astro";
+ // } else if (name.equals("k-9 mail")) {
+ // return "com.fsck.k9";
+ // } else {
+ // return "org.openintents.filemanager";
+ // }
+ // }
+ // };
+ //
+ // Pattern pattern = Pattern.compile("(OI File Manager|ASTRO|K-9 Mail)");
+ // String scheme = "market://search?q=pname:";
+ // message.setAutoLinkMask(0);
+ // Linkify.addLinks(message, pattern, scheme, null, packageNames);
+ //
+ // alert.setView(layout);
+ //
+ // alert.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
+ // public void onClick(DialogInterface dialog, int id) {
+ // MainActivity.this.removeDialog(Id.dialog.help);
+ // mPreferences.setHasSeenHelp(true);
+ // }
+ // });
+ //
+ // return alert.create();
+ // }
default: {
return super.onCreateDialog(id);
@@ -176,55 +183,81 @@ public class MainActivity extends BaseActivity {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
- menu.add(0, Id.menu.option.manage_public_keys, 0, R.string.menu_managePublicKeys).setIcon(
- android.R.drawable.ic_menu_manage);
- menu.add(0, Id.menu.option.manage_secret_keys, 1, R.string.menu_manageSecretKeys).setIcon(
- android.R.drawable.ic_menu_manage);
- menu.add(2, Id.menu.option.preferences, 3, R.string.menu_preferences).setIcon(
- android.R.drawable.ic_menu_preferences);
- menu.add(2, Id.menu.option.key_server, 4, R.string.menu_keyServer).setIcon(
- android.R.drawable.ic_menu_search);
- menu.add(3, Id.menu.option.about, 5, R.string.menu_about).setIcon(
- android.R.drawable.ic_menu_info_details);
- menu.add(3, Id.menu.option.help, 6, R.string.menu_help).setIcon(
- android.R.drawable.ic_menu_help);
+ menu.add(0, Id.menu.option.preferences, 0, R.string.menu_preferences)
+ .setIcon(R.drawable.ic_menu_settings_holo_light)
+ .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
+ menu.add(0, Id.menu.option.about, 1, R.string.menu_about).setShowAsAction(
+ MenuItem.SHOW_AS_ACTION_IF_ROOM);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
- case Id.menu.option.create: {
- showDialog(Id.dialog.new_account);
- return true;
- }
-
- case Id.menu.option.manage_public_keys: {
- startActivity(new Intent(this, PublicKeyListActivity.class));
- return true;
- }
-
- case Id.menu.option.manage_secret_keys: {
- startActivity(new Intent(this, SecretKeyListActivity.class));
+ case Id.menu.option.about: {
+ startActivity(new Intent(this, AboutActivity.class));
return true;
}
- case Id.menu.option.help: {
- showDialog(Id.dialog.help);
- return true;
- }
-
- case Id.menu.option.key_server: {
- startActivity(new Intent(this, KeyServerQueryActivity.class));
+ case Id.menu.option.preferences: {
+ startActivity(new Intent(this, PreferencesActivity.class));
return true;
}
default: {
- return super.onOptionsItemSelected(item);
+ break;
}
}
+ return false;
}
+ // @Override
+ // public boolean onCreateOptionsMenu(Menu menu) {
+ // menu.add(2, Id.menu.option.preferences, 3, R.string.menu_preferences).setIcon(
+ // android.R.drawable.ic_menu_preferences);
+ // menu.add(2, Id.menu.option.key_server, 4, R.string.menu_keyServer).setIcon(
+ // android.R.drawable.ic_menu_search);
+ // menu.add(3, Id.menu.option.about, 5, R.string.menu_about).setIcon(
+ // android.R.drawable.ic_menu_info_details);
+ // menu.add(3, Id.menu.option.help, 6, R.string.menu_help).setIcon(
+ // android.R.drawable.ic_menu_help);
+ // return true;
+ // }
+ //
+ // @Override
+ // public boolean onOptionsItemSelected(MenuItem item) {
+ // switch (item.getItemId()) {
+ // case Id.menu.option.create: {
+ // showDialog(Id.dialog.new_account);
+ // return true;
+ // }
+ //
+ // case Id.menu.option.manage_public_keys: {
+ // startActivity(new Intent(this, PublicKeyListActivity.class));
+ // return true;
+ // }
+ //
+ // case Id.menu.option.manage_secret_keys: {
+ // startActivity(new Intent(this, SecretKeyListActivity.class));
+ // return true;
+ // }
+ //
+ // case Id.menu.option.help: {
+ // showDialog(Id.dialog.help);
+ // return true;
+ // }
+ //
+ // case Id.menu.option.key_server: {
+ // startActivity(new Intent(this, KeyServerQueryActivity.class));
+ // return true;
+ // }
+ //
+ // default: {
+ // return super.onOptionsItemSelected(item);
+ // }
+ // }
+ // }
+
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
diff --git a/org_apg/src/org/apg/ui/PreferencesActivity.java b/org_apg/src/org/apg/ui/PreferencesActivity.java
index 421c9cc39..0679ee5d0 100644
--- a/org_apg/src/org/apg/ui/PreferencesActivity.java
+++ b/org_apg/src/org/apg/ui/PreferencesActivity.java
@@ -29,6 +29,10 @@ import org.spongycastle.bcpg.HashAlgorithmTags;
import org.spongycastle.openpgp.PGPEncryptedData;
import org.apg.R;
+import com.actionbarsherlock.app.ActionBar;
+import com.actionbarsherlock.app.SherlockPreferenceActivity;
+import com.actionbarsherlock.view.MenuItem;
+
import android.content.Intent;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
@@ -41,7 +45,7 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.Vector;
-public class PreferencesActivity extends PreferenceActivity {
+public class PreferencesActivity extends SherlockPreferenceActivity {
private ListPreference mLanguage = null;
private IntegerListPreference mPassPhraseCacheTtl = null;
private IntegerListPreference mEncryptionAlgorithm = null;
@@ -56,66 +60,35 @@ public class PreferencesActivity extends PreferenceActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
mPreferences = Preferences.getPreferences(this);
- BaseActivity.setLanguage(this, mPreferences.getLanguage());
super.onCreate(savedInstanceState);
- addPreferencesFromResource(R.xml.apg_preferences);
+ final ActionBar actionBar = getSupportActionBar();
+ actionBar.setDisplayShowTitleEnabled(true);
+ actionBar.setDisplayHomeAsUpEnabled(true);
- mLanguage = (ListPreference) findPreference(Constants.pref.LANGUAGE);
- Vector<CharSequence> entryVector = new Vector<CharSequence>(Arrays.asList(mLanguage.getEntries()));
- Vector<CharSequence> entryValueVector = new Vector<CharSequence>(Arrays.asList(mLanguage.getEntryValues()));
- String supportedLanguages[] = getResources().getStringArray(R.array.supported_languages);
- HashSet<String> supportedLanguageSet = new HashSet<String>(Arrays.asList(supportedLanguages));
- for (int i = entryVector.size() - 1; i > -1; --i)
- {
- if (!supportedLanguageSet.contains(entryValueVector.get(i)))
- {
- entryVector.remove(i);
- entryValueVector.remove(i);
- }
- }
- CharSequence dummy[] = new CharSequence[0];
- mLanguage.setEntries(entryVector.toArray(dummy));
- mLanguage.setEntryValues(entryValueVector.toArray(dummy));
- mLanguage.setValue(mPreferences.getLanguage());
- mLanguage.setSummary(mLanguage.getEntry());
- mLanguage.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
- {
- public boolean onPreferenceChange(Preference preference, Object newValue)
- {
- mLanguage.setValue(newValue.toString());
- mLanguage.setSummary(mLanguage.getEntry());
- mPreferences.setLanguage(newValue.toString());
- return false;
- }
- });
+ addPreferencesFromResource(R.xml.apg_preferences);
mPassPhraseCacheTtl = (IntegerListPreference) findPreference(Constants.pref.PASS_PHRASE_CACHE_TTL);
mPassPhraseCacheTtl.setValue("" + mPreferences.getPassPhraseCacheTtl());
mPassPhraseCacheTtl.setSummary(mPassPhraseCacheTtl.getEntry());
- mPassPhraseCacheTtl.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
- {
- public boolean onPreferenceChange(Preference preference, Object newValue)
- {
- mPassPhraseCacheTtl.setValue(newValue.toString());
- mPassPhraseCacheTtl.setSummary(mPassPhraseCacheTtl.getEntry());
- mPreferences.setPassPhraseCacheTtl(Integer.parseInt(newValue.toString()));
- BaseActivity.startCacheService(PreferencesActivity.this, mPreferences);
- return false;
- }
- });
+ mPassPhraseCacheTtl
+ .setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ mPassPhraseCacheTtl.setValue(newValue.toString());
+ mPassPhraseCacheTtl.setSummary(mPassPhraseCacheTtl.getEntry());
+ mPreferences.setPassPhraseCacheTtl(Integer.parseInt(newValue.toString()));
+ BaseActivity.startCacheService(PreferencesActivity.this, mPreferences);
+ return false;
+ }
+ });
mEncryptionAlgorithm = (IntegerListPreference) findPreference(Constants.pref.DEFAULT_ENCRYPTION_ALGORITHM);
- int valueIds[] = {
- PGPEncryptedData.AES_128, PGPEncryptedData.AES_192, PGPEncryptedData.AES_256,
- PGPEncryptedData.BLOWFISH, PGPEncryptedData.TWOFISH, PGPEncryptedData.CAST5,
- PGPEncryptedData.DES, PGPEncryptedData.TRIPLE_DES, PGPEncryptedData.IDEA,
- };
- String entries[] = {
- "AES-128", "AES-192", "AES-256",
- "Blowfish", "Twofish", "CAST5",
- "DES", "Triple DES", "IDEA",
- };
+ int valueIds[] = { PGPEncryptedData.AES_128, PGPEncryptedData.AES_192,
+ PGPEncryptedData.AES_256, PGPEncryptedData.BLOWFISH, PGPEncryptedData.TWOFISH,
+ PGPEncryptedData.CAST5, PGPEncryptedData.DES, PGPEncryptedData.TRIPLE_DES,
+ PGPEncryptedData.IDEA, };
+ String entries[] = { "AES-128", "AES-192", "AES-256", "Blowfish", "Twofish", "CAST5",
+ "DES", "Triple DES", "IDEA", };
String values[] = new String[valueIds.length];
for (int i = 0; i < values.length; ++i) {
values[i] = "" + valueIds[i];
@@ -124,28 +97,23 @@ public class PreferencesActivity extends PreferenceActivity {
mEncryptionAlgorithm.setEntryValues(values);
mEncryptionAlgorithm.setValue("" + mPreferences.getDefaultEncryptionAlgorithm());
mEncryptionAlgorithm.setSummary(mEncryptionAlgorithm.getEntry());
- mEncryptionAlgorithm.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
- {
- public boolean onPreferenceChange(Preference preference, Object newValue)
- {
- mEncryptionAlgorithm.setValue(newValue.toString());
- mEncryptionAlgorithm.setSummary(mEncryptionAlgorithm.getEntry());
- mPreferences.setDefaultEncryptionAlgorithm(Integer.parseInt(newValue.toString()));
- return false;
- }
- });
+ mEncryptionAlgorithm
+ .setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ mEncryptionAlgorithm.setValue(newValue.toString());
+ mEncryptionAlgorithm.setSummary(mEncryptionAlgorithm.getEntry());
+ mPreferences.setDefaultEncryptionAlgorithm(Integer.parseInt(newValue
+ .toString()));
+ return false;
+ }
+ });
mHashAlgorithm = (IntegerListPreference) findPreference(Constants.pref.DEFAULT_HASH_ALGORITHM);
- valueIds = new int[] {
- HashAlgorithmTags.MD5, HashAlgorithmTags.RIPEMD160, HashAlgorithmTags.SHA1,
- HashAlgorithmTags.SHA224, HashAlgorithmTags.SHA256, HashAlgorithmTags.SHA384,
- HashAlgorithmTags.SHA512,
- };
- entries = new String[] {
- "MD5", "RIPEMD-160", "SHA-1",
- "SHA-224", "SHA-256", "SHA-384",
- "SHA-512",
- };
+ valueIds = new int[] { HashAlgorithmTags.MD5, HashAlgorithmTags.RIPEMD160,
+ HashAlgorithmTags.SHA1, HashAlgorithmTags.SHA224, HashAlgorithmTags.SHA256,
+ HashAlgorithmTags.SHA384, HashAlgorithmTags.SHA512, };
+ entries = new String[] { "MD5", "RIPEMD-160", "SHA-1", "SHA-224", "SHA-256", "SHA-384",
+ "SHA-512", };
values = new String[valueIds.length];
for (int i = 0; i < values.length; ++i) {
values[i] = "" + valueIds[i];
@@ -154,10 +122,8 @@ public class PreferencesActivity extends PreferenceActivity {
mHashAlgorithm.setEntryValues(values);
mHashAlgorithm.setValue("" + mPreferences.getDefaultHashAlgorithm());
mHashAlgorithm.setSummary(mHashAlgorithm.getEntry());
- mHashAlgorithm.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
- {
- public boolean onPreferenceChange(Preference preference, Object newValue)
- {
+ mHashAlgorithm.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
mHashAlgorithm.setValue(newValue.toString());
mHashAlgorithm.setSummary(mHashAlgorithm.getEntry());
mPreferences.setDefaultHashAlgorithm(Integer.parseInt(newValue.toString()));
@@ -166,18 +132,13 @@ public class PreferencesActivity extends PreferenceActivity {
});
mMessageCompression = (IntegerListPreference) findPreference(Constants.pref.DEFAULT_MESSAGE_COMPRESSION);
- valueIds = new int[] {
- Id.choice.compression.none,
- Id.choice.compression.zip,
- Id.choice.compression.zlib,
- Id.choice.compression.bzip2,
- };
+ valueIds = new int[] { Id.choice.compression.none, Id.choice.compression.zip,
+ Id.choice.compression.zlib, Id.choice.compression.bzip2, };
entries = new String[] {
getString(R.string.choice_none) + " (" + getString(R.string.fast) + ")",
"ZIP (" + getString(R.string.fast) + ")",
"ZLIB (" + getString(R.string.fast) + ")",
- "BZIP2 (" + getString(R.string.very_slow) + ")",
- };
+ "BZIP2 (" + getString(R.string.very_slow) + ")", };
values = new String[valueIds.length];
for (int i = 0; i < values.length; ++i) {
values[i] = "" + valueIds[i];
@@ -186,26 +147,24 @@ public class PreferencesActivity extends PreferenceActivity {
mMessageCompression.setEntryValues(values);
mMessageCompression.setValue("" + mPreferences.getDefaultMessageCompression());
mMessageCompression.setSummary(mMessageCompression.getEntry());
- mMessageCompression.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
- {
- public boolean onPreferenceChange(Preference preference, Object newValue)
- {
- mMessageCompression.setValue(newValue.toString());
- mMessageCompression.setSummary(mMessageCompression.getEntry());
- mPreferences.setDefaultMessageCompression(Integer.parseInt(newValue.toString()));
- return false;
- }
- });
+ mMessageCompression
+ .setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ mMessageCompression.setValue(newValue.toString());
+ mMessageCompression.setSummary(mMessageCompression.getEntry());
+ mPreferences.setDefaultMessageCompression(Integer.parseInt(newValue
+ .toString()));
+ return false;
+ }
+ });
mFileCompression = (IntegerListPreference) findPreference(Constants.pref.DEFAULT_FILE_COMPRESSION);
mFileCompression.setEntries(entries);
mFileCompression.setEntryValues(values);
mFileCompression.setValue("" + mPreferences.getDefaultFileCompression());
mFileCompression.setSummary(mFileCompression.getEntry());
- mFileCompression.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
- {
- public boolean onPreferenceChange(Preference preference, Object newValue)
- {
+ mFileCompression.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
mFileCompression.setValue(newValue.toString());
mFileCompression.setSummary(mFileCompression.getEntry());
mPreferences.setDefaultFileCompression(Integer.parseInt(newValue.toString()));
@@ -215,60 +174,74 @@ public class PreferencesActivity extends PreferenceActivity {
mAsciiArmour = (CheckBoxPreference) findPreference(Constants.pref.DEFAULT_ASCII_ARMOUR);
mAsciiArmour.setChecked(mPreferences.getDefaultAsciiArmour());
- mAsciiArmour.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
- {
- public boolean onPreferenceChange(Preference preference, Object newValue)
- {
- mAsciiArmour.setChecked((Boolean)newValue);
- mPreferences.setDefaultAsciiArmour((Boolean)newValue);
+ mAsciiArmour.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ mAsciiArmour.setChecked((Boolean) newValue);
+ mPreferences.setDefaultAsciiArmour((Boolean) newValue);
return false;
}
});
mForceV3Signatures = (CheckBoxPreference) findPreference(Constants.pref.FORCE_V3_SIGNATURES);
mForceV3Signatures.setChecked(mPreferences.getForceV3Signatures());
- mForceV3Signatures.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
- {
- public boolean onPreferenceChange(Preference preference, Object newValue)
- {
- mForceV3Signatures.setChecked((Boolean)newValue);
- mPreferences.setForceV3Signatures((Boolean)newValue);
- return false;
- }
- });
+ mForceV3Signatures
+ .setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ mForceV3Signatures.setChecked((Boolean) newValue);
+ mPreferences.setForceV3Signatures((Boolean) newValue);
+ return false;
+ }
+ });
mKeyServerPreference = (PreferenceScreen) findPreference(Constants.pref.KEY_SERVERS);
String servers[] = mPreferences.getKeyServers();
- mKeyServerPreference.setSummary(getResources().getString(R.string.nKeyServers, servers.length));
- mKeyServerPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
- public boolean onPreferenceClick(Preference preference) {
- Intent intent = new Intent(PreferencesActivity.this,
- KeyServerPreferenceActivity.class);
- intent.putExtra(Apg.EXTRA_KEY_SERVERS, mPreferences.getKeyServers());
- startActivityForResult(intent, Id.request.key_server_preference);
- return false;
- }
- });
+ mKeyServerPreference.setSummary(getResources().getString(R.string.nKeyServers,
+ servers.length));
+ mKeyServerPreference
+ .setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
+ public boolean onPreferenceClick(Preference preference) {
+ Intent intent = new Intent(PreferencesActivity.this,
+ KeyServerPreferenceActivity.class);
+ intent.putExtra(Apg.EXTRA_KEY_SERVERS, mPreferences.getKeyServers());
+ startActivityForResult(intent, Id.request.key_server_preference);
+ return false;
+ }
+ });
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
- case Id.request.key_server_preference: {
- if (resultCode == RESULT_CANCELED || data == null) {
- return;
- }
- String servers[] = data.getStringArrayExtra(Apg.EXTRA_KEY_SERVERS);
- mPreferences.setKeyServers(servers);
- mKeyServerPreference.setSummary(getResources().getString(R.string.nKeyServers, servers.length));
- break;
+ case Id.request.key_server_preference: {
+ if (resultCode == RESULT_CANCELED || data == null) {
+ return;
}
+ String servers[] = data.getStringArrayExtra(Apg.EXTRA_KEY_SERVERS);
+ mPreferences.setKeyServers(servers);
+ mKeyServerPreference.setSummary(getResources().getString(R.string.nKeyServers,
+ servers.length));
+ break;
+ }
- default: {
- super.onActivityResult(requestCode, resultCode, data);
- break;
- }
+ default: {
+ super.onActivityResult(requestCode, resultCode, data);
+ break;
+ }
}
}
-}
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+
+ case android.R.id.home:
+ startActivity(new Intent(this, MainActivity.class));
+ return true;
+
+ default:
+ break;
+
+ }
+ return false;
+ }
+}
diff --git a/org_apg/src/org/apg/ui/PublicKeyListActivity.java b/org_apg/src/org/apg/ui/PublicKeyListActivity.java
index 81d2d5e73..f0e7ce569 100644
--- a/org_apg/src/org/apg/ui/PublicKeyListActivity.java
+++ b/org_apg/src/org/apg/ui/PublicKeyListActivity.java
@@ -27,6 +27,7 @@ import org.apg.Id.menu.option;
import org.spongycastle.openpgp.PGPPublicKeyRing;
import org.apg.R;
+import com.actionbarsherlock.ActionBarSherlock;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
@@ -48,22 +49,50 @@ public class PublicKeyListActivity extends KeyListActivity {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
- menu.add(0, Id.menu.option.import_keys, 0, R.string.menu_importKeys).setIcon(
- android.R.drawable.ic_menu_add);
- menu.add(0, Id.menu.option.export_keys, 1, R.string.menu_exportKeys).setIcon(
- android.R.drawable.ic_menu_save);
- menu.add(1, Id.menu.option.search, 2, R.string.menu_search).setIcon(
- android.R.drawable.ic_menu_search);
- menu.add(1, Id.menu.option.preferences, 3, R.string.menu_preferences).setIcon(
- android.R.drawable.ic_menu_preferences);
- menu.add(1, Id.menu.option.about, 4, R.string.menu_about).setIcon(
- android.R.drawable.ic_menu_info_details);
- menu.add(1, Id.menu.option.scanQRCode, 5, R.string.menu_scanQRCode).setIcon(
- android.R.drawable.ic_menu_add);
+ menu.add(1, Id.menu.option.key_server, 0, R.string.menu_keyServer)
+ .setIcon(R.drawable.ic_menu_find_holo_light)
+ .setShowAsAction(
+ MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
+ menu.add(1, Id.menu.option.scanQRCode, 1, R.string.menu_scanQRCode)
+ // .setIcon(R.drawable.ic_suggestions_add)
+ .setShowAsAction(
+ MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
+ menu.add(0, Id.menu.option.import_keys, 2, R.string.menu_importKeys)
+ // .setIcon(R.drawable.ic_suggestions_add)
+ .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
+ menu.add(0, Id.menu.option.export_keys, 3, R.string.menu_exportKeys)
+ // .setIcon(R.drawable.ic_menu_share_holo_light)
+ .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
+ menu.add(1, Id.menu.option.search, 4, R.string.menu_search)
+ .setIcon(R.drawable.ic_menu_search_holo_light)
+ .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
+
return true;
}
@Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case Id.menu.option.key_server: {
+ startActivity(new Intent(this, KeyServerQueryActivity.class));
+
+ return true;
+ }
+ case Id.menu.option.scanQRCode: {
+ Intent intent = new Intent(this, ImportFromQRCodeActivity.class);
+ intent.setAction(Apg.Intent.IMPORT_FROM_QR_CODE);
+ startActivityForResult(intent, Id.request.import_from_qr_code);
+
+ return true;
+ }
+
+ default: {
+ return super.onOptionsItemSelected(item);
+ }
+ }
+ }
+
+ @Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
ExpandableListView.ExpandableListContextMenuInfo info = (ExpandableListView.ExpandableListContextMenuInfo) menuInfo;
@@ -151,23 +180,6 @@ public class PublicKeyListActivity extends KeyListActivity {
}
@Override
- public boolean onOptionsItemSelected(MenuItem item) {
- switch (item.getItemId()) {
- case Id.menu.option.scanQRCode: {
- Intent intent = new Intent(this, ImportFromQRCodeActivity.class);
- intent.setAction(Apg.Intent.IMPORT_FROM_QR_CODE);
- startActivityForResult(intent, Id.request.import_from_qr_code);
-
- return true;
- }
-
- default: {
- return super.onOptionsItemSelected(item);
- }
- }
- }
-
- @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case Id.request.look_up_key_id: {
diff --git a/org_apg/src/org/apg/ui/SecretKeyListActivity.java b/org_apg/src/org/apg/ui/SecretKeyListActivity.java
index be4da700a..db9c2903e 100644
--- a/org_apg/src/org/apg/ui/SecretKeyListActivity.java
+++ b/org_apg/src/org/apg/ui/SecretKeyListActivity.java
@@ -28,7 +28,6 @@ import org.apg.Id.type;
import org.apg.Id.menu.option;
import org.apg.R;
-
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
@@ -55,40 +54,41 @@ public class SecretKeyListActivity extends KeyListActivity implements OnChildCli
@Override
public boolean onCreateOptionsMenu(Menu menu) {
- menu.add(0, Id.menu.option.import_keys, 0, R.string.menu_importKeys)
- .setIcon(android.R.drawable.ic_menu_add);
- menu.add(0, Id.menu.option.export_keys, 1, R.string.menu_exportKeys)
- .setIcon(android.R.drawable.ic_menu_save);
- menu.add(1, Id.menu.option.create, 2, R.string.menu_createKey)
- .setIcon(android.R.drawable.ic_menu_add);
+ menu.add(1, Id.menu.option.create, 0, R.string.menu_createKey)
+ .setIcon(R.drawable.ic_suggestions_add)
+ .setShowAsAction(
+ MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
+ menu.add(0, Id.menu.option.import_keys, 1, R.string.menu_importKeys)
+ // .setIcon(R.drawable.ic_menu_find_holo_light)
+ .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
+ menu.add(0, Id.menu.option.export_keys, 2, R.string.menu_exportKeys)
+ // .setIcon(R.drawable.ic_menu_find_holo_light)
+ .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
+
menu.add(3, Id.menu.option.search, 3, R.string.menu_search)
- .setIcon(android.R.drawable.ic_menu_search);
- menu.add(3, Id.menu.option.preferences, 4, R.string.menu_preferences)
- .setIcon(android.R.drawable.ic_menu_preferences);
- menu.add(3, Id.menu.option.about, 5, R.string.menu_about)
- .setIcon(android.R.drawable.ic_menu_info_details);
+ .setIcon(R.drawable.ic_menu_search_holo_light)
+ .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
- case Id.menu.option.create: {
- createKey();
- return true;
- }
+ case Id.menu.option.create: {
+ createKey();
+ return true;
+ }
- default: {
- return super.onOptionsItemSelected(item);
- }
+ default: {
+ return super.onOptionsItemSelected(item);
+ }
}
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
- ExpandableListView.ExpandableListContextMenuInfo info =
- (ExpandableListView.ExpandableListContextMenuInfo) menuInfo;
+ ExpandableListView.ExpandableListContextMenuInfo info = (ExpandableListView.ExpandableListContextMenuInfo) menuInfo;
int type = ExpandableListView.getPackedPositionType(info.packedPosition);
if (type == ExpandableListView.PACKED_POSITION_TYPE_GROUP) {
@@ -111,29 +111,31 @@ public class SecretKeyListActivity extends KeyListActivity implements OnChildCli
}
switch (menuItem.getItemId()) {
- case Id.menu.edit: {
- mSelectedItem = groupPosition;
- checkPassPhraseAndEdit();
- return true;
- }
+ case Id.menu.edit: {
+ mSelectedItem = groupPosition;
+ checkPassPhraseAndEdit();
+ return true;
+ }
- case Id.menu.share: {
- mSelectedItem = groupPosition;
-
- long keyId = ((KeyListAdapter) mList.getExpandableListAdapter()).getGroupId(mSelectedItem);
- String msg = keyId + "," + Apg.getFingerPrint(keyId);;
-
- new IntentIntegrator(this).shareText(msg);
- }
+ case Id.menu.share: {
+ mSelectedItem = groupPosition;
- default: {
- return super.onContextItemSelected(menuItem);
- }
+ long keyId = ((KeyListAdapter) mList.getExpandableListAdapter())
+ .getGroupId(mSelectedItem);
+ String msg = keyId + "," + Apg.getFingerPrint(keyId);
+ ;
+
+ new IntentIntegrator(this).shareText(msg);
+ }
+
+ default: {
+ return super.onContextItemSelected(menuItem);
+ }
}
}
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition,
- int childPosition, long id) {
+ int childPosition, long id) {
mSelectedItem = groupPosition;
checkPassPhraseAndEdit();
return true;
@@ -142,14 +144,15 @@ public class SecretKeyListActivity extends KeyListActivity implements OnChildCli
@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
- case Id.dialog.pass_phrase: {
- long keyId = ((KeyListAdapter) mList.getExpandableListAdapter()).getGroupId(mSelectedItem);
- return AskForSecretKeyPassPhrase.createDialog(this, keyId, this);
- }
+ case Id.dialog.pass_phrase: {
+ long keyId = ((KeyListAdapter) mList.getExpandableListAdapter())
+ .getGroupId(mSelectedItem);
+ return AskForSecretKeyPassPhrase.createDialog(this, keyId, this);
+ }
- default: {
- return super.onCreateDialog(id);
- }
+ default: {
+ return super.onCreateDialog(id);
+ }
}
}
@@ -187,17 +190,17 @@ public class SecretKeyListActivity extends KeyListActivity implements OnChildCli
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
- case Id.message.create_key: // intentionally no break
- case Id.message.edit_key: {
- if (resultCode == RESULT_OK) {
- refreshList();
- }
- break;
- }
-
- default: {
- break;
+ case Id.message.create_key: // intentionally no break
+ case Id.message.edit_key: {
+ if (resultCode == RESULT_OK) {
+ refreshList();
}
+ break;
+ }
+
+ default: {
+ break;
+ }
}
super.onActivityResult(requestCode, resultCode, data);
diff --git a/org_apg/src/org/apg/ui/widget/DashboardLayout.java b/org_apg/src/org/apg/ui/widget/DashboardLayout.java
index c578f26cd..8cd97ca05 100644
--- a/org_apg/src/org/apg/ui/widget/DashboardLayout.java
+++ b/org_apg/src/org/apg/ui/widget/DashboardLayout.java
@@ -27,7 +27,6 @@ import android.view.ViewGroup;
*/
public class DashboardLayout extends ViewGroup {
private static final int UNEVEN_GRID_PENALTY_MULTIPLIER = 10;
- private static final int OVERLAP_PENALTY_MULTIPLIER = 10;
private int mMaxChildWidth = 0;
private int mMaxChildHeight = 0;
@@ -129,12 +128,8 @@ public class DashboardLayout extends ViewGroup {
spaceDifference = Math.abs(vSpace - hSpace);
if (rows * cols != visibleCount) {
spaceDifference *= UNEVEN_GRID_PENALTY_MULTIPLIER;
- }
- if (hSpace < 0) {
- spaceDifference *= OVERLAP_PENALTY_MULTIPLIER;
- }
- if (vSpace < 0) {
- spaceDifference *= OVERLAP_PENALTY_MULTIPLIER;
+ } else if (rows * mMaxChildHeight > height || cols * mMaxChildWidth > width) {
+ spaceDifference *= UNEVEN_GRID_PENALTY_MULTIPLIER;
}
if (spaceDifference < bestSpaceDifference) {
diff --git a/org_apg/src/org/apg/ui/widget/SectionView.java b/org_apg/src/org/apg/ui/widget/SectionView.java
index 220699124..565ccb241 100644
--- a/org_apg/src/org/apg/ui/widget/SectionView.java
+++ b/org_apg/src/org/apg/ui/widget/SectionView.java
@@ -79,15 +79,14 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor
String error = data.getString(Apg.EXTRA_ERROR);
if (error != null) {
Toast.makeText(getContext(),
- getContext().getString(R.string.errorMessage, error),
- Toast.LENGTH_SHORT).show();
+ getContext().getString(R.string.errorMessage, error),
+ Toast.LENGTH_SHORT).show();
}
boolean gotNewKey = data.getBoolean("gotNewKey");
if (gotNewKey) {
- KeyEditor view =
- (KeyEditor) mInflater.inflate(R.layout.edit_key_key_item,
- mEditors, false);
+ KeyEditor view = (KeyEditor) mInflater.inflate(R.layout.edit_key_key_item,
+ mEditors, false);
view.setEditorListener(SectionView.this);
boolean isMasterKey = (mEditors.getChildCount() == 0);
view.setValue(mNewKey, isMasterKey);
@@ -113,19 +112,19 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor
public void setType(int type) {
mType = type;
switch (type) {
- case Id.type.user_id: {
- mTitle.setText(R.string.section_userIds);
- break;
- }
+ case Id.type.user_id: {
+ mTitle.setText(R.string.section_userIds);
+ break;
+ }
- case Id.type.key: {
- mTitle.setText(R.string.section_keys);
- break;
- }
+ case Id.type.key: {
+ mTitle.setText(R.string.section_keys);
+ break;
+ }
- default: {
- break;
- }
+ default: {
+ break;
+ }
}
}
@@ -160,86 +159,80 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor
/** {@inheritDoc} */
public void onClick(View v) {
switch (mType) {
- case Id.type.user_id: {
- UserIdEditor view =
- (UserIdEditor) mInflater.inflate(R.layout.edit_key_user_id_item,
- mEditors, false);
- view.setEditorListener(this);
- if (mEditors.getChildCount() == 0) {
- view.setIsMainUserId(true);
- }
- mEditors.addView(view);
- break;
+ case Id.type.user_id: {
+ UserIdEditor view = (UserIdEditor) mInflater.inflate(R.layout.edit_key_user_id_item,
+ mEditors, false);
+ view.setEditorListener(this);
+ if (mEditors.getChildCount() == 0) {
+ view.setIsMainUserId(true);
}
+ mEditors.addView(view);
+ break;
+ }
- case Id.type.key: {
- AlertDialog.Builder dialog = new AlertDialog.Builder(getContext());
+ case Id.type.key: {
+ AlertDialog.Builder dialog = new AlertDialog.Builder(getContext());
- View view = mInflater.inflate(R.layout.create_key, null);
- dialog.setView(view);
- dialog.setTitle(R.string.title_createKey);
- dialog.setMessage(R.string.keyCreationElGamalInfo);
+ View view = mInflater.inflate(R.layout.create_key, null);
+ dialog.setView(view);
+ dialog.setTitle(R.string.title_createKey);
+ dialog.setMessage(R.string.keyCreationElGamalInfo);
- boolean wouldBeMasterKey = (mEditors.getChildCount() == 0);
+ boolean wouldBeMasterKey = (mEditors.getChildCount() == 0);
- final Spinner algorithm = (Spinner) view.findViewById(R.id.algorithm);
- Vector<Choice> choices = new Vector<Choice>();
- choices.add(new Choice(Id.choice.algorithm.dsa,
- getResources().getString(R.string.dsa)));
- if (!wouldBeMasterKey) {
- choices.add(new Choice(Id.choice.algorithm.elgamal,
- getResources().getString(R.string.elgamal)));
- }
+ final Spinner algorithm = (Spinner) view.findViewById(R.id.algorithm);
+ Vector<Choice> choices = new Vector<Choice>();
+ choices.add(new Choice(Id.choice.algorithm.dsa, getResources().getString(R.string.dsa)));
+ if (!wouldBeMasterKey) {
+ choices.add(new Choice(Id.choice.algorithm.elgamal, getResources().getString(
+ R.string.elgamal)));
+ }
- choices.add(new Choice(Id.choice.algorithm.rsa,
- getResources().getString(R.string.rsa)));
-
- ArrayAdapter<Choice> adapter =
- new ArrayAdapter<Choice>(getContext(),
- android.R.layout.simple_spinner_item,
- choices);
- adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
- algorithm.setAdapter(adapter);
- // make RSA the default
- for (int i = 0; i < choices.size(); ++i) {
- if (choices.get(i).getId() == Id.choice.algorithm.rsa) {
- algorithm.setSelection(i);
- break;
- }
+ choices.add(new Choice(Id.choice.algorithm.rsa, getResources().getString(R.string.rsa)));
+
+ ArrayAdapter<Choice> adapter = new ArrayAdapter<Choice>(getContext(),
+ android.R.layout.simple_spinner_item, choices);
+ adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+ algorithm.setAdapter(adapter);
+ // make RSA the default
+ for (int i = 0; i < choices.size(); ++i) {
+ if (choices.get(i).getId() == Id.choice.algorithm.rsa) {
+ algorithm.setSelection(i);
+ break;
}
+ }
- final EditText keySize = (EditText) view.findViewById(R.id.size);
+ final EditText keySize = (EditText) view.findViewById(R.id.size);
- dialog.setPositiveButton(android.R.string.ok,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface di, int id) {
- di.dismiss();
- try {
- mNewKeySize = Integer.parseInt("" + keySize.getText());
- } catch (NumberFormatException e) {
- mNewKeySize = 0;
- }
-
- mNewKeyAlgorithmChoice = (Choice) algorithm.getSelectedItem();
- createKey();
+ dialog.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface di, int id) {
+ di.dismiss();
+ try {
+ mNewKeySize = Integer.parseInt("" + keySize.getText());
+ } catch (NumberFormatException e) {
+ mNewKeySize = 0;
}
- });
- dialog.setCancelable(true);
- dialog.setNegativeButton(android.R.string.cancel,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface di, int id) {
- di.dismiss();
- }
- });
+ mNewKeyAlgorithmChoice = (Choice) algorithm.getSelectedItem();
+ createKey();
+ }
+ });
- dialog.create().show();
- break;
- }
+ dialog.setCancelable(true);
+ dialog.setNegativeButton(android.R.string.cancel,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface di, int id) {
+ di.dismiss();
+ }
+ });
- default: {
- break;
- }
+ dialog.create().show();
+ break;
+ }
+
+ default: {
+ break;
+ }
}
this.updateEditorsVisible();
}
@@ -251,8 +244,8 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor
mEditors.removeAllViews();
for (String userId : list) {
- UserIdEditor view =
- (UserIdEditor) mInflater.inflate(R.layout.edit_key_user_id_item, mEditors, false);
+ UserIdEditor view = (UserIdEditor) mInflater.inflate(R.layout.edit_key_user_id_item,
+ mEditors, false);
view.setEditorListener(this);
view.setValue(userId);
if (mEditors.getChildCount() == 0) {
@@ -271,8 +264,8 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor
mEditors.removeAllViews();
for (PGPSecretKey key : list) {
- KeyEditor view =
- (KeyEditor) mInflater.inflate(R.layout.edit_key_key_item, mEditors, false);
+ KeyEditor view = (KeyEditor) mInflater.inflate(R.layout.edit_key_key_item, mEditors,
+ false);
view.setEditorListener(this);
boolean isMasterKey = (mEditors.getChildCount() == 0);
view.setValue(key, isMasterKey);
@@ -303,10 +296,8 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor
} else {
passPhrase = "";
}
- mNewKey = Apg.createKey(getContext(),
- mNewKeyAlgorithmChoice.getId(),
- mNewKeySize, passPhrase,
- masterKey);
+ mNewKey = Apg.createKey(getContext(), mNewKeyAlgorithmChoice.getId(), mNewKeySize,
+ passPhrase, masterKey);
} catch (NoSuchProviderException e) {
error = "" + e;
} catch (NoSuchAlgorithmException e) {
diff --git a/org_apg/src/org/apg/ui/widget/UserIdEditor.java b/org_apg/src/org/apg/ui/widget/UserIdEditor.java
index b154803cf..ebbc608f0 100644
--- a/org_apg/src/org/apg/ui/widget/UserIdEditor.java
+++ b/org_apg/src/org/apg/ui/widget/UserIdEditor.java
@@ -40,9 +40,9 @@ public class UserIdEditor extends LinearLayout implements Editor, OnClickListene
private EditText mEmail;
private EditText mComment;
- private static final Pattern EMAIL_PATTERN =
- Pattern.compile("^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+[.]([a-zA-Z])+([a-zA-Z])+",
- Pattern.CASE_INSENSITIVE);
+ private static final Pattern EMAIL_PATTERN = Pattern.compile(
+ "^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+[.]([a-zA-Z])+([a-zA-Z])+",
+ Pattern.CASE_INSENSITIVE);
public static class NoNameException extends Exception {
static final long serialVersionUID = 0xf812773343L;
@@ -124,8 +124,8 @@ public class UserIdEditor extends LinearLayout implements Editor, OnClickListene
if (email.length() > 0) {
Matcher emailMatcher = EMAIL_PATTERN.matcher(email);
if (!emailMatcher.matches()) {
- throw new InvalidEmailException(
- getContext().getString(R.string.error_invalidEmail, email));
+ throw new InvalidEmailException(getContext().getString(R.string.error_invalidEmail,
+ email));
}
}
@@ -155,7 +155,7 @@ public class UserIdEditor extends LinearLayout implements Editor, OnClickListene
}
public void onClick(View v) {
- final ViewGroup parent = (ViewGroup)getParent();
+ final ViewGroup parent = (ViewGroup) getParent();
if (v == mDeleteButton) {
boolean wasMainUserId = mIsMainUserId.isChecked();
parent.removeView(this);