mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 19:52:17 -05:00
Fix warnings.
This commit is contained in:
parent
03428f1a31
commit
3807d2881d
@ -6,7 +6,6 @@ import java.util.List;
|
|||||||
|
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.TypedValue;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
|
@ -27,7 +27,6 @@ import android.text.Editable;
|
|||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.SparseBooleanArray;
|
import android.util.SparseBooleanArray;
|
||||||
import android.util.TypedValue;
|
|
||||||
import android.view.ContextMenu;
|
import android.view.ContextMenu;
|
||||||
|
|
||||||
import com.actionbarsherlock.app.ActionBar;
|
import com.actionbarsherlock.app.ActionBar;
|
||||||
|
@ -14,7 +14,6 @@ import android.os.Handler;
|
|||||||
import android.os.PowerManager;
|
import android.os.PowerManager;
|
||||||
import android.text.TextUtils.TruncateAt;
|
import android.text.TextUtils.TruncateAt;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.TypedValue;
|
|
||||||
import android.view.ContextMenu;
|
import android.view.ContextMenu;
|
||||||
import android.view.ContextMenu.ContextMenuInfo;
|
import android.view.ContextMenu.ContextMenuInfo;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
@ -10,12 +10,10 @@ import android.text.TextUtils;
|
|||||||
import android.text.style.StyleSpan;
|
import android.text.style.StyleSpan;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.TypedValue;
|
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.ImageView;
|
|
||||||
|
|
||||||
import android.widget.QuickContactBadge;
|
import android.widget.QuickContactBadge;
|
||||||
import android.widget.ScrollView;
|
import android.widget.ScrollView;
|
||||||
@ -46,7 +44,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
|||||||
private Context mContext;
|
private Context mContext;
|
||||||
private TextView mFromView;
|
private TextView mFromView;
|
||||||
private TextView mDateView;
|
private TextView mDateView;
|
||||||
private TextView mTimeView;
|
|
||||||
private TextView mToView;
|
private TextView mToView;
|
||||||
private TextView mToLabel;
|
private TextView mToLabel;
|
||||||
private TextView mCcView;
|
private TextView mCcView;
|
||||||
@ -237,18 +234,10 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
|||||||
final CharSequence to = Address.toFriendly(message.getRecipients(Message.RecipientType.TO), contacts);
|
final CharSequence to = Address.toFriendly(message.getRecipients(Message.RecipientType.TO), contacts);
|
||||||
final CharSequence cc = Address.toFriendly(message.getRecipients(Message.RecipientType.CC), contacts);
|
final CharSequence cc = Address.toFriendly(message.getRecipients(Message.RecipientType.CC), contacts);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Address[] fromAddrs = message.getFrom();
|
Address[] fromAddrs = message.getFrom();
|
||||||
Address[] toAddrs = message.getRecipients(Message.RecipientType.TO);
|
Address[] toAddrs = message.getRecipients(Message.RecipientType.TO);
|
||||||
Address[] ccAddrs = message.getRecipients(Message.RecipientType.CC);
|
Address[] ccAddrs = message.getRecipients(Message.RecipientType.CC);
|
||||||
|
|
||||||
boolean fromMe = mMessageHelper.toMe(account, fromAddrs);
|
boolean fromMe = mMessageHelper.toMe(account, fromAddrs);
|
||||||
boolean toMe = mMessageHelper.toMe(account, toAddrs);
|
|
||||||
boolean ccMe = mMessageHelper.toMe(account, ccAddrs);
|
|
||||||
|
|
||||||
CharSequence displayName = mMessageHelper.getDisplayName(account, fromAddrs, toAddrs);
|
|
||||||
|
|
||||||
String counterpartyAddress = null;
|
String counterpartyAddress = null;
|
||||||
if (fromMe) {
|
if (fromMe) {
|
||||||
@ -261,8 +250,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
|||||||
counterpartyAddress = fromAddrs[0].getAddress();
|
counterpartyAddress = fromAddrs[0].getAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mMessage = message;
|
mMessage = message;
|
||||||
mAccount = account;
|
mAccount = account;
|
||||||
|
|
||||||
@ -274,8 +261,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
|||||||
mContactBadge.setVisibility(View.GONE);
|
mContactBadge.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
final String subject = message.getSubject();
|
final String subject = message.getSubject();
|
||||||
if (StringUtils.isNullOrEmpty(subject)) {
|
if (StringUtils.isNullOrEmpty(subject)) {
|
||||||
mSubjectView.setText(mContext.getText(R.string.general_no_subject));
|
mSubjectView.setText(mContext.getText(R.string.general_no_subject));
|
||||||
@ -284,23 +269,21 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
|||||||
}
|
}
|
||||||
mSubjectView.setTextColor(0xff000000 | defaultSubjectColor);
|
mSubjectView.setTextColor(0xff000000 | defaultSubjectColor);
|
||||||
|
|
||||||
|
|
||||||
if (date != null) {
|
if (date != null) {
|
||||||
mDateView.setText(time + " - " + date);
|
mDateView.setText(time + " - " + date);
|
||||||
} else {
|
} else {
|
||||||
mDateView.setText(time);
|
mDateView.setText(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (K9.showContactPicture()) {
|
if (K9.showContactPicture()) {
|
||||||
mContactBadge.assignContactFromEmail(counterpartyAddress.toString(), true);
|
mContactBadge.assignContactFromEmail(counterpartyAddress, true);
|
||||||
if (counterpartyAddress != null) {
|
if (counterpartyAddress != null) {
|
||||||
mContactsPictureLoader.loadContactPicture(counterpartyAddress.toString(), mContactBadge);
|
mContactsPictureLoader.loadContactPicture(counterpartyAddress, mContactBadge);
|
||||||
} else {
|
} else {
|
||||||
mContactBadge.setImageResource(R.drawable.ic_contact_picture);
|
mContactBadge.setImageResource(R.drawable.ic_contact_picture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mFromView.setText(from);
|
mFromView.setText(from);
|
||||||
|
|
||||||
updateAddressField(mToView, to, mToLabel);
|
updateAddressField(mToView, to, mToLabel);
|
||||||
@ -342,18 +325,11 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
|||||||
|
|
||||||
|
|
||||||
private void updateAddressField(TextView v, CharSequence text, View label) {
|
private void updateAddressField(TextView v, CharSequence text, View label) {
|
||||||
if (TextUtils.isEmpty(text)) {
|
boolean hasText = !TextUtils.isEmpty(text);
|
||||||
v.setVisibility(View.GONE);
|
|
||||||
label.setVisibility(View.GONE);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
v.setText(text);
|
v.setText(text);
|
||||||
v.setVisibility(View.VISIBLE);
|
v.setVisibility(hasText ? View.VISIBLE : View.GONE);
|
||||||
label.setVisibility(View.VISIBLE);
|
label.setVisibility(hasText ? View.VISIBLE : View.GONE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user