mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-24 02:12:15 -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:
parent
69ee6a4818
commit
482ae352c1
@ -17,7 +17,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:stretchColumns="1"
|
android:stretchColumns="1"
|
||||||
android:shrinkColumns="1"
|
android:shrinkColumns="1"
|
||||||
android:background="@drawable/message_view_header_background">
|
android:background="@color/message_view_header_background">
|
||||||
|
|
||||||
<TableRow>
|
<TableRow>
|
||||||
|
|
||||||
@ -30,7 +30,6 @@
|
|||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:paddingTop="2dip"
|
android:paddingTop="2dip"
|
||||||
android:paddingBottom="3dip"
|
|
||||||
android:layout_column="1"
|
android:layout_column="1"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
@ -123,68 +122,16 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</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>
|
</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 -->
|
<!-- Date/Time + Icons -->
|
||||||
<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. -->
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/topright_container"
|
android:id="@+id/topright_container"
|
||||||
android:layout_marginTop="2dip"
|
android:layout_marginTop="2dip"
|
||||||
android:layout_marginRight="6dip"
|
android:layout_marginRight="6dip"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="6dp"
|
android:layout_marginLeft="6dp"
|
||||||
android:gravity="right">
|
android:gravity="right">
|
||||||
|
|
||||||
@ -231,33 +178,83 @@
|
|||||||
android:textColor="?android:attr/textColorPrimary"
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
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>
|
</LinearLayout>
|
||||||
|
|
||||||
</TableRow>
|
</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>
|
</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
|
<View
|
||||||
android:id="@+id/separator"
|
android:id="@+id/separator"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="1.5dp"
|
android:layout_height="1.5dp"
|
||||||
android:background="#59000000"/>
|
android:background="#59000000"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- Button area -->
|
<!-- Button area -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
|
@ -49,6 +49,8 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
|||||||
private DateFormat mTimeFormat;
|
private DateFormat mTimeFormat;
|
||||||
|
|
||||||
private View mChip;
|
private View mChip;
|
||||||
|
private View mChip2;
|
||||||
|
private View mChip3;
|
||||||
private CheckBox mFlagged;
|
private CheckBox mFlagged;
|
||||||
private int defaultSubjectColor;
|
private int defaultSubjectColor;
|
||||||
private LinearLayout mToContainerView;
|
private LinearLayout mToContainerView;
|
||||||
@ -96,6 +98,8 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
|||||||
mSubjectView = (TextView) findViewById(R.id.subject);
|
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);
|
||||||
|
mChip3 = findViewById(R.id.chip3);
|
||||||
mDateView = (TextView) findViewById(R.id.date);
|
mDateView = (TextView) findViewById(R.id.date);
|
||||||
mTimeView = (TextView) findViewById(R.id.time);
|
mTimeView = (TextView) findViewById(R.id.time);
|
||||||
mFlagged = (CheckBox) findViewById(R.id.flagged);
|
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.to_label)).setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewTo());
|
||||||
((TextView) findViewById(R.id.cc_label)).setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewCC());
|
((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);
|
mFromView.setOnClickListener(this);
|
||||||
findViewById(R.id.top_container).setOnClickListener(this);
|
mToView.setOnClickListener(this);
|
||||||
|
mCcView.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());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
switch (view.getId()) {
|
switch (view.getId()) {
|
||||||
case R.id.top_container: {
|
case R.id.additional_headers_row:
|
||||||
|
case R.id.show_additional_headers_area: {
|
||||||
onShowAdditionalHeaders();
|
onShowAdditionalHeaders();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -259,6 +262,10 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
|||||||
int chipColorAlpha = (!message.isSet(Flag.SEEN)) ? 255 : 127;
|
int chipColorAlpha = (!message.isSet(Flag.SEEN)) ? 255 : 127;
|
||||||
mChip.setBackgroundColor(chipColor);
|
mChip.setBackgroundColor(chipColor);
|
||||||
mChip.getBackground().setAlpha(chipColorAlpha);
|
mChip.getBackground().setAlpha(chipColorAlpha);
|
||||||
|
mChip2.setBackgroundColor(chipColor);
|
||||||
|
mChip2.getBackground().setAlpha(chipColorAlpha);
|
||||||
|
mChip3.setBackgroundColor(chipColor);
|
||||||
|
mChip3.getBackground().setAlpha(chipColorAlpha);
|
||||||
|
|
||||||
setVisibility(View.VISIBLE);
|
setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user