aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain
diff options
context:
space:
mode:
authormj7007 <mj7007@gmail.com>2014-03-04 13:57:20 +0530
committermj7007 <mj7007@gmail.com>2014-03-04 13:57:48 +0530
commite4461b788f85d30b0549a6e7df5e9b1d4097b033 (patch)
tree0cf9f745bed2c06a2a12f2647c34a4826aee2061 /OpenPGP-Keychain
parent6dabe9bf7f2c02acac96d50feb724427b9d6f9c5 (diff)
downloadopen-keychain-e4461b788f85d30b0549a6e7df5e9b1d4097b033.tar.gz
open-keychain-e4461b788f85d30b0549a6e7df5e9b1d4097b033.tar.bz2
open-keychain-e4461b788f85d30b0549a6e7df5e9b1d4097b033.zip
Smooth Activity Switch Fixed
Diffstat (limited to 'OpenPGP-Keychain')
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/DrawerActivity.java23
1 files changed, 15 insertions, 8 deletions
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 53a57c4cd..08ca262c3 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
@@ -19,6 +19,7 @@ package org.sufficientlysecure.keychain.ui;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.service.remote.RegisteredAppsListActivity;
+import org.sufficientlysecure.keychain.util.Log;
import android.app.Activity;
import android.content.Context;
@@ -52,6 +53,7 @@ public class DrawerActivity extends ActionBarActivity {
private static Class[] mItemsClass = new Class[] { KeyListPublicActivity.class,
EncryptActivity.class, DecryptActivity.class, ImportKeysActivity.class,
KeyListSecretActivity.class, RegisteredAppsListActivity.class };
+ private Class mSelectedItem;
private static final int MENU_ID_PREFERENCE = 222;
private static final int MENU_ID_HELP = 223;
@@ -94,6 +96,17 @@ public class DrawerActivity extends ActionBarActivity {
getSupportActionBar().setTitle(mTitle);
// creates call to onPrepareOptionsMenu()
supportInvalidateOptionsMenu();
+
+ // call intent activity if selected
+ if(mSelectedItem != null) {
+ finish();
+ overridePendingTransition(0, 0);
+
+ Intent intent = new Intent(DrawerActivity.this, mSelectedItem);
+ startActivity(intent);
+ // disable animation of activity start
+ overridePendingTransition(0, 0);
+ }
}
public void onDrawerOpened(View drawerView) {
@@ -182,14 +195,8 @@ public class DrawerActivity extends ActionBarActivity {
mDrawerList.setItemChecked(position, true);
// setTitle(mDrawerTitles[position]);
mDrawerLayout.closeDrawer(mDrawerList);
-
- finish();
- overridePendingTransition(0, 0);
-
- Intent intent = new Intent(this, mItemsClass[position]);
- startActivity(intent);
- // disable animation of activity start
- overridePendingTransition(0, 0);
+ // set selected class
+ mSelectedItem = mItemsClass[position];
}
/**