mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-30 13:12:25 -05:00
Hide subject line in MessageView since it's now displayed in the actionbar.
Now that the subject line is gone, the right side of the header is now the tallest part of the header. Put date and time on the same line to keep the header compact.
This commit is contained in:
parent
76f4d27f7d
commit
4a416f7acd
@ -34,17 +34,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- Subject -->
|
||||
<TextView
|
||||
android:id="@+id/subject"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="3"
|
||||
android:ellipsize="end"
|
||||
android:textSize="10sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
||||
<!-- Subject is shown on the actionbar -->
|
||||
|
||||
<!-- From -->
|
||||
<LinearLayout
|
||||
@ -163,25 +153,35 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/date"
|
||||
<LinearLayout
|
||||
android:id="@+id/date_time_container"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="none"
|
||||
android:textSize="10sp"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
||||
android:gravity="right">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="10sp"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="none"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
||||
<TextView
|
||||
android:id="@+id/date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="none"
|
||||
android:textSize="10sp"
|
||||
android:paddingRight="3dip"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="10sp"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="none"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -121,14 +121,6 @@
|
||||
android:entryValues="@array/font_values"
|
||||
android:dialogTitle="@string/font_size_message_view_cc" />
|
||||
|
||||
<ListPreference
|
||||
android:persistent="false"
|
||||
android:key="message_view_subject_font"
|
||||
android:title="@string/font_size_message_view_subject"
|
||||
android:entries="@array/font_entries"
|
||||
android:entryValues="@array/font_values"
|
||||
android:dialogTitle="@string/font_size_message_view_subject" />
|
||||
|
||||
<ListPreference
|
||||
android:persistent="false"
|
||||
android:key="message_view_time_font"
|
||||
|
@ -101,11 +101,6 @@ public class FontSizes {
|
||||
*/
|
||||
private int messageViewAdditionalHeaders;
|
||||
|
||||
/**
|
||||
* Font size of the message subject in the message view activity.
|
||||
*/
|
||||
private int messageViewSubject;
|
||||
|
||||
/**
|
||||
* Font size of the message time in the message view activity.
|
||||
*/
|
||||
@ -148,7 +143,6 @@ public class FontSizes {
|
||||
messageViewTo = FONT_12SP;
|
||||
messageViewCC = FONT_12SP;
|
||||
messageViewAdditionalHeaders = FONT_12SP;
|
||||
messageViewSubject = FONT_12SP;
|
||||
messageViewTime = FONT_10SP;
|
||||
messageViewDate = FONT_10SP;
|
||||
|
||||
@ -176,7 +170,6 @@ public class FontSizes {
|
||||
editor.putInt(MESSAGE_VIEW_TO, messageViewTo);
|
||||
editor.putInt(MESSAGE_VIEW_CC, messageViewCC);
|
||||
editor.putInt(MESSAGE_VIEW_ADDITIONAL_HEADERS, messageViewAdditionalHeaders);
|
||||
editor.putInt(MESSAGE_VIEW_SUBJECT, messageViewSubject);
|
||||
editor.putInt(MESSAGE_VIEW_TIME, messageViewTime);
|
||||
editor.putInt(MESSAGE_VIEW_DATE, messageViewDate);
|
||||
editor.putInt(MESSAGE_VIEW_CONTENT, getMessageViewContentAsInt());
|
||||
@ -205,7 +198,6 @@ public class FontSizes {
|
||||
messageViewTo = prefs.getInt(MESSAGE_VIEW_TO, messageViewTo);
|
||||
messageViewCC = prefs.getInt(MESSAGE_VIEW_CC, messageViewCC);
|
||||
messageViewAdditionalHeaders = prefs.getInt(MESSAGE_VIEW_ADDITIONAL_HEADERS, messageViewAdditionalHeaders);
|
||||
messageViewSubject = prefs.getInt(MESSAGE_VIEW_SUBJECT, messageViewSubject);
|
||||
messageViewTime = prefs.getInt(MESSAGE_VIEW_TIME, messageViewTime);
|
||||
messageViewDate = prefs.getInt(MESSAGE_VIEW_DATE, messageViewDate);
|
||||
setMessageViewContent(prefs.getInt(MESSAGE_VIEW_CONTENT, 3));
|
||||
@ -309,14 +301,6 @@ public class FontSizes {
|
||||
this.messageViewAdditionalHeaders = messageViewAdditionalHeaders;
|
||||
}
|
||||
|
||||
public int getMessageViewSubject() {
|
||||
return messageViewSubject;
|
||||
}
|
||||
|
||||
public void setMessageViewSubject(int messageViewSubject) {
|
||||
this.messageViewSubject = messageViewSubject;
|
||||
}
|
||||
|
||||
public int getMessageViewTime() {
|
||||
return messageViewTime;
|
||||
}
|
||||
|
@ -32,7 +32,6 @@ public class FontSizeSettings extends K9PreferenceActivity {
|
||||
private static final String PREFERENCE_MESSAGE_VIEW_TO_FONT = "message_view_to_font";
|
||||
private static final String PREFERENCE_MESSAGE_VIEW_CC_FONT = "message_view_cc_font";
|
||||
private static final String PREFERENCE_MESSAGE_VIEW_ADDITIONAL_HEADERS_FONT = "message_view_additional_headers_font";
|
||||
private static final String PREFERENCE_MESSAGE_VIEW_SUBJECT_FONT = "message_view_subject_font";
|
||||
private static final String PREFERENCE_MESSAGE_VIEW_TIME_FONT = "message_view_time_font";
|
||||
private static final String PREFERENCE_MESSAGE_VIEW_DATE_FONT = "message_view_date_font";
|
||||
private static final String PREFERENCE_MESSAGE_VIEW_CONTENT_FONT = "message_view_content_font";
|
||||
@ -50,7 +49,6 @@ public class FontSizeSettings extends K9PreferenceActivity {
|
||||
private ListPreference mMessageViewTo;
|
||||
private ListPreference mMessageViewCC;
|
||||
private ListPreference mMessageViewAdditionalHeaders;
|
||||
private ListPreference mMessageViewSubject;
|
||||
private ListPreference mMessageViewTime;
|
||||
private ListPreference mMessageViewDate;
|
||||
private ListPreference mMessageViewContent;
|
||||
@ -113,9 +111,6 @@ public class FontSizeSettings extends K9PreferenceActivity {
|
||||
mMessageViewAdditionalHeaders = setupListPreference(
|
||||
PREFERENCE_MESSAGE_VIEW_ADDITIONAL_HEADERS_FONT,
|
||||
Integer.toString(fontSizes.getMessageViewAdditionalHeaders()));
|
||||
mMessageViewSubject = setupListPreference(
|
||||
PREFERENCE_MESSAGE_VIEW_SUBJECT_FONT,
|
||||
Integer.toString(fontSizes.getMessageViewSubject()));
|
||||
mMessageViewTime = setupListPreference(
|
||||
PREFERENCE_MESSAGE_VIEW_TIME_FONT,
|
||||
Integer.toString(fontSizes.getMessageViewTime()));
|
||||
@ -153,7 +148,6 @@ public class FontSizeSettings extends K9PreferenceActivity {
|
||||
fontSizes.setMessageViewTo(Integer.parseInt(mMessageViewTo.getValue()));
|
||||
fontSizes.setMessageViewCC(Integer.parseInt(mMessageViewCC.getValue()));
|
||||
fontSizes.setMessageViewAdditionalHeaders(Integer.parseInt(mMessageViewAdditionalHeaders.getValue()));
|
||||
fontSizes.setMessageViewSubject(Integer.parseInt(mMessageViewSubject.getValue()));
|
||||
fontSizes.setMessageViewTime(Integer.parseInt(mMessageViewTime.getValue()));
|
||||
fontSizes.setMessageViewDate(Integer.parseInt(mMessageViewDate.getValue()));
|
||||
fontSizes.setMessageViewContent(Integer.parseInt(mMessageViewContent.getValue()));
|
||||
|
@ -44,7 +44,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
||||
private TextView mTimeView;
|
||||
private TextView mToView;
|
||||
private TextView mCcView;
|
||||
private TextView mSubjectView;
|
||||
private DateFormat mDateFormat;
|
||||
private DateFormat mTimeFormat;
|
||||
|
||||
@ -52,7 +51,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
||||
private View mChip2;
|
||||
private View mChip3;
|
||||
private CheckBox mFlagged;
|
||||
private int defaultSubjectColor;
|
||||
private LinearLayout mToContainerView;
|
||||
private LinearLayout mCcContainerView;
|
||||
private TextView mAdditionalHeadersView;
|
||||
@ -97,7 +95,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
||||
mCcView = (TextView) findViewById(R.id.cc);
|
||||
mToContainerView = (LinearLayout) findViewById(R.id.to_container);
|
||||
mCcContainerView = (LinearLayout) findViewById(R.id.cc_container);
|
||||
mSubjectView = (TextView) findViewById(R.id.subject);
|
||||
mAdditionalHeadersView = (TextView) findViewById(R.id.additional_headers_view);
|
||||
mChip = findViewById(R.id.chip);
|
||||
mChip2 = findViewById(R.id.chip2);
|
||||
@ -107,8 +104,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
||||
mFlagged = (CheckBox) findViewById(R.id.flagged);
|
||||
mShowAdditionalHeadersIcon = (ImageView) findViewById(R.id.show_additional_headers_icon);
|
||||
|
||||
defaultSubjectColor = mSubjectView.getCurrentTextColor();
|
||||
mSubjectView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewSubject());
|
||||
mTimeView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewTime());
|
||||
mDateView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewDate());
|
||||
mAdditionalHeadersView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewAdditionalHeaders());
|
||||
@ -238,13 +233,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
||||
mAccount = account;
|
||||
|
||||
initializeLayout();
|
||||
String subject = message.getSubject();
|
||||
if (subject == null || subject.equals("")) {
|
||||
mSubjectView.setText(mContext.getText(R.string.general_no_subject));
|
||||
} else {
|
||||
mSubjectView.setText(subject);
|
||||
}
|
||||
mSubjectView.setTextColor(0xff000000 | defaultSubjectColor);
|
||||
|
||||
mFromView.setText(from);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user