1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 19:52:17 -05:00

Reverted most of the recent message header changes

Clicking the additional headers area still allows to hide that view
again.
This commit is contained in:
cketti 2012-03-18 04:51:29 +01:00
parent 69ee6a4818
commit 482ae352c1
2 changed files with 86 additions and 82 deletions

View File

@ -17,7 +17,7 @@
android:layout_height="wrap_content"
android:stretchColumns="1"
android:shrinkColumns="1"
android:background="@drawable/message_view_header_background">
android:background="@color/message_view_header_background">
<TableRow>
@ -30,7 +30,6 @@
<LinearLayout
android:paddingTop="2dip"
android:paddingBottom="3dip"
android:layout_column="1"
android:layout_height="wrap_content"
android:orientation="vertical">
@ -123,68 +122,16 @@
</LinearLayout>
<TextView
android:id="@+id/additional_headers_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="false"
android:ellipsize="none"
android:textSize="10sp"
android:textColor="?android:attr/textColorSecondary"
android:textAppearance="?android:attr/textAppearanceSmall"/>
</LinearLayout>
<!-- Dummy column that is used to ensure the height of the table row is large
enough to fit the date/time column -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- Fixed spacing -->
<View
android:layout_width="0dp"
android:layout_height="18dp"/>
<!-- We don't want to hardcode the height of the star. The minHeight
is that of 'answered'. -->
<CheckBox
android:layout_width="0dp"
android:layout_height="wrap_content"
android:minHeight="22sp"
android:focusable="false"
style="?android:attr/starStyle"/>
<!-- Two text views that will be set to the same height as their
counterparts in the next colum -->
<TextView
android:id="@+id/dummy_date"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:singleLine="true"/>
<TextView
android:id="@+id/dummy_time"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="10sp"
android:singleLine="true"/>
</LinearLayout>
<!-- Date/Time + Icons
The height of this column is 'fill_parent' so we can put the show more/less
indicator at the bottom. Unfortunately using 'fill_parent' also means that
the views in this column will be cut of if their combined height exceeds
that of the highest non-'fill_parent' column. That's why we need the dummy
column above. -->
<!-- Date/Time + Icons -->
<LinearLayout
android:id="@+id/topright_container"
android:layout_marginTop="2dip"
android:layout_marginRight="6dip"
android:orientation="vertical"
android:layout_height="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:gravity="right">
@ -231,33 +178,83 @@
android:textColor="?android:attr/textColorPrimary"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<!-- View that will take up all available space between the time and
the show more/less indicator -->
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"/>
<ImageView
android:id="@+id/show_additional_headers_icon"
android:src="@drawable/show_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="6dp"
android:layout_marginBottom="3dip"/>
</LinearLayout>
</TableRow>
<TableRow
android:id="@+id/additional_headers_row">
<!-- Color chip 2 -->
<View
android:id="@+id/chip2"
android:layout_marginRight="6dip"
android:layout_width="6dip"
android:layout_height="fill_parent"/>
<!-- Additional headers -->
<TextView
android:layout_span="2"
android:id="@+id/additional_headers_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:singleLine="false"
android:ellipsize="none"
android:textSize="10sp"
android:textColor="?android:attr/textColorSecondary"
android:textAppearance="?android:attr/textAppearanceSmall" />
</TableRow>
</TableLayout>
<!-- Separator -->
<!-- This layout has an explicit height because otherwise there will be strange
display issues when the additional headers are shown. -->
<LinearLayout
android:id="@+id/show_additional_headers_area"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="21.5dp"
android:focusable="true"
android:clickable="true"
android:background="@drawable/message_view_header_background">
<RelativeLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="20dp">
<!-- Color chip 3 -->
<View
android:id="@+id/chip3"
android:layout_marginRight="6dip"
android:layout_width="6dip"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"/>
<!-- Show more/less indicator -->
<ImageView
android:id="@+id/show_additional_headers_icon"
android:src="@drawable/show_more"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:layout_marginRight="12dp"/>
</RelativeLayout>
<View
android:id="@+id/separator"
android:layout_width="fill_parent"
android:layout_height="1.5dp"
android:background="#59000000"/>
</LinearLayout>
<!-- Button area -->
<LinearLayout
android:layout_width="fill_parent"

View File

@ -49,6 +49,8 @@ public class MessageHeader extends ScrollView implements OnClickListener {
private DateFormat mTimeFormat;
private View mChip;
private View mChip2;
private View mChip3;
private CheckBox mFlagged;
private int defaultSubjectColor;
private LinearLayout mToContainerView;
@ -96,6 +98,8 @@ public class MessageHeader extends ScrollView implements OnClickListener {
mSubjectView = (TextView) findViewById(R.id.subject);
mAdditionalHeadersView = (TextView) findViewById(R.id.additional_headers_view);
mChip = findViewById(R.id.chip);
mChip2 = findViewById(R.id.chip2);
mChip3 = findViewById(R.id.chip3);
mDateView = (TextView) findViewById(R.id.date);
mTimeView = (TextView) findViewById(R.id.time);
mFlagged = (CheckBox) findViewById(R.id.flagged);
@ -115,19 +119,18 @@ public class MessageHeader extends ScrollView implements OnClickListener {
((TextView) findViewById(R.id.to_label)).setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewTo());
((TextView) findViewById(R.id.cc_label)).setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewCC());
findViewById(R.id.show_additional_headers_area).setOnClickListener(this);
findViewById(R.id.additional_headers_row).setOnClickListener(this);
mFromView.setOnClickListener(this);
findViewById(R.id.top_container).setOnClickListener(this);
TextView dummyDateView = (TextView) findViewById(R.id.dummy_date);
TextView dummyTimeView = (TextView) findViewById(R.id.dummy_time);
dummyTimeView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewTime());
dummyDateView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewDate());
mToView.setOnClickListener(this);
mCcView.setOnClickListener(this);
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.top_container: {
case R.id.additional_headers_row:
case R.id.show_additional_headers_area: {
onShowAdditionalHeaders();
break;
}
@ -259,6 +262,10 @@ public class MessageHeader extends ScrollView implements OnClickListener {
int chipColorAlpha = (!message.isSet(Flag.SEEN)) ? 255 : 127;
mChip.setBackgroundColor(chipColor);
mChip.getBackground().setAlpha(chipColorAlpha);
mChip2.setBackgroundColor(chipColor);
mChip2.getBackground().setAlpha(chipColorAlpha);
mChip3.setBackgroundColor(chipColor);
mChip3.getBackground().setAlpha(chipColorAlpha);
setVisibility(View.VISIBLE);