aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain
diff options
context:
space:
mode:
Diffstat (limited to 'OpenPGP-Keychain')
-rw-r--r--OpenPGP-Keychain/src/main/AndroidManifest.xml7
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/Constants.java5
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/DrawerActivity.java3
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java8
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListActivity.java9
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java2
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java2
-rw-r--r--OpenPGP-Keychain/src/main/res/menu/key_list.xml31
8 files changed, 32 insertions, 35 deletions
diff --git a/OpenPGP-Keychain/src/main/AndroidManifest.xml b/OpenPGP-Keychain/src/main/AndroidManifest.xml
index e588817e7..835d708b5 100644
--- a/OpenPGP-Keychain/src/main/AndroidManifest.xml
+++ b/OpenPGP-Keychain/src/main/AndroidManifest.xml
@@ -98,12 +98,12 @@
android:name=".ui.SelectPublicKeyActivity"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
android:label="@string/title_select_recipients"
- android:launchMode="singleTop"></activity>
+ android:launchMode="singleTop" />
<activity
android:name=".ui.SelectSecretKeyActivity"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
android:label="@string/title_select_secret_key"
- android:launchMode="singleTop"></activity>
+ android:launchMode="singleTop" />
<activity
android:name=".ui.EncryptActivity"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
@@ -361,6 +361,9 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
+ <meta-data
+ android:name="android.support.PARENT_ACTIVITY"
+ android:value=".ui.KeyListActivity" />
</activity>
<activity
android:name=".ui.HelpActivity"
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/Constants.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/Constants.java
index 5b9f53b09..b3bfaa229 100644
--- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/Constants.java
+++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/Constants.java
@@ -48,8 +48,7 @@ public final class Constants {
public static final class Path {
public static final String APP_DIR = Environment.getExternalStorageDirectory()
+ "/OpenKeychain";
- public static final String APP_DIR_FILE_SEC = APP_DIR + "/secexport.asc";
- public static final String APP_DIR_FILE_PUB = APP_DIR + "/pubexport.asc";
+ public static final String APP_DIR_FILE = APP_DIR + "/export.asc";
}
public static final class Pref {
@@ -72,13 +71,11 @@ public final class Constants {
public static final Class KEY_LIST = KeyListActivity.class;
public static final Class ENCRYPT = EncryptActivity.class;
public static final Class DECRYPT = DecryptActivity.class;
- public static final Class IMPORT_KEYS = ImportKeysActivity.class;
public static final Class REGISTERED_APPS_LIST = AppsListActivity.class;
public static final Class[] ARRAY = new Class[]{
KEY_LIST,
ENCRYPT,
DECRYPT,
- IMPORT_KEYS,
REGISTERED_APPS_LIST
};
}
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/DrawerActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/DrawerActivity.java
index f81224380..c875818e3 100644
--- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/DrawerActivity.java
+++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/DrawerActivity.java
@@ -81,7 +81,6 @@ public class DrawerActivity extends ActionBarActivity {
new NavItem("fa-user", getString(R.string.nav_contacts)),
new NavItem("fa-lock", getString(R.string.nav_encrypt)),
new NavItem("fa-unlock", getString(R.string.nav_decrypt)),
- new NavItem("fa-download", getString(R.string.nav_import)),
new NavItem("fa-android", getString(R.string.nav_apps))};
mDrawerList.setAdapter(new NavigationDrawerAdapter(this, R.layout.drawer_list_item,
@@ -264,7 +263,7 @@ public class DrawerActivity extends ActionBarActivity {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row = convertView;
- NavItemHolder holder = null;
+ NavItemHolder holder;
if (row == null) {
LayoutInflater inflater = ((Activity) mContext).getLayoutInflater();
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java
index 9b8b92136..6ea79473a 100644
--- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java
+++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java
@@ -32,6 +32,7 @@ import android.os.Parcelable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.ActionBar;
+import android.support.v7.app.ActionBarActivity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
@@ -41,6 +42,7 @@ import com.devspark.appmsg.AppMsg;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
+import org.sufficientlysecure.keychain.helper.ActionBarHelper;
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
import org.sufficientlysecure.keychain.service.KeychainIntentService;
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
@@ -51,7 +53,7 @@ import org.sufficientlysecure.keychain.util.Log;
import java.util.ArrayList;
import java.util.Locale;
-public class ImportKeysActivity extends DrawerActivity implements ActionBar.OnNavigationListener {
+public class ImportKeysActivity extends ActionBarActivity implements ActionBar.OnNavigationListener {
public static final String ACTION_IMPORT_KEY = Constants.INTENT_PREFIX + "IMPORT_KEY";
public static final String ACTION_IMPORT_KEY_FROM_QR_CODE = Constants.INTENT_PREFIX
+ "IMPORT_KEY_FROM_QR_CODE";
@@ -113,10 +115,9 @@ public class ImportKeysActivity extends DrawerActivity implements ActionBar.OnNa
if (ACTION_IMPORT_KEY_FROM_KEYSERVER_AND_RETURN.equals(getIntent().getAction())) {
setTitle(R.string.nav_import);
} else {
+ ActionBarHelper.setBackButton(this);
getSupportActionBar().setDisplayShowTitleEnabled(false);
- setupDrawerNavigation(savedInstanceState);
-
// set drop down navigation
Context context = getSupportActionBar().getThemedContext();
ArrayAdapter<CharSequence> navigationAdapter = ArrayAdapter.createFromResource(context,
@@ -128,7 +129,6 @@ public class ImportKeysActivity extends DrawerActivity implements ActionBar.OnNa
handleActions(savedInstanceState, getIntent());
}
-
protected void handleActions(Bundle savedInstanceState, Intent intent) {
String action = intent.getAction();
Bundle extras = intent.getExtras();
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListActivity.java
index 1bc6d4ee1..8db643583 100644
--- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListActivity.java
+++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListActivity.java
@@ -53,7 +53,7 @@ public class KeyListActivity extends DrawerActivity {
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_key_list_import:
- callIntentForDrawerItem(Constants.DrawerItems.IMPORT_KEYS);
+ importKeys();
return true;
case R.id.menu_key_list_create:
@@ -65,7 +65,7 @@ public class KeyListActivity extends DrawerActivity {
return true;
case R.id.menu_key_list_export:
- mExportHelper.showExportKeysDialog(null, Constants.Path.APP_DIR_FILE_PUB, true);
+ mExportHelper.showExportKeysDialog(null, Constants.Path.APP_DIR_FILE, true);
return true;
default:
@@ -73,6 +73,11 @@ public class KeyListActivity extends DrawerActivity {
}
}
+ private void importKeys() {
+ Intent intent = new Intent(this, ImportKeysActivity.class);
+ startActivityForResult(intent, 0);
+ }
+
private void createKey() {
Intent intent = new Intent(this, EditKeyActivity.class);
intent.setAction(EditKeyActivity.ACTION_CREATE_KEY);
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java
index 1d8f7c8ad..425f5f036 100644
--- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java
+++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java
@@ -193,7 +193,7 @@ public class KeyListFragment extends Fragment
ids = mAdapter.getCurrentSelectedMasterKeyIds();
ExportHelper mExportHelper = new ExportHelper((ActionBarActivity) getActivity());
mExportHelper.showExportKeysDialog(
- ids, Constants.Path.APP_DIR_FILE_PUB, mAdapter.isAnySecretSelected());
+ ids, Constants.Path.APP_DIR_FILE, mAdapter.isAnySecretSelected());
break;
}
case R.id.menu_key_list_multi_select_all: {
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java
index 7f4e97937..cce34139c 100644
--- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java
+++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java
@@ -159,7 +159,7 @@ public class ViewKeyActivity extends ActionBarActivity {
mExportHelper.showExportKeysDialog(
new long[]{(Long) data.get(KeychainContract.KeyRings.MASTER_KEY_ID)},
- Constants.Path.APP_DIR_FILE_PUB,
+ Constants.Path.APP_DIR_FILE,
((Long) data.get(KeychainContract.KeyRings.HAS_SECRET) == 1)
);
}
diff --git a/OpenPGP-Keychain/src/main/res/menu/key_list.xml b/OpenPGP-Keychain/src/main/res/menu/key_list.xml
index 9f285388b..3f80b616d 100644
--- a/OpenPGP-Keychain/src/main/res/menu/key_list.xml
+++ b/OpenPGP-Keychain/src/main/res/menu/key_list.xml
@@ -10,27 +10,10 @@
app:showAsAction="collapseActionView|ifRoom" />
<item
- android:id="@+id/menu_key_list_add"
+ android:id="@+id/menu_key_list_import"
app:showAsAction="ifRoom|withText"
android:icon="@drawable/ic_action_add_person"
- android:title="@string/menu_add_keys">
- <menu>
- <item
- android:id="@+id/menu_key_list_import"
- app:showAsAction="never"
- android:title="@string/menu_import" />
-
- <item
- android:id="@+id/menu_key_list_create"
- app:showAsAction="never"
- android:title="@string/menu_create_key" />
-
- <item
- android:id="@+id/menu_key_list_create_expert"
- app:showAsAction="never"
- android:title="@string/menu_create_key_expert" />
- </menu>
- </item>
+ android:title="@string/menu_add_keys" />
<item
android:id="@+id/menu_key_list_export"
@@ -38,4 +21,14 @@
android:icon="@drawable/ic_action_import_export"
android:title="@string/menu_export_all_keys" />
+ <item
+ android:id="@+id/menu_key_list_create"
+ app:showAsAction="never"
+ android:title="@string/menu_create_key" />
+
+ <item
+ android:id="@+id/menu_key_list_create_expert"
+ app:showAsAction="never"
+ android:title="@string/menu_create_key_expert" />
+
</menu>