From 536133daf1f58dd8b4c5e6d43249272979433db5 Mon Sep 17 00:00:00 2001 From: Bao-Long Nguyen-Trong Date: Thu, 14 May 2009 00:03:19 +0000 Subject: [PATCH] . Fixed issue 419 . Moved signature to the bottom of the message body view so that it is not editable TODO: Add signature location preference / settings --- .../email/activity/MessageCompose.java | 38 +++++++++++++------ 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/src/com/android/email/activity/MessageCompose.java b/src/com/android/email/activity/MessageCompose.java index c06af0623..b9a5e073d 100644 --- a/src/com/android/email/activity/MessageCompose.java +++ b/src/com/android/email/activity/MessageCompose.java @@ -480,6 +480,13 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus mMessageContentView.requestFocus(); } + if (!ACTION_EDIT_DRAFT.equals(action)) { + String signature = getSignature(); + if (signature!=null) { + mMessageContentView.setText(signature); + } + } + addAddress(mBccView, new Address(mAccount.getAlwaysBcc(), "")); updateTitle(); } @@ -597,12 +604,9 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus */ String text = mMessageContentView.getText().toString(); - if (!this.mSourceMessageProcessed) { - text = appendSignature(text); - } - + + String action = getIntent().getAction(); if (mQuotedTextBar.getVisibility() == View.VISIBLE) { - String action = getIntent().getAction(); String quotedText = null; Part part = MimeUtility.findFirstPartByMimeType(mSourceMessage, "text/plain"); @@ -632,6 +636,17 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus } } + /* + * Place holder for when we implement the signature location preference / setting + * + if (!ACTION_EDIT_DRAFT.equals(action)) { + String signature = getSignature(); + if (signature!=null) { + text += signature; + } + } + */ + TextBody body = new TextBody(text); if (mAttachments.getChildCount() > 0) { @@ -672,15 +687,16 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus return message; } - private String appendSignature (String text) { + private String getSignature() { String mSignature; mSignature = mAccount.getSignature(); - - if (mSignature != null && ! mSignature.contentEquals("")){ - text += "\n-- \n" + mAccount.getSignature(); - } - return text; + if (mSignature != null && !mSignature.contentEquals("")) { + return "\n--\n" + mAccount.getSignature(); + } + else { + return null; + } }