mirror of
https://github.com/moparisthebest/k-9
synced 2024-12-25 00:58:50 -05:00
Visual cleanup of messageview. Clean up of icon display codepaths
This commit is contained in:
parent
014e17d014
commit
bd66315375
Before Width: | Height: | Size: 844 B After Width: | Height: | Size: 844 B |
Binary file not shown.
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 798 B After Width: | Height: | Size: 798 B |
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
@ -6,6 +6,8 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="2dip"
|
||||
android:paddingRight="2dip"
|
||||
>
|
||||
<View
|
||||
android:id="@+id/chip"
|
||||
@ -18,6 +20,8 @@
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="2dip"
|
||||
android:paddingLeft="4dip"
|
||||
>
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
@ -119,12 +123,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right"
|
||||
>
|
||||
<CheckBox android:id="@+id/flagged"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusable="false"
|
||||
android:layout_alignParentRight="true"
|
||||
style="?android:attr/starStyle" />
|
||||
<TextView android:id="@+id/date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@ -147,11 +145,26 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:baselineAligned="true">
|
||||
android:paddingTop="4dip"
|
||||
>
|
||||
<View android:id="@+id/answered"
|
||||
android:layout_width="22sp"
|
||||
android:layout_height="22sp"
|
||||
android:layout_centerVertical="true"
|
||||
android:paddingRight="4dip"
|
||||
android:background="@drawable/ic_email_answered_small" />
|
||||
<View android:id="@+id/attachment"
|
||||
android:layout_width="22sp"
|
||||
android:layout_height="22sp"
|
||||
android:layout_centerVertical="true"
|
||||
android:paddingRight="4dip"
|
||||
android:background="@drawable/ic_email_attachment_small" />
|
||||
<CheckBox android:id="@+id/flagged"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusable="false"
|
||||
android:layout_alignParentRight="true"
|
||||
style="?android:attr/starStyle" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
@ -2331,8 +2331,8 @@ public class MessageList
|
||||
|
||||
MessageListAdapter()
|
||||
{
|
||||
mAttachmentIcon = getResources().getDrawable(R.drawable.ic_mms_attachment_small);
|
||||
mAnsweredIcon = getResources().getDrawable(R.drawable.ic_mms_answered_small);
|
||||
mAttachmentIcon = getResources().getDrawable(R.drawable.ic_email_attachment_small);
|
||||
mAnsweredIcon = getResources().getDrawable(R.drawable.ic_email_answered_small);
|
||||
}
|
||||
|
||||
public void markAllMessagesAsDirty()
|
||||
|
@ -51,7 +51,7 @@ public class MessageHeader extends LinearLayout
|
||||
private LinearLayout mCcContainerView;
|
||||
private TextView mAdditionalHeadersView;
|
||||
private View mAttachmentIcon;
|
||||
private static Drawable answeredIcon;
|
||||
private View mAnsweredIcon;
|
||||
private Message mMessage;
|
||||
private Account mAccount;
|
||||
private FontSizes mFontSizes = K9.getFontSizes();
|
||||
@ -85,6 +85,7 @@ public class MessageHeader extends LinearLayout
|
||||
private void initializeLayout()
|
||||
{
|
||||
mAttachmentIcon = findViewById(R.id.attachment);
|
||||
mAnsweredIcon = findViewById(R.id.answered);
|
||||
mFromView = (TextView) findViewById(R.id.from);
|
||||
mToView = (TextView) findViewById(R.id.to);
|
||||
mCcView = (TextView) findViewById(R.id.cc);
|
||||
@ -98,13 +99,13 @@ public class MessageHeader extends LinearLayout
|
||||
mFlagged = (CheckBox) findViewById(R.id.flagged);
|
||||
|
||||
defaultSubjectColor = mSubjectView.getCurrentTextColor();
|
||||
answeredIcon = getResources().getDrawable(R.drawable.ic_mms_answered_small);
|
||||
mSubjectView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getMessageViewSubject());
|
||||
mTimeView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getMessageViewTime());
|
||||
mDateView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getMessageViewDate());
|
||||
mAdditionalHeadersView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getMessageViewAdditionalHeaders());
|
||||
mAdditionalHeadersView.setVisibility(View.GONE);
|
||||
mAttachmentIcon.setVisibility(View.GONE);
|
||||
mAnsweredIcon.setVisibility(View.GONE);
|
||||
mFromView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getMessageViewSender());
|
||||
mToView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getMessageViewTo());
|
||||
mCcView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mFontSizes.getMessageViewCC());
|
||||
@ -263,18 +264,10 @@ public class MessageHeader extends LinearLayout
|
||||
mCcContainerView.setVisibility((cc != null && cc.length() > 0) ? View.VISIBLE : View.GONE);
|
||||
mCcView.setText(cc);
|
||||
mAttachmentIcon.setVisibility(((LocalStore.LocalMessage) message).hasAttachments() ? View.VISIBLE : View.GONE);
|
||||
mAnsweredIcon.setVisibility(message.isSet(Flag.ANSWERED) ? View.VISIBLE : View.GONE);
|
||||
mFlagged.setChecked(message.isSet(Flag.FLAGGED));
|
||||
mChip.setBackgroundDrawable(mAccount.generateColorChip().drawable());
|
||||
mChip.getBackground().setAlpha(!message.isSet(Flag.SEEN) ? 255 : 127);
|
||||
|
||||
if (message.isSet(Flag.ANSWERED))
|
||||
{
|
||||
mSubjectView.setCompoundDrawablesWithIntrinsicBounds(answeredIcon, null, null, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
mSubjectView.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
|
||||
}
|
||||
setVisibility(View.VISIBLE);
|
||||
if (mAdditionalHeadersView.getVisibility() == View.VISIBLE)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user