mirror of
https://github.com/moparisthebest/k-9
synced 2025-02-19 20:21:45 -05:00
Reduce LOC even more
This commit is contained in:
parent
a51b608e5e
commit
033c1502db
@ -298,7 +298,6 @@ public class MessageCompose extends K9Activity implements OnClickListener,
|
|||||||
private Button mQuotedTextShow;
|
private Button mQuotedTextShow;
|
||||||
private View mQuotedTextBar;
|
private View mQuotedTextBar;
|
||||||
private ImageButton mQuotedTextEdit;
|
private ImageButton mQuotedTextEdit;
|
||||||
private ImageButton mQuotedTextDelete;
|
|
||||||
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.
|
||||||
@ -307,10 +306,6 @@ public class MessageCompose extends K9Activity implements OnClickListener,
|
|||||||
private TextView mCryptoSignatureUserId;
|
private TextView mCryptoSignatureUserId;
|
||||||
private TextView mCryptoSignatureUserIdRest;
|
private TextView mCryptoSignatureUserIdRest;
|
||||||
|
|
||||||
private ImageButton mAddToFromContacts;
|
|
||||||
private ImageButton mAddCcFromContacts;
|
|
||||||
private ImageButton mAddBccFromContacts;
|
|
||||||
|
|
||||||
private PgpData mPgpData = null;
|
private PgpData mPgpData = null;
|
||||||
private String mOpenPgpProvider;
|
private String mOpenPgpProvider;
|
||||||
private OpenPgpServiceConnection mOpenPgpServiceConnection;
|
private OpenPgpServiceConnection mOpenPgpServiceConnection;
|
||||||
@ -409,8 +404,6 @@ public class MessageCompose extends K9Activity implements OnClickListener,
|
|||||||
};
|
};
|
||||||
|
|
||||||
private Listener mListener = new Listener();
|
private Listener mListener = new Listener();
|
||||||
private EmailAddressAdapter mAddressAdapter;
|
|
||||||
private Validator mAddressValidator;
|
|
||||||
|
|
||||||
private FontSizes mFontSizes = K9.getFontSizes();
|
private FontSizes mFontSizes = K9.getFontSizes();
|
||||||
private ContextThemeWrapper mThemeContext;
|
private ContextThemeWrapper mThemeContext;
|
||||||
@ -564,8 +557,8 @@ public class MessageCompose extends K9Activity implements OnClickListener,
|
|||||||
|
|
||||||
mContacts = Contacts.getInstance(MessageCompose.this);
|
mContacts = Contacts.getInstance(MessageCompose.this);
|
||||||
|
|
||||||
mAddressAdapter = new EmailAddressAdapter(mThemeContext);
|
EmailAddressAdapter mAddressAdapter = new EmailAddressAdapter(mThemeContext);
|
||||||
mAddressValidator = new EmailAddressValidator();
|
Validator mAddressValidator = new EmailAddressValidator();
|
||||||
|
|
||||||
mChooseIdentityButton = (Button) findViewById(R.id.identity);
|
mChooseIdentityButton = (Button) findViewById(R.id.identity);
|
||||||
mChooseIdentityButton.setOnClickListener(this);
|
mChooseIdentityButton.setOnClickListener(this);
|
||||||
@ -581,9 +574,10 @@ public class MessageCompose extends K9Activity implements OnClickListener,
|
|||||||
mSubjectView = (EditText) findViewById(R.id.subject);
|
mSubjectView = (EditText) findViewById(R.id.subject);
|
||||||
mSubjectView.getInputExtras(true).putBoolean("allowEmoji", true);
|
mSubjectView.getInputExtras(true).putBoolean("allowEmoji", true);
|
||||||
|
|
||||||
mAddToFromContacts = (ImageButton) findViewById(R.id.add_to);
|
ImageButton mAddToFromContacts = (ImageButton) findViewById(R.id.add_to);
|
||||||
mAddCcFromContacts = (ImageButton) findViewById(R.id.add_cc);
|
ImageButton mAddCcFromContacts = (ImageButton) findViewById(R.id.add_cc);
|
||||||
mAddBccFromContacts = (ImageButton) findViewById(R.id.add_bcc);
|
ImageButton mAddBccFromContacts = (ImageButton) findViewById(R.id.add_bcc);
|
||||||
|
|
||||||
mCcWrapper = (LinearLayout) findViewById(R.id.cc_wrapper);
|
mCcWrapper = (LinearLayout) findViewById(R.id.cc_wrapper);
|
||||||
mBccWrapper = (LinearLayout) findViewById(R.id.bcc_wrapper);
|
mBccWrapper = (LinearLayout) findViewById(R.id.bcc_wrapper);
|
||||||
|
|
||||||
@ -601,7 +595,7 @@ public class MessageCompose extends K9Activity implements OnClickListener,
|
|||||||
mQuotedTextShow = (Button)findViewById(R.id.quoted_text_show);
|
mQuotedTextShow = (Button)findViewById(R.id.quoted_text_show);
|
||||||
mQuotedTextBar = findViewById(R.id.quoted_text_bar);
|
mQuotedTextBar = findViewById(R.id.quoted_text_bar);
|
||||||
mQuotedTextEdit = (ImageButton)findViewById(R.id.quoted_text_edit);
|
mQuotedTextEdit = (ImageButton)findViewById(R.id.quoted_text_edit);
|
||||||
mQuotedTextDelete = (ImageButton)findViewById(R.id.quoted_text_delete);
|
ImageButton mQuotedTextDelete = (ImageButton) findViewById(R.id.quoted_text_delete);
|
||||||
mQuotedText = (EolConvertingEditText)findViewById(R.id.quoted_text);
|
mQuotedText = (EolConvertingEditText)findViewById(R.id.quoted_text);
|
||||||
mQuotedText.getInputExtras(true).putBoolean("allowEmoji", true);
|
mQuotedText.getInputExtras(true).putBoolean("allowEmoji", true);
|
||||||
|
|
||||||
@ -641,21 +635,9 @@ public class MessageCompose extends K9Activity implements OnClickListener,
|
|||||||
|
|
||||||
/* Yes, there really are people 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 DoLaunchOnClickListener(CONTACT_PICKER_TO));
|
||||||
@Override public void onClick(View v) {
|
mAddCcFromContacts.setOnClickListener(new DoLaunchOnClickListener(CONTACT_PICKER_CC));
|
||||||
doLaunchContactPicker(CONTACT_PICKER_TO);
|
mAddBccFromContacts.setOnClickListener(new DoLaunchOnClickListener(CONTACT_PICKER_BCC));
|
||||||
}
|
|
||||||
});
|
|
||||||
mAddCcFromContacts.setOnClickListener(new OnClickListener() {
|
|
||||||
@Override public void onClick(View v) {
|
|
||||||
doLaunchContactPicker(CONTACT_PICKER_CC);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mAddBccFromContacts.setOnClickListener(new OnClickListener() {
|
|
||||||
@Override public void onClick(View v) {
|
|
||||||
doLaunchContactPicker(CONTACT_PICKER_BCC);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
mAddToFromContacts.setVisibility(View.GONE);
|
mAddToFromContacts.setVisibility(View.GONE);
|
||||||
mAddCcFromContacts.setVisibility(View.GONE);
|
mAddCcFromContacts.setVisibility(View.GONE);
|
||||||
@ -2197,11 +2179,6 @@ public class MessageCompose extends K9Activity implements OnClickListener,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void doLaunchContactPicker(int resultId) {
|
|
||||||
mIgnoreOnPause = true;
|
|
||||||
startActivityForResult(mContacts.contactPickerIntent(), resultId);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onAccountChosen(Account account, Identity identity) {
|
private void onAccountChosen(Account account, Identity identity) {
|
||||||
if (!mAccount.equals(account)) {
|
if (!mAccount.equals(account)) {
|
||||||
if (K9.DEBUG) {
|
if (K9.DEBUG) {
|
||||||
@ -3916,4 +3893,18 @@ public class MessageCompose extends K9Activity implements OnClickListener,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class DoLaunchOnClickListener implements OnClickListener {
|
||||||
|
|
||||||
|
private final int resultId;
|
||||||
|
|
||||||
|
DoLaunchOnClickListener(int resultId) {
|
||||||
|
this.resultId = resultId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
mIgnoreOnPause = true;
|
||||||
|
startActivityForResult(mContacts.contactPickerIntent(), resultId);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user