mirror of
https://github.com/moparisthebest/k-9
synced 2024-12-26 09:38:52 -05:00
Fixed issue 663: The source message of the reply was re-loaded every time the screen is rotated populating all fields on top of the framework handling the screen rotation
This commit is contained in:
parent
96388531bd
commit
4e2ba837aa
@ -258,6 +258,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
context.startActivity(i);
|
context.startActivity(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
@ -268,7 +269,6 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
mAddressAdapter = new EmailAddressAdapter(this);
|
mAddressAdapter = new EmailAddressAdapter(this);
|
||||||
mAddressValidator = new EmailAddressValidator();
|
mAddressValidator = new EmailAddressValidator();
|
||||||
|
|
||||||
|
|
||||||
mFromView = (TextView)findViewById(R.id.from);
|
mFromView = (TextView)findViewById(R.id.from);
|
||||||
mToView = (MultiAutoCompleteTextView)findViewById(R.id.to);
|
mToView = (MultiAutoCompleteTextView)findViewById(R.id.to);
|
||||||
mCcView = (MultiAutoCompleteTextView)findViewById(R.id.cc);
|
mCcView = (MultiAutoCompleteTextView)findViewById(R.id.cc);
|
||||||
@ -278,7 +278,6 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
EditText upperSignature = (EditText)findViewById(R.id.upper_signature);
|
EditText upperSignature = (EditText)findViewById(R.id.upper_signature);
|
||||||
EditText lowerSignature = (EditText)findViewById(R.id.lower_signature);
|
EditText lowerSignature = (EditText)findViewById(R.id.lower_signature);
|
||||||
|
|
||||||
|
|
||||||
mMessageContentView = (EditText)findViewById(R.id.message_content);
|
mMessageContentView = (EditText)findViewById(R.id.message_content);
|
||||||
mAttachments = (LinearLayout)findViewById(R.id.attachments);
|
mAttachments = (LinearLayout)findViewById(R.id.attachments);
|
||||||
mQuotedTextBar = findViewById(R.id.quoted_text_bar);
|
mQuotedTextBar = findViewById(R.id.quoted_text_bar);
|
||||||
@ -496,42 +495,45 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
upperSignature.setVisibility(View.GONE);
|
upperSignature.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
mSignatureView.addTextChangedListener(sigwatcher);
|
mSignatureView.addTextChangedListener(sigwatcher);
|
||||||
|
|
||||||
updateFrom();
|
if (!mSourceMessageProcessed) {
|
||||||
updateSignature();
|
updateFrom();
|
||||||
|
updateSignature();
|
||||||
if (ACTION_REPLY.equals(action) || ACTION_REPLY_ALL.equals(action) || ACTION_FORWARD.equals(action) || ACTION_EDIT_DRAFT.equals(action)) {
|
|
||||||
/*
|
if (ACTION_REPLY.equals(action) || ACTION_REPLY_ALL.equals(action) || ACTION_FORWARD.equals(action) || ACTION_EDIT_DRAFT.equals(action)) {
|
||||||
* If we need to load the message we add ourself as a message listener here
|
/*
|
||||||
* so we can kick it off. Normally we add in onResume but we don't
|
* If we need to load the message we add ourself as a message listener here
|
||||||
* want to reload the message every time the activity is resumed.
|
* so we can kick it off. Normally we add in onResume but we don't
|
||||||
* There is no harm in adding twice.
|
* want to reload the message every time the activity is resumed.
|
||||||
*/
|
* There is no harm in adding twice.
|
||||||
MessagingController.getInstance(getApplication()).addListener(mListener);
|
*/
|
||||||
MessagingController.getInstance(getApplication()).loadMessageForView( mAccount, mFolder, mSourceMessageUid, null);
|
MessagingController.getInstance(getApplication()).addListener(mListener);
|
||||||
|
MessagingController.getInstance(getApplication()).loadMessageForView( mAccount, mFolder, mSourceMessageUid, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ACTION_EDIT_DRAFT.equals(action)) {
|
||||||
|
String bccAddress = mAccount.getAlwaysBcc();
|
||||||
|
if (bccAddress!=null
|
||||||
|
&& !"".equals(bccAddress)) {
|
||||||
|
addAddress(mBccView, new Address(mAccount.getAlwaysBcc(), ""));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Log.d(Email.LOG_TAG, "action = " + action + ", mAccount = " + mAccount + ", mFolder = " + mFolder + ", mSourceMessageUid = " + mSourceMessageUid);
|
||||||
|
if ((ACTION_REPLY.equals(action) || ACTION_REPLY_ALL.equals(action)) && mAccount != null && mFolder != null && mSourceMessageUid != null) {
|
||||||
|
Log.d(Email.LOG_TAG, "Setting message ANSWERED flag to true");
|
||||||
|
// TODO: Really, we should wait until we send the message, but that would require saving the original
|
||||||
|
// message info along with a Draft copy, in case it is left in Drafts for a while before being sent
|
||||||
|
MessagingController.getInstance(getApplication()).setMessageFlag(mAccount, mFolder, mSourceMessageUid, Flag.ANSWERED, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ACTION_REPLY.equals(action) || ACTION_REPLY_ALL.equals(action) || ACTION_EDIT_DRAFT.equals(action)) {
|
if (ACTION_REPLY.equals(action) || ACTION_REPLY_ALL.equals(action) || ACTION_EDIT_DRAFT.equals(action)) {
|
||||||
//change focus to message body.
|
//change focus to message body.
|
||||||
mMessageContentView.requestFocus();
|
mMessageContentView.requestFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ACTION_EDIT_DRAFT.equals(action)) {
|
|
||||||
String bccAddress = mAccount.getAlwaysBcc();
|
|
||||||
if (bccAddress!=null
|
|
||||||
&& !"".equals(bccAddress)) {
|
|
||||||
addAddress(mBccView, new Address(mAccount.getAlwaysBcc(), ""));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Log.d(Email.LOG_TAG, "action = " + action + ", mAccount = " + mAccount + ", mFolder = " + mFolder + ", mSourceMessageUid = " + mSourceMessageUid);
|
|
||||||
if ((ACTION_REPLY.equals(action) || ACTION_REPLY_ALL.equals(action)) && mAccount != null && mFolder != null && mSourceMessageUid != null) {
|
|
||||||
Log.d(Email.LOG_TAG, "Setting message ANSWERED flag to true");
|
|
||||||
// TODO: Really, we should wait until we send the message, but that would require saving the original
|
|
||||||
// message info along with a Draft copy, in case it is left in Drafts for a while before being sent
|
|
||||||
MessagingController.getInstance(getApplication()).setMessageFlag(mAccount, mFolder, mSourceMessageUid, Flag.ANSWERED, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
updateTitle();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
|
Loading…
Reference in New Issue
Block a user