From 2170069d8adb6472955ec1a444da7fba36015602 Mon Sep 17 00:00:00 2001 From: Thialfihar Date: Wed, 2 Jun 2010 15:33:40 +0000 Subject: [PATCH] force message encrypt/decrypt view if the activities are called via *_AND_RETURN Intents --- .../android/apg/DecryptActivity.java | 19 ++++++++++++++++--- .../android/apg/EncryptActivity.java | 17 +++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/org/thialfihar/android/apg/DecryptActivity.java b/src/org/thialfihar/android/apg/DecryptActivity.java index 99954d752..859bfc3eb 100644 --- a/src/org/thialfihar/android/apg/DecryptActivity.java +++ b/src/org/thialfihar/android/apg/DecryptActivity.java @@ -285,12 +285,25 @@ public class DecryptActivity extends BaseActivity { }); mReplyButton.setVisibility(View.INVISIBLE); - if (mSource.getCurrentView().getId() == R.id.sourceMessage && - mMessage.getText().length() > 0) { - mDecryptButton.performClick(); + if (mReturnResult) { + mSourcePrevious.setClickable(false); + mSourcePrevious.setEnabled(false); + mSourcePrevious.setVisibility(View.INVISIBLE); + + mSourceNext.setClickable(false); + mSourceNext.setEnabled(false); + mSourceNext.setVisibility(View.INVISIBLE); + + mSourceLabel.setClickable(false); + mSourceLabel.setEnabled(false); } updateSource(); + + if (mSource.getCurrentView().getId() == R.id.sourceMessage && + mMessage.getText().length() > 0) { + mDecryptButton.performClick(); + } } private void openFile() { diff --git a/src/org/thialfihar/android/apg/EncryptActivity.java b/src/org/thialfihar/android/apg/EncryptActivity.java index 3dae55cef..1a1ce7f13 100644 --- a/src/org/thialfihar/android/apg/EncryptActivity.java +++ b/src/org/thialfihar/android/apg/EncryptActivity.java @@ -347,6 +347,23 @@ public class EncryptActivity extends BaseActivity { updateSource(); updateMode(); + if (mReturnResult) { + mSourcePrevious.setClickable(false); + mSourcePrevious.setEnabled(false); + mSourcePrevious.setVisibility(View.INVISIBLE); + + mSourceNext.setClickable(false); + mSourceNext.setEnabled(false); + mSourceNext.setVisibility(View.INVISIBLE); + + mSourceLabel.setClickable(false); + mSourceLabel.setEnabled(false); + + mEncryptToClipboardButton.setEnabled(false); + mEncryptToClipboardButton.setVisibility(View.INVISIBLE); + mEncryptButton.setText(R.string.btn_encrypt); + } + if (mMessage.getText().length() > 0 && ((mEncryptionKeyIds != null && mEncryptionKeyIds.length > 0) ||