From 572322547522011d393ac5940bf8288544115372 Mon Sep 17 00:00:00 2001 From: Ricki Hirner Date: Fri, 18 Mar 2016 17:24:46 +0100 Subject: [PATCH] App settings UI --- app/src/main/AndroidManifest.xml | 25 ++++-- .../main/java/at/bitfire/davdroid/App.java | 30 +++++-- .../bitfire/davdroid/ui/AccountsActivity.java | 3 +- .../davdroid/ui/AppSettingsActivity.java | 84 +++++++++++++++++++ .../res/menu/activity_accounts_drawer.xml | 4 +- app/src/main/res/values/strings.xml | 18 +++- app/src/main/res/xml/settings_app.xml | 34 ++++++++ 7 files changed, 179 insertions(+), 19 deletions(-) create mode 100644 app/src/main/java/at/bitfire/davdroid/ui/AppSettingsActivity.java create mode 100644 app/src/main/res/xml/settings_app.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 20cd71c6..dd1eb55f 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -42,6 +42,7 @@ + + + + + + + + + + @@ -134,19 +150,12 @@ android:label="@string/create_addressbook"/> + - - - - - iterator = mtm.getCertificates(); + while (iterator.hasMoreElements()) + try { + mtm.deleteCertificate(iterator.nextElement()); + deleted++; + } catch (KeyStoreException e) { + App.log.log(Level.SEVERE, "Couldn't distrust certificate", e); + } + Snackbar.make(getView(), getString(R.string.app_settings_reset_trusted_certificates_success, deleted), Snackbar.LENGTH_LONG).show(); + } + } + +} diff --git a/app/src/main/res/menu/activity_accounts_drawer.xml b/app/src/main/res/menu/activity_accounts_drawer.xml index ab403236..61f7d4e2 100644 --- a/app/src/main/res/menu/activity_accounts_drawer.xml +++ b/app/src/main/res/menu/activity_accounts_drawer.xml @@ -22,8 +22,8 @@ android:icon="@drawable/ic_attach_money_dark" android:title="@string/navigation_drawer_donate"/> + android:title="@string/navigation_drawer_app_settings"/> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b7cc3428..ca823549 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -17,13 +17,27 @@ Send Skip + + Settings + User interface + Reset hints + Re-enables hints which have been dismissed previously + Security + Reset trusted certificates + Forgets all certificates which have been accepted previously + Distrusted %d certificate(s) + Debugging + Log to external file + Logging to external storage (if available) + External file logging is disabled + Open navigation drawer Close navigation drawer CalDAV/CardDAV Sync Adapter About / License Donate - Preferences + Settings Web site Welcome to DAVdroid!\n\nYou can add a CalDAV/CardDAV account now. @@ -190,7 +204,7 @@ Set a collection color Creating collection Display name (title) of this collection: - A title is required + Title is required Description (optional): Home set: Delete collection diff --git a/app/src/main/res/xml/settings_app.xml b/app/src/main/res/xml/settings_app.xml new file mode 100644 index 00000000..5104c7d1 --- /dev/null +++ b/app/src/main/res/xml/settings_app.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file