Rudimentary backup feature

This commit is contained in:
Dominik Schürmann
2015-07-08 13:25:07 +02:00
parent 7b35f9b07a
commit d4fbaf9397
12 changed files with 288 additions and 96 deletions

View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="24dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="8dip"
android:text="@string/backup_text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
style="@style/SectionHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/backup_section" />
<TextView
android:id="@+id/backup_all"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:drawablePadding="8dp"
android:drawableRight="@drawable/ic_save_grey_24dp"
android:gravity="center_vertical"
android:minHeight="?android:attr/listPreferredItemHeight"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:text="@string/backup_all"
android:textAppearance="?android:attr/textAppearanceMedium" />
<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="?android:attr/listDivider" />
<TextView
android:id="@+id/backup_public_keys"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:drawablePadding="8dp"
android:drawableRight="@drawable/ic_save_grey_24dp"
android:gravity="center_vertical"
android:minHeight="?android:attr/listPreferredItemHeight"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:text="@string/backup_public_keys"
android:textAppearance="?android:attr/textAppearanceMedium" />
<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:layout_marginBottom="8dp"
android:background="?android:attr/listDivider" />
</LinearLayout>
</ScrollView>

View File

@@ -125,6 +125,23 @@
android:layout_marginTop="8dp"
android:background="?android:attr/listDivider" />
<ImageButton
android:id="@+id/view_key_action_key_export"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:padding="8dp"
android:src="@drawable/ic_save_grey_24dp"
android:layout_gravity="center_vertical"
android:background="?android:selectableItemBackground" />
<View
android:layout_width="1dip"
android:layout_height="match_parent"
android:gravity="right"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:background="?android:attr/listDivider" />
<ImageButton
android:id="@+id/view_key_action_key_nfc"
android:layout_width="wrap_content"

View File

@@ -1,28 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android">
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<item
android:id="@+id/menu_key_list_multi_encrypt"
android:icon="@drawable/ic_lock_white_24dp"
android:title="@string/menu_encrypt_to" />
<item
android:id="@+id/menu_key_list_multi_export"
android:showAsAction="never"
tools:ignore="AppCompatResource"
android:title="@string/menu_export_key" />
<item
android:id="@+id/menu_key_list_multi_delete"
android:showAsAction="never"
tools:ignore="AppCompatResource"
android:title="@string/menu_delete_key" />
<item
android:id="@+id/menu_key_list_multi_select_all"
android:showAsAction="never"
tools:ignore="AppCompatResource"
android:title="@string/menu_select_all" />
android:title="@string/menu_delete_key"
tools:ignore="AppCompatResource" />
</menu>

View File

@@ -96,7 +96,7 @@
<!-- menu -->
<string name="menu_preferences">"Settings"</string>
<string name="menu_help">"Help"</string>
<string name="menu_export_key">"Export to file"</string>
<string name="menu_export_key">"Backup to file"</string>
<string name="menu_delete_key">"Delete key"</string>
<string name="menu_manage_keys">"Manage my keys"</string>
<string name="menu_search">"Search"</string>
@@ -736,6 +736,7 @@
<string name="drawer_open">"Open navigation drawer"</string>
<string name="drawer_close">"Close navigation drawer"</string>
<string name="my_keys">"My Keys"</string>
<string name="nav_backup">"Backup"</string>
<!-- hints -->
<string name="encrypt_content_edit_text_hint">"Type text"</string>
@@ -1316,6 +1317,11 @@
<string name="first_time_blank_yubikey">"Would you like to use this blank YubiKey NEO with OpenKeychain?\n\nPlease take away the YubiKey now, you will be prompted when it is needed again!"</string>
<string name="first_time_blank_yubikey_yes">"Use this YubiKey"</string>
<string name="backup_text">"Backups that include your own keys must never be shared with other people!"</string>
<string name="backup_all">"All keys + your own keys"</string>
<string name="backup_public_keys">"All keys"</string>
<string name="backup_section">"Backup"</string>
<!-- unsorted -->
<string name="section_certifier_id">"Certifier"</string>
<string name="section_cert">"Certificate Details"</string>