Messaging: Further code improvements

* Remove redundant casts
* getParcelable(ArrayList|Exra) without class argument is deprecated
* ViewPager.setOnPageChangeListener -> addOnPageChangeListener
* RecyclerView.setOnScrollListener -> addOnScrollListener
* Remove unused initializations
* Remove unused code

Change-Id: I21beb6c90c675a4f2cfd7e3d5ebbd18b745f5911
This commit is contained in:
Michael W
2025-01-01 13:54:07 +01:00
parent 47f5533a73
commit b2f5e3190e
110 changed files with 289 additions and 561 deletions

View File

@@ -124,37 +124,37 @@ public class ConversationMessageView extends FrameLayout implements View.OnClick
@Override
protected void onFinishInflate() {
super.onFinishInflate();
mContactIconView = (ContactIconView) findViewById(R.id.conversation_icon);
mContactIconView = findViewById(R.id.conversation_icon);
mContactIconView.setOnLongClickListener(view -> {
ConversationMessageView.this.performLongClick();
return true;
});
mMessageAttachmentsView = (LinearLayout) findViewById(R.id.message_attachments);
mMultiAttachmentView = (MultiAttachmentLayout) findViewById(R.id.multiple_attachments);
mMessageAttachmentsView = findViewById(R.id.message_attachments);
mMultiAttachmentView = findViewById(R.id.multiple_attachments);
mMultiAttachmentView.setOnAttachmentClickListener(this);
mMessageImageView = (AsyncImageView) findViewById(R.id.message_image);
mMessageImageView = findViewById(R.id.message_image);
mMessageImageView.setOnClickListener(this);
mMessageImageView.setOnLongClickListener(this);
mMessageTextView = (TextView) findViewById(R.id.message_text);
mMessageTextView = findViewById(R.id.message_text);
mMessageTextView.setOnClickListener(this);
IgnoreLinkLongClickHelper.ignoreLinkLongClick(mMessageTextView, this);
mStatusTextView = (TextView) findViewById(R.id.message_status);
mTitleTextView = (TextView) findViewById(R.id.message_title);
mMmsInfoTextView = (TextView) findViewById(R.id.mms_info);
mMessageTitleLayout = (LinearLayout) findViewById(R.id.message_title_layout);
mSenderNameTextView = (TextView) findViewById(R.id.message_sender_name);
mMessageBubble = (ConversationMessageBubbleView) findViewById(R.id.message_content);
mStatusTextView = findViewById(R.id.message_status);
mTitleTextView = findViewById(R.id.message_title);
mMmsInfoTextView = findViewById(R.id.mms_info);
mMessageTitleLayout = findViewById(R.id.message_title_layout);
mSenderNameTextView = findViewById(R.id.message_sender_name);
mMessageBubble = findViewById(R.id.message_content);
mSubjectView = findViewById(R.id.subject_container);
mSubjectLabel = (TextView) mSubjectView.findViewById(R.id.subject_label);
mSubjectText = (TextView) mSubjectView.findViewById(R.id.subject_text);
mSubjectLabel = mSubjectView.findViewById(R.id.subject_label);
mSubjectText = mSubjectView.findViewById(R.id.subject_text);
mDeliveredBadge = findViewById(R.id.smsDeliveredBadge);
mMessageMetadataView = (ViewGroup) findViewById(R.id.message_metadata);
mMessageTextAndInfoView = (ViewGroup) findViewById(R.id.message_text_and_info);
mSimNameView = (TextView) findViewById(R.id.sim_name);
mMessageMetadataView = findViewById(R.id.message_metadata);
mMessageTextAndInfoView = findViewById(R.id.message_text_and_info);
mSimNameView = findViewById(R.id.sim_name);
}
@Override
@@ -882,8 +882,8 @@ public class ConversationMessageView extends FrameLayout implements View.OnClick
private void updateTextAppearance() {
int messageColorResId;
int statusColorResId = -1;
int infoColorResId = -1;
int statusColorResId;
int infoColorResId;
int timestampColorResId;
int subjectLabelColorResId;
if (isSelected()) {