rename activities to match new purpose

This commit is contained in:
Vincent Breitmoser 2015-06-18 16:25:18 +02:00
parent 0cfbe4ad06
commit 5e5febaee3
7 changed files with 31 additions and 25 deletions

View File

@ -195,7 +195,7 @@
</intent-filter> </intent-filter>
</activity> </activity>
<activity <activity
android:name=".ui.DecryptTextActivity" android:name=".ui.DisplayTextActivity"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard" android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
android:label="@string/title_decrypt" android:label="@string/title_decrypt"
android:parentActivityName=".ui.MainActivity" android:parentActivityName=".ui.MainActivity"
@ -203,16 +203,9 @@
<meta-data <meta-data
android:name="android.support.PARENT_ACTIVITY" android:name="android.support.PARENT_ACTIVITY"
android:value=".ui.MainActivity" /> android:value=".ui.MainActivity" />
<!-- DECRYPT_TEXT with text as extra -->
<intent-filter>
<action android:name="org.sufficientlysecure.keychain.action.DECRYPT_TEXT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity> </activity>
<activity <activity
android:name=".ui.DecryptFilesActivity" android:name=".ui.DecryptActivity"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard" android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
android:label="@string/title_decrypt" android:label="@string/title_decrypt"
android:parentActivityName=".ui.MainActivity" android:parentActivityName=".ui.MainActivity"
@ -257,6 +250,14 @@
<data android:scheme="file" /> <data android:scheme="file" />
<data android:scheme="content" /> <data android:scheme="content" />
</intent-filter> </intent-filter>
<!-- DECRYPT_TEXT -->
<intent-filter>
<action android:name="org.sufficientlysecure.keychain.action.DECRYPT_TEXT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<!-- Android's Send and Multi-Send Actions --> <!-- Android's Send and Multi-Send Actions -->
<intent-filter android:label="@string/intent_send_decrypt"> <intent-filter android:label="@string/intent_send_decrypt">
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />

View File

@ -34,10 +34,12 @@ import org.sufficientlysecure.keychain.intents.OpenKeychainIntents;
import org.sufficientlysecure.keychain.ui.base.BaseActivity; import org.sufficientlysecure.keychain.ui.base.BaseActivity;
public class DecryptFilesActivity extends BaseActivity { public class DecryptActivity extends BaseActivity {
/* Intents */ /* Intents */
public static final String ACTION_DECRYPT_DATA = OpenKeychainIntents.DECRYPT_DATA; 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 // intern
public static final String ACTION_DECRYPT_DATA_OPEN = Constants.INTENT_PREFIX + "DECRYPT_DATA_OPEN"; 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(); String action = intent.getAction();
// TODO handle ACTION_DECRYPT_FROM_CLIPBOARD
switch (action) { switch (action) {
case Intent.ACTION_SEND: { case Intent.ACTION_SEND: {
// When sending to Keychain Decrypt via share menu // When sending to Keychain Decrypt via share menu
@ -131,7 +134,7 @@ public class DecryptFilesActivity extends BaseActivity {
public void displayListFragment(ArrayList<Uri> inputUris) { public void displayListFragment(ArrayList<Uri> inputUris) {
DecryptFilesListFragment frag = DecryptFilesListFragment.newInstance(inputUris); DecryptListFragment frag = DecryptListFragment.newInstance(inputUris);
FragmentManager fragMan = getSupportFragmentManager(); FragmentManager fragMan = getSupportFragmentManager();

View File

@ -127,7 +127,7 @@ public class DecryptFilesInputFragment extends Fragment {
return; return;
} }
DecryptFilesActivity activity = (DecryptFilesActivity) getActivity(); DecryptActivity activity = (DecryptActivity) getActivity();
ArrayList<Uri> uris = new ArrayList<>(); ArrayList<Uri> uris = new ArrayList<>();
uris.add(mInputUri); uris.add(mInputUri);

View File

@ -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) // 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.service.input.CryptoInputParcel;
import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils.StatusHolder; 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.adapter.SpacesItemDecoration;
import org.sufficientlysecure.keychain.ui.base.CryptoOperationFragment; import org.sufficientlysecure.keychain.ui.base.CryptoOperationFragment;
import org.sufficientlysecure.keychain.ui.util.FormattingUtils; 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.FileHelper;
import org.sufficientlysecure.keychain.util.Log; import org.sufficientlysecure.keychain.util.Log;
public class DecryptFilesListFragment public class DecryptListFragment
extends CryptoOperationFragment<PgpDecryptVerifyInputParcel,DecryptVerifyResult> extends CryptoOperationFragment<PgpDecryptVerifyInputParcel,DecryptVerifyResult>
implements OnMenuItemClickListener { implements OnMenuItemClickListener {
public static final String ARG_URIS = "uris"; public static final String ARG_URIS = "uris";
@ -88,8 +88,8 @@ public class DecryptFilesListFragment
/** /**
* Creates new instance of this fragment * Creates new instance of this fragment
*/ */
public static DecryptFilesListFragment newInstance(ArrayList<Uri> uris) { public static DecryptListFragment newInstance(ArrayList<Uri> uris) {
DecryptFilesListFragment frag = new DecryptFilesListFragment(); DecryptListFragment frag = new DecryptListFragment();
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putParcelableArrayList(ARG_URIS, uris); args.putParcelableArrayList(ARG_URIS, uris);

View File

@ -38,7 +38,9 @@ import org.sufficientlysecure.keychain.util.Log;
import java.util.regex.Matcher; 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 */ /* Intents */
public static final String ACTION_DECRYPT_TEXT = OpenKeychainIntents.DECRYPT_TEXT; public static final String ACTION_DECRYPT_TEXT = OpenKeychainIntents.DECRYPT_TEXT;
@ -214,7 +216,7 @@ public class DecryptTextActivity extends BaseActivity {
private void loadFragment(String ciphertext) { private void loadFragment(String ciphertext) {
// Create an instance of the fragment // Create an instance of the fragment
Fragment frag = DecryptTextFragment.newInstance(ciphertext); Fragment frag = DisplayTextFragment.newInstance(ciphertext);
// Add the fragment to the 'fragment_container' FrameLayout // Add the fragment to the 'fragment_container' FrameLayout
// NOTE: We use commitAllowingStateLoss() to prevent weird crashes! // NOTE: We use commitAllowingStateLoss() to prevent weird crashes!

View File

@ -37,7 +37,7 @@ import org.sufficientlysecure.keychain.util.ShareHelper;
import java.io.UnsupportedEncodingException; 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_CIPHERTEXT = "ciphertext";
public static final String ARG_SHOW_MENU = "show_menu"; public static final String ARG_SHOW_MENU = "show_menu";
@ -48,8 +48,8 @@ public class DecryptTextFragment extends DecryptFragment {
private String mCiphertext; private String mCiphertext;
private boolean mShowMenuOptions; private boolean mShowMenuOptions;
public static DecryptTextFragment newInstance(String ciphertext) { public static DisplayTextFragment newInstance(String ciphertext) {
DecryptTextFragment frag = new DecryptTextFragment(); DisplayTextFragment frag = new DisplayTextFragment();
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putString(ARG_CIPHERTEXT, ciphertext); args.putString(ARG_CIPHERTEXT, ciphertext);

View File

@ -74,8 +74,8 @@ public class EncryptDecryptOverviewFragment extends Fragment {
mDecryptFile.setOnClickListener(new View.OnClickListener() { mDecryptFile.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
Intent filesDecrypt = new Intent(getActivity(), DecryptFilesActivity.class); Intent filesDecrypt = new Intent(getActivity(), DecryptActivity.class);
filesDecrypt.setAction(DecryptFilesActivity.ACTION_DECRYPT_DATA_OPEN); filesDecrypt.setAction(DecryptActivity.ACTION_DECRYPT_DATA_OPEN);
startActivity(filesDecrypt); startActivity(filesDecrypt);
} }
}); });
@ -83,8 +83,8 @@ public class EncryptDecryptOverviewFragment extends Fragment {
mDecryptFromClipboard.setOnClickListener(new View.OnClickListener() { mDecryptFromClipboard.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
Intent clipboardDecrypt = new Intent(getActivity(), DecryptTextActivity.class); Intent clipboardDecrypt = new Intent(getActivity(), DisplayTextActivity.class);
clipboardDecrypt.setAction(DecryptTextActivity.ACTION_DECRYPT_FROM_CLIPBOARD); clipboardDecrypt.setAction(DisplayTextActivity.ACTION_DECRYPT_FROM_CLIPBOARD);
startActivityForResult(clipboardDecrypt, 0); startActivityForResult(clipboardDecrypt, 0);
} }
}); });