1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-24 02:12:15 -05:00

Fix warnings.

This commit is contained in:
Danny Baumann 2013-02-11 09:07:19 +01:00
parent 03428f1a31
commit 3807d2881d
4 changed files with 11 additions and 38 deletions

View File

@ -6,7 +6,6 @@ import java.util.List;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;

View File

@ -27,7 +27,6 @@ import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.util.SparseBooleanArray;
import android.util.TypedValue;
import android.view.ContextMenu;
import com.actionbarsherlock.app.ActionBar;

View File

@ -14,7 +14,6 @@ import android.os.Handler;
import android.os.PowerManager;
import android.text.TextUtils.TruncateAt;
import android.util.Log;
import android.util.TypedValue;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.KeyEvent;

View File

@ -10,12 +10,10 @@ import android.text.TextUtils;
import android.text.style.StyleSpan;
import android.util.Log;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.QuickContactBadge;
import android.widget.ScrollView;
@ -46,7 +44,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
private Context mContext;
private TextView mFromView;
private TextView mDateView;
private TextView mTimeView;
private TextView mToView;
private TextView mToLabel;
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 cc = Address.toFriendly(message.getRecipients(Message.RecipientType.CC), contacts);
Address[] fromAddrs = message.getFrom();
Address[] toAddrs = message.getRecipients(Message.RecipientType.TO);
Address[] ccAddrs = message.getRecipients(Message.RecipientType.CC);
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;
if (fromMe) {
@ -261,8 +250,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
counterpartyAddress = fromAddrs[0].getAddress();
}
mMessage = message;
mAccount = account;
@ -274,8 +261,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
mContactBadge.setVisibility(View.GONE);
}
final String subject = message.getSubject();
if (StringUtils.isNullOrEmpty(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);
if (date != null) {
mDateView.setText(time + " - " + date);
} else {
mDateView.setText(time);
}
if (K9.showContactPicture()) {
mContactBadge.assignContactFromEmail(counterpartyAddress.toString(), true);
mContactBadge.assignContactFromEmail(counterpartyAddress, true);
if (counterpartyAddress != null) {
mContactsPictureLoader.loadContactPicture(counterpartyAddress.toString(), mContactBadge);
mContactsPictureLoader.loadContactPicture(counterpartyAddress, mContactBadge);
} else {
mContactBadge.setImageResource(R.drawable.ic_contact_picture);
}
}
mFromView.setText(from);
updateAddressField(mToView, to, mToLabel);
@ -342,18 +325,11 @@ public class MessageHeader extends ScrollView implements OnClickListener {
private void updateAddressField(TextView v, CharSequence text, View label) {
if (TextUtils.isEmpty(text)) {
v.setVisibility(View.GONE);
label.setVisibility(View.GONE);
return;
}
boolean hasText = !TextUtils.isEmpty(text);
v.setText(text);
v.setVisibility(View.VISIBLE);
label.setVisibility(View.VISIBLE);
v.setVisibility(hasText ? View.VISIBLE : View.GONE);
label.setVisibility(hasText ? View.VISIBLE : View.GONE);
}
/**