Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 783f8698 authored by Nihar Thakkar's avatar Nihar Thakkar
Browse files

Replaced old reply, forward, reply + forward and attachment icons with new material icons

parent 20c92f50
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -141,15 +141,6 @@ public abstract class AccountList extends K9ListActivity implements OnItemClickL

            holder.description.setText(description);

            if (account instanceof Account) {
                Account realAccount = (Account) account;
                holder.chip.setBackgroundColor(realAccount.getChipColor());
            } else {
                holder.chip.setBackgroundColor(0xff999999);
            }

            holder.chip.getBackground().setAlpha(255);

            mFontSizes.setViewTextSize(holder.description, mFontSizes.getAccountName());
            mFontSizes.setViewTextSize(holder.email, mFontSizes.getAccountDescription());

@@ -160,7 +151,6 @@ public abstract class AccountList extends K9ListActivity implements OnItemClickL
        class AccountViewHolder {
            public TextView description;
            public TextView email;
            public View chip;
        }
    }

+31 −21
Original line number Diff line number Diff line
@@ -59,10 +59,10 @@ public class MessageListAdapter extends CursorAdapter
    {
        super(fragment.getActivity(), null, 0);
        this.fragment = fragment;
        mAttachmentIcon = fragment.getResources().getDrawable(R.drawable.ic_email_attachment_small);
        mAnsweredIcon = fragment.getResources().getDrawable(R.drawable.ic_email_answered_small);
        mForwardedIcon = fragment.getResources().getDrawable(R.drawable.ic_email_forwarded_small);
        mForwardedAnsweredIcon = fragment.getResources().getDrawable(R.drawable.ic_email_forwarded_answered_small);
        mAttachmentIcon = fragment.getResources().getDrawable(R.drawable.ic_email_attachment);
        mAnsweredIcon = fragment.getResources().getDrawable(R.drawable.ic_reply_light);
        mForwardedIcon = fragment.getResources().getDrawable(R.drawable.ic_forward_light);
        mForwardedAnsweredIcon = fragment.getResources().getDrawable(R.drawable.ic_reply_light);
    }

    private String recipientSigil(boolean toMe, boolean ccMe)
@@ -107,9 +107,14 @@ public class MessageListAdapter extends CursorAdapter
        RoundedQuickContactBadge contactBadge =
                (RoundedQuickContactBadge) view.findViewById(R.id.contact_badge);

        // Assign a reference to the Star ImageView and set the visibility to GONE by default
        // Assign a reference to Star ImageView
        holder.starImageView = (ImageView) view.findViewById(R.id.star_image_view);
        holder.starImageView.setVisibility(View.GONE);

        // Assign a reference to Reply Status ImageView
        holder.replyStatusImageView = (ImageView) view.findViewById(R.id.reply_status_image_view);

        // Assign a reference to Attachment ImageView
        holder.attachmentImageView = (ImageView) view.findViewById(R.id.attachment_image_view);

        if (fragment.contactsPictureLoader != null)
        {
@@ -239,12 +244,6 @@ public class MessageListAdapter extends CursorAdapter
            holder.from.setTypeface(Typeface.create(holder.from.getTypeface(), Typeface.BOLD));
            if (fragment.senderAboveSubject)
            {
                holder.from.setCompoundDrawablesWithIntrinsicBounds(
                        statusHolder, // left
                        null, // top
                        hasAttachments ? mAttachmentIcon : null, // right
                        null); // bottom

                holder.from.setText(displayName);
            }
            else
@@ -254,19 +253,30 @@ public class MessageListAdapter extends CursorAdapter
        }
        if (holder.subject != null)
        {
            if (!fragment.senderAboveSubject)
            {
                holder.subject.setCompoundDrawablesWithIntrinsicBounds(
                        statusHolder, // left
                        null, // top
                        hasAttachments ? mAttachmentIcon : null, // right
                        null); // bottom
            }

            holder.subject.setTypeface(Typeface.create(holder.subject.getTypeface(), Typeface.NORMAL));
            holder.subject.setText(subject);
        }
        holder.date.setText(displayDate);

        if (statusHolder != null)
        {
            holder.replyStatusImageView.setImageDrawable(statusHolder);
            holder.replyStatusImageView.setVisibility(View.VISIBLE);
        }
        else
        {
            holder.replyStatusImageView.setVisibility(View.GONE);
        }

        if (hasAttachments)
        {
            holder.attachmentImageView.setVisibility(View.VISIBLE);
        }
        else
        {
            holder.attachmentImageView.setVisibility(View.GONE);

        }
    }

    private void formatPreviewText(TextView preview, CharSequence beforePreviewText, String sigil)
+2 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@ public class MessageViewHolder implements View.OnClickListener
    public TextView subject;
    public TextView preview;
    public TextView from;
    public ImageView replyStatusImageView;
    public ImageView attachmentImageView;
    public TextView time;
    public TextView date;
    public ImageView starImageView;
+551 B
Loading image diff...
+246 B
Loading image diff...
Loading