mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 11:42:16 -05:00
Cleanup and Optimize ( no need to prepare some layout when it is never used )
This commit is contained in:
parent
ba79779758
commit
4075b72b72
@ -301,7 +301,6 @@ public class MessageCompose extends K9Activity implements OnClickListener,
|
|||||||
private EolConvertingEditText mQuotedText;
|
private EolConvertingEditText mQuotedText;
|
||||||
private MessageWebView mQuotedHTML;
|
private MessageWebView mQuotedHTML;
|
||||||
private InsertableHtmlContent mQuotedHtmlContent; // Container for HTML reply as it's being built.
|
private InsertableHtmlContent mQuotedHtmlContent; // Container for HTML reply as it's being built.
|
||||||
private View mEncryptLayout;
|
|
||||||
private CheckBox mCryptoSignatureCheckbox;
|
private CheckBox mCryptoSignatureCheckbox;
|
||||||
private CheckBox mEncryptCheckbox;
|
private CheckBox mEncryptCheckbox;
|
||||||
private TextView mCryptoSignatureUserId;
|
private TextView mCryptoSignatureUserId;
|
||||||
@ -521,8 +520,7 @@ public class MessageCompose extends K9Activity implements OnClickListener,
|
|||||||
// theme the whole content according to the theme (except the action bar)
|
// theme the whole content according to the theme (except the action bar)
|
||||||
mThemeContext = new ContextThemeWrapper(this,
|
mThemeContext = new ContextThemeWrapper(this,
|
||||||
K9.getK9ThemeResourceId(K9.getK9ComposerTheme()));
|
K9.getK9ThemeResourceId(K9.getK9ComposerTheme()));
|
||||||
View v = ((LayoutInflater) mThemeContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).
|
View v = LayoutInflater.from(mThemeContext).inflate(R.layout.message_compose, null);
|
||||||
inflate(R.layout.message_compose, null);
|
|
||||||
TypedValue outValue = new TypedValue();
|
TypedValue outValue = new TypedValue();
|
||||||
// background color needs to be forced
|
// background color needs to be forced
|
||||||
mThemeContext.getTheme().resolveAttribute(R.attr.messageViewHeaderBackgroundColor, outValue, true);
|
mThemeContext.getTheme().resolveAttribute(R.attr.messageViewHeaderBackgroundColor, outValue, true);
|
||||||
@ -675,7 +673,7 @@ public class MessageCompose extends K9Activity implements OnClickListener,
|
|||||||
mMessageContentView.addTextChangedListener(watcher);
|
mMessageContentView.addTextChangedListener(watcher);
|
||||||
mQuotedText.addTextChangedListener(watcher);
|
mQuotedText.addTextChangedListener(watcher);
|
||||||
|
|
||||||
/* Yes, there really are poeple who ship versions of android without a contact picker */
|
/* Yes, there really are people who ship versions of android without a contact picker */
|
||||||
if (mContacts.hasContactPicker()) {
|
if (mContacts.hasContactPicker()) {
|
||||||
mAddToFromContacts.setOnClickListener(new OnClickListener() {
|
mAddToFromContacts.setOnClickListener(new OnClickListener() {
|
||||||
@Override public void onClick(View v) {
|
@Override public void onClick(View v) {
|
||||||
@ -813,23 +811,24 @@ public class MessageCompose extends K9Activity implements OnClickListener,
|
|||||||
mMessageReference.flag = Flag.FORWARDED;
|
mMessageReference.flag = Flag.FORWARDED;
|
||||||
}
|
}
|
||||||
|
|
||||||
mEncryptLayout = findViewById(R.id.layout_encrypt);
|
final View mEncryptLayout = findViewById(R.id.layout_encrypt);
|
||||||
|
|
||||||
|
initializeCrypto();
|
||||||
|
|
||||||
|
mOpenPgpProvider = mAccount.getOpenPgpProvider();
|
||||||
|
if (mOpenPgpProvider != null) {
|
||||||
mCryptoSignatureCheckbox = (CheckBox)findViewById(R.id.cb_crypto_signature);
|
mCryptoSignatureCheckbox = (CheckBox)findViewById(R.id.cb_crypto_signature);
|
||||||
mCryptoSignatureCheckbox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
|
final OnCheckedChangeListener updateListener = new OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
updateMessageFormat();
|
updateMessageFormat();
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
mCryptoSignatureCheckbox.setOnCheckedChangeListener(updateListener);
|
||||||
mCryptoSignatureUserId = (TextView)findViewById(R.id.userId);
|
mCryptoSignatureUserId = (TextView)findViewById(R.id.userId);
|
||||||
mCryptoSignatureUserIdRest = (TextView)findViewById(R.id.userIdRest);
|
mCryptoSignatureUserIdRest = (TextView)findViewById(R.id.userIdRest);
|
||||||
mEncryptCheckbox = (CheckBox)findViewById(R.id.cb_encrypt);
|
mEncryptCheckbox = (CheckBox)findViewById(R.id.cb_encrypt);
|
||||||
mEncryptCheckbox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
|
mEncryptCheckbox.setOnCheckedChangeListener(updateListener);
|
||||||
@Override
|
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
|
||||||
updateMessageFormat();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (mSourceMessageBody != null) {
|
if (mSourceMessageBody != null) {
|
||||||
// mSourceMessageBody is set to something when replying to and forwarding decrypted
|
// mSourceMessageBody is set to something when replying to and forwarding decrypted
|
||||||
@ -837,10 +836,6 @@ public class MessageCompose extends K9Activity implements OnClickListener,
|
|||||||
mEncryptCheckbox.setChecked(true);
|
mEncryptCheckbox.setChecked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
initializeCrypto();
|
|
||||||
|
|
||||||
mOpenPgpProvider = mAccount.getOpenPgpProvider();
|
|
||||||
if (mOpenPgpProvider != null) {
|
|
||||||
// New OpenPGP Provider API
|
// New OpenPGP Provider API
|
||||||
|
|
||||||
// bind to service
|
// bind to service
|
||||||
@ -3984,5 +3979,6 @@ public class MessageCompose extends K9Activity implements OnClickListener,
|
|||||||
public void setCharacters(CharSequence text) {
|
public void setCharacters(CharSequence text) {
|
||||||
setText(text.toString().replace("\r\n", "\n"));
|
setText(text.toString().replace("\r\n", "\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user