From 82f3d70224c91fcaef78128b861eec3c2d99da07 Mon Sep 17 00:00:00 2001 From: Adithya Abraham Philip Date: Wed, 3 Jun 2015 19:00:45 +0530 Subject: prevent null fragments on activity death --- .../java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenKeychain/src') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java index 5251f5949..06d824f94 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java @@ -263,7 +263,7 @@ public class ImportKeysActivity extends BaseNfcActivity { // However, if we're being restored from a previous state, // then we don't need to do anything and should return or else // we could end up with overlapping fragments. - if (savedInstanceState != null) { + if (mListFragment != null) { return; } @@ -283,7 +283,7 @@ public class ImportKeysActivity extends BaseNfcActivity { // However, if we're being restored from a previous state, // then we don't need to do anything and should return or else // we could end up with overlapping fragments. - if (savedInstanceState != null) { + if (mTopFragment != null) { return; } @@ -314,7 +314,7 @@ public class ImportKeysActivity extends BaseNfcActivity { // However, if we're being restored from a previous state, // then we don't need to do anything and should return or else // we could end up with overlapping fragments. - if (savedInstanceState != null) { + if (mTopFragment != null) { return; } -- cgit v1.2.3 From 0505af752081b3ca8e28642cb19387532640c118 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Mon, 8 Jun 2015 16:17:39 +0200 Subject: select correct item in drawer on backstack change in main activity --- .../keychain/ui/MainActivity.java | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'OpenKeychain/src') 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 008433f78..f5a909676 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/MainActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/MainActivity.java @@ -23,6 +23,7 @@ import android.content.Intent; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; +import android.support.v4.app.FragmentManager.OnBackStackChangedListener; import android.support.v4.app.FragmentTransaction; import android.support.v7.widget.Toolbar; import android.view.View; @@ -42,7 +43,7 @@ import org.sufficientlysecure.keychain.ui.base.BaseNfcActivity; import org.sufficientlysecure.keychain.util.FabContainer; import org.sufficientlysecure.keychain.util.Preferences; -public class MainActivity extends BaseNfcActivity implements FabContainer { +public class MainActivity extends BaseNfcActivity implements FabContainer, OnBackStackChangedListener { private static final int ID_KEYS = 1; private static final int ID_ENCRYPT_DECRYPT = 2; @@ -121,6 +122,8 @@ public class MainActivity extends BaseNfcActivity implements FabContainer { return; } + getSupportFragmentManager().addOnBackStackChangedListener(this); + Intent data = getIntent(); // If we got an EXTRA_RESULT in the intent, show the notification if (data != null && data.hasExtra(OperationResult.EXTRA_RESULT)) { @@ -206,4 +209,25 @@ public class MainActivity extends BaseNfcActivity implements FabContainer { } + @Override + public void onBackStackChanged() { + FragmentManager fragmentManager = getSupportFragmentManager(); + if (fragmentManager == null) { + return; + } + Fragment frag = fragmentManager.findFragmentById(R.id.main_fragment_container); + if (frag == null) { + return; + } + + // make sure the selected icon is the one shown at this point + if (frag instanceof KeyListFragment) { + mDrawerResult.setSelection(mDrawerResult.getPositionFromIdentifier(ID_KEYS), false); + } else if (frag instanceof EncryptDecryptOverviewFragment) { + mDrawerResult.setSelection(mDrawerResult.getPositionFromIdentifier(ID_ENCRYPT_DECRYPT), false); + } else if (frag instanceof AppsListFragment) { + mDrawerResult.setSelection(mDrawerResult.getPositionFromIdentifier(ID_APPS), false); + } + } + } -- cgit v1.2.3 From 1045deb0e3cb7c3d5953dd9ce1c710ec8c361110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lavergne?= Date: Mon, 8 Jun 2015 16:31:48 -0400 Subject: Explicit mention of dependency on 3rd party tool I had the darnest time remembering my old APG days where something was said in passing about, unlike any other application I know, the need here for OI File Manager (or others, later on) to be able to select local files. I'm sure I'm not the only person who could benefit from this reminder. :) --- OpenKeychain/src/main/res/raw/help_faq.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenKeychain/src') diff --git a/OpenKeychain/src/main/res/raw/help_faq.md b/OpenKeychain/src/main/res/raw/help_faq.md index 049d040e1..4cc7c6996 100644 --- a/OpenKeychain/src/main/res/raw/help_faq.md +++ b/OpenKeychain/src/main/res/raw/help_faq.md @@ -52,7 +52,10 @@ However, scanning a QR code, receiving a key via NFC, or exchanging keys via Saf ## Can I mark public keys as trusted without certifying them with my own key? No. You can, however, simply create a new key just for certification, which will essentially be the same thing. - + +## I see no suitable option in the app selection menu when trying to open a local file, what's wrong? + +You probably don't have any stand-alone file managers installed, like OI File Manager, Astro, ES File Explorer, etc. OpenKeychain needs one in order to select files from local storage or SD card, such as for importing keys or encrypting/decrypting files. # Avanced Questions -- cgit v1.2.3 From 47f98493e291d6769b52c35c13443570650b0d2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Mon, 8 Jun 2015 22:44:26 +0200 Subject: Improve FAQ entry for file manager --- OpenKeychain/src/main/res/raw/help_faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenKeychain/src') diff --git a/OpenKeychain/src/main/res/raw/help_faq.md b/OpenKeychain/src/main/res/raw/help_faq.md index 4cc7c6996..dbfe837c9 100644 --- a/OpenKeychain/src/main/res/raw/help_faq.md +++ b/OpenKeychain/src/main/res/raw/help_faq.md @@ -55,7 +55,7 @@ No. You can, however, simply create a new key just for certification, which will ## I see no suitable option in the app selection menu when trying to open a local file, what's wrong? -You probably don't have any stand-alone file managers installed, like OI File Manager, Astro, ES File Explorer, etc. OpenKeychain needs one in order to select files from local storage or SD card, such as for importing keys or encrypting/decrypting files. +You probably don't have any stand-alone file managers installed, like [OI File Manager](https://f-droid.org/repository/browse/?fdfilter=file+manager&fdid=org.openintents.filemanager) or [Amaze](https://f-droid.org/repository/browse/?fdfilter=file+manager&fdid=com.amaze.filemanager). OpenKeychain needs one in order to select files from local storage or SD card, such as for importing keys or encrypting/decrypting files. # Avanced Questions -- cgit v1.2.3 From e6ea98fabc03f98055aaede3f456f43b294990f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Mon, 8 Jun 2015 22:46:08 +0200 Subject: Improve FAQ entry for file manager --- OpenKeychain/src/main/res/raw/help_faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenKeychain/src') diff --git a/OpenKeychain/src/main/res/raw/help_faq.md b/OpenKeychain/src/main/res/raw/help_faq.md index dbfe837c9..da02a08f1 100644 --- a/OpenKeychain/src/main/res/raw/help_faq.md +++ b/OpenKeychain/src/main/res/raw/help_faq.md @@ -55,7 +55,7 @@ No. You can, however, simply create a new key just for certification, which will ## I see no suitable option in the app selection menu when trying to open a local file, what's wrong? -You probably don't have any stand-alone file managers installed, like [OI File Manager](https://f-droid.org/repository/browse/?fdfilter=file+manager&fdid=org.openintents.filemanager) or [Amaze](https://f-droid.org/repository/browse/?fdfilter=file+manager&fdid=com.amaze.filemanager). OpenKeychain needs one in order to select files from local storage or SD card, such as for importing keys or encrypting/decrypting files. +You probably don't have any stand-alone file managers installed, like [OI File Manager](https://f-droid.org/repository/browse/?fdid=org.openintents.filemanager) or [Amaze](https://f-droid.org/repository/browse/?fdid=com.amaze.filemanager). OpenKeychain needs one in order to select files from local storage or SD card, such as for importing keys or encrypting/decrypting files. # Avanced Questions -- cgit v1.2.3