From a7267a3cfc2467cb400fc4f52e3ad156279c3abd Mon Sep 17 00:00:00 2001 From: schleif Date: Tue, 5 Nov 2019 12:06:02 +0100 Subject: [PATCH] add autocrypt thunderbird plugin advertisment --- .../keychain/ui/MainActivity.java | 17 ++++++++++++++++- OpenKeychain/src/main/res/values/strings.xml | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/MainActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/MainActivity.java index 4d34c5dc1..3ff922332 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/MainActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/MainActivity.java @@ -19,6 +19,7 @@ package org.sufficientlysecure.keychain.ui; import android.content.Intent; import android.graphics.Typeface; +import android.net.Uri; import android.os.Build; import android.os.Build.VERSION_CODES; import android.os.Bundle; @@ -58,6 +59,7 @@ public class MainActivity extends BaseSecurityTokenActivity implements FabContai static final int ID_SETTINGS = 6; static final int ID_HELP = 7; static final int ID_SHOP = 8; + static final int ID_AUTOCRYPT = 9; // both of these are used for instrumentation testing only public static final String EXTRA_SKIP_FIRST_TIME = "skip_first_time"; @@ -100,7 +102,10 @@ public class MainActivity extends BaseSecurityTokenActivity implements FabContai .withIdentifier(ID_TRANSFER).withSelectable(false), new DividerDrawerItem(), new PrimaryDrawerItem().withName(R.string.menu_preferences).withIcon(GoogleMaterial.Icon.gmd_settings).withIdentifier(ID_SETTINGS).withSelectable(false), - new PrimaryDrawerItem().withName(R.string.menu_help).withIcon(CommunityMaterial.Icon.cmd_help_circle).withIdentifier(ID_HELP).withSelectable(false) + new PrimaryDrawerItem().withName(R.string.menu_help).withIcon(CommunityMaterial.Icon.cmd_help_circle).withIdentifier(ID_HELP).withSelectable(false), + new DividerDrawerItem(), + new PrimaryDrawerItem().withName(R.string.nav_autocrypt).withIcon(GoogleMaterial.Icon.gmd_blur_on) + .withTypeface(Typeface.DEFAULT_BOLD).withSelectable(false).withIdentifier(ID_AUTOCRYPT) ) .withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() { @Override @@ -133,6 +138,9 @@ public class MainActivity extends BaseSecurityTokenActivity implements FabContai case ID_SHOP: onShopSelected(); break; + case ID_AUTOCRYPT: + onAutocryptSelected(); + break; } if (intent != null) { MainActivity.this.startActivity(intent); @@ -266,6 +274,13 @@ public class MainActivity extends BaseSecurityTokenActivity implements FabContai setFragment(frag); } + private void onAutocryptSelected() { + String url = "https://addons.thunderbird.net/en-US/thunderbird/addon/autocrypt/"; + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(url)); + startActivity(intent); + } + @Override protected void onSaveInstanceState(Bundle outState) { // add the values which need to be saved from the drawer to the bundle diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index 4f8e92f1a..ce4dc67fa 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -858,6 +858,7 @@ "Backup/Restore" "Secure Wifi Transfer" Shop + Try Autocrypt Thunderbird "Type text"