diff --git a/OpenKeychain/src/main/AndroidManifest.xml b/OpenKeychain/src/main/AndroidManifest.xml index 19b775149..d5db3c2da 100644 --- a/OpenKeychain/src/main/AndroidManifest.xml +++ b/OpenKeychain/src/main/AndroidManifest.xml @@ -195,7 +195,7 @@ - - - - - - - + + + + + + + + diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFilesActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java similarity index 94% rename from OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFilesActivity.java rename to OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java index 672015aaa..aba680807 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFilesActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptActivity.java @@ -34,10 +34,12 @@ import org.sufficientlysecure.keychain.intents.OpenKeychainIntents; import org.sufficientlysecure.keychain.ui.base.BaseActivity; -public class DecryptFilesActivity extends BaseActivity { +public class DecryptActivity extends BaseActivity { /* Intents */ public static final String ACTION_DECRYPT_DATA = OpenKeychainIntents.DECRYPT_DATA; + // TODO handle this intent + public static final String ACTION_DECRYPT_TEXT = OpenKeychainIntents.DECRYPT_TEXT; // intern public static final String ACTION_DECRYPT_DATA_OPEN = Constants.INTENT_PREFIX + "DECRYPT_DATA_OPEN"; @@ -77,6 +79,7 @@ public class DecryptFilesActivity extends BaseActivity { String action = intent.getAction(); + // TODO handle ACTION_DECRYPT_FROM_CLIPBOARD switch (action) { case Intent.ACTION_SEND: { // When sending to Keychain Decrypt via share menu @@ -131,7 +134,7 @@ public class DecryptFilesActivity extends BaseActivity { public void displayListFragment(ArrayList inputUris) { - DecryptFilesListFragment frag = DecryptFilesListFragment.newInstance(inputUris); + DecryptListFragment frag = DecryptListFragment.newInstance(inputUris); FragmentManager fragMan = getSupportFragmentManager(); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFilesInputFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFilesInputFragment.java index 2b9219f49..9a0d95bb4 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFilesInputFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFilesInputFragment.java @@ -127,7 +127,7 @@ public class DecryptFilesInputFragment extends Fragment { return; } - DecryptFilesActivity activity = (DecryptFilesActivity) getActivity(); + DecryptActivity activity = (DecryptActivity) getActivity(); ArrayList uris = new ArrayList<>(); uris.add(mInputUri); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFilesListFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptListFragment.java similarity index 98% rename from OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFilesListFragment.java rename to OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptListFragment.java index 35f534c90..65d0fc8cf 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFilesListFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptListFragment.java @@ -60,7 +60,7 @@ import org.sufficientlysecure.keychain.provider.TemporaryStorageProvider; // this import NEEDS to be above the ViewModel one, or it won't compile! (as of 06/06/15) import org.sufficientlysecure.keychain.service.input.CryptoInputParcel; import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils.StatusHolder; -import org.sufficientlysecure.keychain.ui.DecryptFilesListFragment.DecryptFilesAdapter.ViewModel; +import org.sufficientlysecure.keychain.ui.DecryptListFragment.DecryptFilesAdapter.ViewModel; import org.sufficientlysecure.keychain.ui.adapter.SpacesItemDecoration; import org.sufficientlysecure.keychain.ui.base.CryptoOperationFragment; import org.sufficientlysecure.keychain.ui.util.FormattingUtils; @@ -70,7 +70,7 @@ import org.sufficientlysecure.keychain.ui.util.Notify.Style; import org.sufficientlysecure.keychain.util.FileHelper; import org.sufficientlysecure.keychain.util.Log; -public class DecryptFilesListFragment +public class DecryptListFragment extends CryptoOperationFragment implements OnMenuItemClickListener { public static final String ARG_URIS = "uris"; @@ -88,8 +88,8 @@ public class DecryptFilesListFragment /** * Creates new instance of this fragment */ - public static DecryptFilesListFragment newInstance(ArrayList uris) { - DecryptFilesListFragment frag = new DecryptFilesListFragment(); + public static DecryptListFragment newInstance(ArrayList uris) { + DecryptListFragment frag = new DecryptListFragment(); Bundle args = new Bundle(); args.putParcelableArrayList(ARG_URIS, uris); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptTextActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DisplayTextActivity.java similarity index 97% rename from OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptTextActivity.java rename to OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DisplayTextActivity.java index 0c463c2cd..5c44e345e 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptTextActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DisplayTextActivity.java @@ -38,7 +38,9 @@ import org.sufficientlysecure.keychain.util.Log; import java.util.regex.Matcher; -public class DecryptTextActivity extends BaseActivity { +public class DisplayTextActivity extends BaseActivity { + + // TODO make this only display text (maybe we need only the fragment?) /* Intents */ public static final String ACTION_DECRYPT_TEXT = OpenKeychainIntents.DECRYPT_TEXT; @@ -214,7 +216,7 @@ public class DecryptTextActivity extends BaseActivity { private void loadFragment(String ciphertext) { // Create an instance of the fragment - Fragment frag = DecryptTextFragment.newInstance(ciphertext); + Fragment frag = DisplayTextFragment.newInstance(ciphertext); // Add the fragment to the 'fragment_container' FrameLayout // NOTE: We use commitAllowingStateLoss() to prevent weird crashes! diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptTextFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DisplayTextFragment.java similarity index 97% rename from OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptTextFragment.java rename to OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DisplayTextFragment.java index 051da5d6b..cd75e2bc3 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptTextFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DisplayTextFragment.java @@ -37,7 +37,7 @@ import org.sufficientlysecure.keychain.util.ShareHelper; import java.io.UnsupportedEncodingException; -public class DecryptTextFragment extends DecryptFragment { +public class DisplayTextFragment extends DecryptFragment { public static final String ARG_CIPHERTEXT = "ciphertext"; public static final String ARG_SHOW_MENU = "show_menu"; @@ -48,8 +48,8 @@ public class DecryptTextFragment extends DecryptFragment { private String mCiphertext; private boolean mShowMenuOptions; - public static DecryptTextFragment newInstance(String ciphertext) { - DecryptTextFragment frag = new DecryptTextFragment(); + public static DisplayTextFragment newInstance(String ciphertext) { + DisplayTextFragment frag = new DisplayTextFragment(); Bundle args = new Bundle(); args.putString(ARG_CIPHERTEXT, ciphertext); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptDecryptOverviewFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptDecryptOverviewFragment.java index a6fad8881..c4007b214 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptDecryptOverviewFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptDecryptOverviewFragment.java @@ -74,8 +74,8 @@ public class EncryptDecryptOverviewFragment extends Fragment { mDecryptFile.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - Intent filesDecrypt = new Intent(getActivity(), DecryptFilesActivity.class); - filesDecrypt.setAction(DecryptFilesActivity.ACTION_DECRYPT_DATA_OPEN); + Intent filesDecrypt = new Intent(getActivity(), DecryptActivity.class); + filesDecrypt.setAction(DecryptActivity.ACTION_DECRYPT_DATA_OPEN); startActivity(filesDecrypt); } }); @@ -83,8 +83,8 @@ public class EncryptDecryptOverviewFragment extends Fragment { mDecryptFromClipboard.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - Intent clipboardDecrypt = new Intent(getActivity(), DecryptTextActivity.class); - clipboardDecrypt.setAction(DecryptTextActivity.ACTION_DECRYPT_FROM_CLIPBOARD); + Intent clipboardDecrypt = new Intent(getActivity(), DisplayTextActivity.class); + clipboardDecrypt.setAction(DisplayTextActivity.ACTION_DECRYPT_FROM_CLIPBOARD); startActivityForResult(clipboardDecrypt, 0); } });