mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-16 14:35:04 -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:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<!-- Subject -->
|
<!-- Subject is shown on the actionbar -->
|
||||||
<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"/>
|
|
||||||
|
|
||||||
<!-- From -->
|
<!-- From -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -163,25 +153,35 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/date"
|
android:id="@+id/date_time_container"
|
||||||
|
android:orientation="horizontal"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:singleLine="true"
|
android:gravity="right">
|
||||||
android:ellipsize="none"
|
|
||||||
android:textSize="10sp"
|
|
||||||
android:textColor="?android:attr/textColorPrimary"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/time"
|
android:id="@+id/date"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="10sp"
|
android:singleLine="true"
|
||||||
android:singleLine="true"
|
android:ellipsize="none"
|
||||||
android:ellipsize="none"
|
android:textSize="10sp"
|
||||||
android:textColor="?android:attr/textColorPrimary"
|
android:paddingRight="3dip"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
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>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -121,14 +121,6 @@
|
|||||||
android:entryValues="@array/font_values"
|
android:entryValues="@array/font_values"
|
||||||
android:dialogTitle="@string/font_size_message_view_cc" />
|
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
|
<ListPreference
|
||||||
android:persistent="false"
|
android:persistent="false"
|
||||||
android:key="message_view_time_font"
|
android:key="message_view_time_font"
|
||||||
|
@ -101,11 +101,6 @@ public class FontSizes {
|
|||||||
*/
|
*/
|
||||||
private int messageViewAdditionalHeaders;
|
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.
|
* Font size of the message time in the message view activity.
|
||||||
*/
|
*/
|
||||||
@ -148,7 +143,6 @@ public class FontSizes {
|
|||||||
messageViewTo = FONT_12SP;
|
messageViewTo = FONT_12SP;
|
||||||
messageViewCC = FONT_12SP;
|
messageViewCC = FONT_12SP;
|
||||||
messageViewAdditionalHeaders = FONT_12SP;
|
messageViewAdditionalHeaders = FONT_12SP;
|
||||||
messageViewSubject = FONT_12SP;
|
|
||||||
messageViewTime = FONT_10SP;
|
messageViewTime = FONT_10SP;
|
||||||
messageViewDate = FONT_10SP;
|
messageViewDate = FONT_10SP;
|
||||||
|
|
||||||
@ -176,7 +170,6 @@ public class FontSizes {
|
|||||||
editor.putInt(MESSAGE_VIEW_TO, messageViewTo);
|
editor.putInt(MESSAGE_VIEW_TO, messageViewTo);
|
||||||
editor.putInt(MESSAGE_VIEW_CC, messageViewCC);
|
editor.putInt(MESSAGE_VIEW_CC, messageViewCC);
|
||||||
editor.putInt(MESSAGE_VIEW_ADDITIONAL_HEADERS, messageViewAdditionalHeaders);
|
editor.putInt(MESSAGE_VIEW_ADDITIONAL_HEADERS, messageViewAdditionalHeaders);
|
||||||
editor.putInt(MESSAGE_VIEW_SUBJECT, messageViewSubject);
|
|
||||||
editor.putInt(MESSAGE_VIEW_TIME, messageViewTime);
|
editor.putInt(MESSAGE_VIEW_TIME, messageViewTime);
|
||||||
editor.putInt(MESSAGE_VIEW_DATE, messageViewDate);
|
editor.putInt(MESSAGE_VIEW_DATE, messageViewDate);
|
||||||
editor.putInt(MESSAGE_VIEW_CONTENT, getMessageViewContentAsInt());
|
editor.putInt(MESSAGE_VIEW_CONTENT, getMessageViewContentAsInt());
|
||||||
@ -205,7 +198,6 @@ public class FontSizes {
|
|||||||
messageViewTo = prefs.getInt(MESSAGE_VIEW_TO, messageViewTo);
|
messageViewTo = prefs.getInt(MESSAGE_VIEW_TO, messageViewTo);
|
||||||
messageViewCC = prefs.getInt(MESSAGE_VIEW_CC, messageViewCC);
|
messageViewCC = prefs.getInt(MESSAGE_VIEW_CC, messageViewCC);
|
||||||
messageViewAdditionalHeaders = prefs.getInt(MESSAGE_VIEW_ADDITIONAL_HEADERS, messageViewAdditionalHeaders);
|
messageViewAdditionalHeaders = prefs.getInt(MESSAGE_VIEW_ADDITIONAL_HEADERS, messageViewAdditionalHeaders);
|
||||||
messageViewSubject = prefs.getInt(MESSAGE_VIEW_SUBJECT, messageViewSubject);
|
|
||||||
messageViewTime = prefs.getInt(MESSAGE_VIEW_TIME, messageViewTime);
|
messageViewTime = prefs.getInt(MESSAGE_VIEW_TIME, messageViewTime);
|
||||||
messageViewDate = prefs.getInt(MESSAGE_VIEW_DATE, messageViewDate);
|
messageViewDate = prefs.getInt(MESSAGE_VIEW_DATE, messageViewDate);
|
||||||
setMessageViewContent(prefs.getInt(MESSAGE_VIEW_CONTENT, 3));
|
setMessageViewContent(prefs.getInt(MESSAGE_VIEW_CONTENT, 3));
|
||||||
@ -309,14 +301,6 @@ public class FontSizes {
|
|||||||
this.messageViewAdditionalHeaders = messageViewAdditionalHeaders;
|
this.messageViewAdditionalHeaders = messageViewAdditionalHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMessageViewSubject() {
|
|
||||||
return messageViewSubject;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMessageViewSubject(int messageViewSubject) {
|
|
||||||
this.messageViewSubject = messageViewSubject;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMessageViewTime() {
|
public int getMessageViewTime() {
|
||||||
return messageViewTime;
|
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_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_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_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_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_DATE_FONT = "message_view_date_font";
|
||||||
private static final String PREFERENCE_MESSAGE_VIEW_CONTENT_FONT = "message_view_content_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 mMessageViewTo;
|
||||||
private ListPreference mMessageViewCC;
|
private ListPreference mMessageViewCC;
|
||||||
private ListPreference mMessageViewAdditionalHeaders;
|
private ListPreference mMessageViewAdditionalHeaders;
|
||||||
private ListPreference mMessageViewSubject;
|
|
||||||
private ListPreference mMessageViewTime;
|
private ListPreference mMessageViewTime;
|
||||||
private ListPreference mMessageViewDate;
|
private ListPreference mMessageViewDate;
|
||||||
private ListPreference mMessageViewContent;
|
private ListPreference mMessageViewContent;
|
||||||
@ -113,9 +111,6 @@ public class FontSizeSettings extends K9PreferenceActivity {
|
|||||||
mMessageViewAdditionalHeaders = setupListPreference(
|
mMessageViewAdditionalHeaders = setupListPreference(
|
||||||
PREFERENCE_MESSAGE_VIEW_ADDITIONAL_HEADERS_FONT,
|
PREFERENCE_MESSAGE_VIEW_ADDITIONAL_HEADERS_FONT,
|
||||||
Integer.toString(fontSizes.getMessageViewAdditionalHeaders()));
|
Integer.toString(fontSizes.getMessageViewAdditionalHeaders()));
|
||||||
mMessageViewSubject = setupListPreference(
|
|
||||||
PREFERENCE_MESSAGE_VIEW_SUBJECT_FONT,
|
|
||||||
Integer.toString(fontSizes.getMessageViewSubject()));
|
|
||||||
mMessageViewTime = setupListPreference(
|
mMessageViewTime = setupListPreference(
|
||||||
PREFERENCE_MESSAGE_VIEW_TIME_FONT,
|
PREFERENCE_MESSAGE_VIEW_TIME_FONT,
|
||||||
Integer.toString(fontSizes.getMessageViewTime()));
|
Integer.toString(fontSizes.getMessageViewTime()));
|
||||||
@ -153,7 +148,6 @@ public class FontSizeSettings extends K9PreferenceActivity {
|
|||||||
fontSizes.setMessageViewTo(Integer.parseInt(mMessageViewTo.getValue()));
|
fontSizes.setMessageViewTo(Integer.parseInt(mMessageViewTo.getValue()));
|
||||||
fontSizes.setMessageViewCC(Integer.parseInt(mMessageViewCC.getValue()));
|
fontSizes.setMessageViewCC(Integer.parseInt(mMessageViewCC.getValue()));
|
||||||
fontSizes.setMessageViewAdditionalHeaders(Integer.parseInt(mMessageViewAdditionalHeaders.getValue()));
|
fontSizes.setMessageViewAdditionalHeaders(Integer.parseInt(mMessageViewAdditionalHeaders.getValue()));
|
||||||
fontSizes.setMessageViewSubject(Integer.parseInt(mMessageViewSubject.getValue()));
|
|
||||||
fontSizes.setMessageViewTime(Integer.parseInt(mMessageViewTime.getValue()));
|
fontSizes.setMessageViewTime(Integer.parseInt(mMessageViewTime.getValue()));
|
||||||
fontSizes.setMessageViewDate(Integer.parseInt(mMessageViewDate.getValue()));
|
fontSizes.setMessageViewDate(Integer.parseInt(mMessageViewDate.getValue()));
|
||||||
fontSizes.setMessageViewContent(Integer.parseInt(mMessageViewContent.getValue()));
|
fontSizes.setMessageViewContent(Integer.parseInt(mMessageViewContent.getValue()));
|
||||||
|
@ -44,7 +44,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
|||||||
private TextView mTimeView;
|
private TextView mTimeView;
|
||||||
private TextView mToView;
|
private TextView mToView;
|
||||||
private TextView mCcView;
|
private TextView mCcView;
|
||||||
private TextView mSubjectView;
|
|
||||||
private DateFormat mDateFormat;
|
private DateFormat mDateFormat;
|
||||||
private DateFormat mTimeFormat;
|
private DateFormat mTimeFormat;
|
||||||
|
|
||||||
@ -52,7 +51,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
|||||||
private View mChip2;
|
private View mChip2;
|
||||||
private View mChip3;
|
private View mChip3;
|
||||||
private CheckBox mFlagged;
|
private CheckBox mFlagged;
|
||||||
private int defaultSubjectColor;
|
|
||||||
private LinearLayout mToContainerView;
|
private LinearLayout mToContainerView;
|
||||||
private LinearLayout mCcContainerView;
|
private LinearLayout mCcContainerView;
|
||||||
private TextView mAdditionalHeadersView;
|
private TextView mAdditionalHeadersView;
|
||||||
@ -97,7 +95,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
|||||||
mCcView = (TextView) findViewById(R.id.cc);
|
mCcView = (TextView) findViewById(R.id.cc);
|
||||||
mToContainerView = (LinearLayout) findViewById(R.id.to_container);
|
mToContainerView = (LinearLayout) findViewById(R.id.to_container);
|
||||||
mCcContainerView = (LinearLayout) findViewById(R.id.cc_container);
|
mCcContainerView = (LinearLayout) findViewById(R.id.cc_container);
|
||||||
mSubjectView = (TextView) findViewById(R.id.subject);
|
|
||||||
mAdditionalHeadersView = (TextView) findViewById(R.id.additional_headers_view);
|
mAdditionalHeadersView = (TextView) findViewById(R.id.additional_headers_view);
|
||||||
mChip = findViewById(R.id.chip);
|
mChip = findViewById(R.id.chip);
|
||||||
mChip2 = findViewById(R.id.chip2);
|
mChip2 = findViewById(R.id.chip2);
|
||||||
@ -107,8 +104,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
|||||||
mFlagged = (CheckBox) findViewById(R.id.flagged);
|
mFlagged = (CheckBox) findViewById(R.id.flagged);
|
||||||
mShowAdditionalHeadersIcon = (ImageView) findViewById(R.id.show_additional_headers_icon);
|
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());
|
mTimeView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewTime());
|
||||||
mDateView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewDate());
|
mDateView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewDate());
|
||||||
mAdditionalHeadersView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewAdditionalHeaders());
|
mAdditionalHeadersView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewAdditionalHeaders());
|
||||||
@ -238,13 +233,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
|||||||
mAccount = account;
|
mAccount = account;
|
||||||
|
|
||||||
initializeLayout();
|
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);
|
mFromView.setText(from);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user