mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 11:42:16 -05:00
Move "show all headers" into the menu (and out of the UI)
This commit is contained in:
parent
eff9e8c97a
commit
7714bc3cfa
@ -153,34 +153,16 @@
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<!-- Show more/less indicator -->
|
||||
<ImageView
|
||||
android:id="@+id/show_additional_headers_icon"
|
||||
android:src="@drawable/show_more"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:paddingRight="12dp"
|
||||
android:scaleType="fitEnd"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/additional_headers_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/show_additional_headers_icon"
|
||||
android:layout_marginRight="10dp"
|
||||
android:singleLine="false"
|
||||
android:ellipsize="none"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -112,6 +112,14 @@
|
||||
android:showAsAction="never"
|
||||
android:title="@string/mark_as_unread_action"/>
|
||||
|
||||
<item android:id="@+id/show_headers"
|
||||
android:showAsAction="never"
|
||||
android:title="@string/show_headers_action"/>
|
||||
|
||||
<item android:id="@+id/hide_headers"
|
||||
android:showAsAction="never"
|
||||
android:title="@string/hide_headers_action"/>
|
||||
|
||||
<!-- MessageList -->
|
||||
<item
|
||||
android:id="@+id/set_sort"
|
||||
|
@ -165,6 +165,8 @@ Please submit bug reports, contribute new features and ask questions at
|
||||
<string name="unflag_action">Remove star</string>
|
||||
<string name="copy_action">Copy</string>
|
||||
<string name="select_text_action">Select text</string>
|
||||
<string name="show_headers_action">Show headers</string>
|
||||
<string name="hide_headers_action">Hide headers</string>
|
||||
|
||||
<string name="message_view_theme_action_dark">Switch to dark theme</string>
|
||||
<string name="message_view_theme_action_light">Switch to light theme</string>
|
||||
|
@ -838,6 +838,12 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
|
||||
mMessageViewFragment.onSelectText();
|
||||
return true;
|
||||
}
|
||||
case R.id.show_headers:
|
||||
case R.id.hide_headers: {
|
||||
mMessageViewFragment.onToggleAllHeadersView();
|
||||
updateMenu();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!mSingleFolderMode) {
|
||||
@ -927,6 +933,8 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
|
||||
menu.findItem(R.id.toggle_unread).setVisible(false);
|
||||
menu.findItem(R.id.select_text).setVisible(false);
|
||||
menu.findItem(R.id.toggle_message_view_theme).setVisible(false);
|
||||
menu.findItem(R.id.show_headers).setVisible(false);
|
||||
menu.findItem(R.id.hide_headers).setVisible(false);
|
||||
} else {
|
||||
// hide prev/next buttons in split mode
|
||||
if (mDisplayMode != DisplayMode.MESSAGE_VIEW) {
|
||||
@ -974,6 +982,13 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
|
||||
menu.findItem(R.id.archive).setVisible(false);
|
||||
menu.findItem(R.id.spam).setVisible(false);
|
||||
}
|
||||
|
||||
if (mMessageViewFragment.allHeadersVisible()) {
|
||||
menu.findItem(R.id.show_headers).setVisible(false);
|
||||
} else {
|
||||
menu.findItem(R.id.hide_headers).setVisible(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -276,6 +276,14 @@ public class MessageViewFragment extends SherlockFragment implements OnClickList
|
||||
}
|
||||
}
|
||||
|
||||
public void onToggleAllHeadersView() {
|
||||
mMessageView.getMessageHeaderView().onShowAdditionalHeaders();
|
||||
}
|
||||
|
||||
public boolean allHeadersVisible() {
|
||||
return mMessageView.getMessageHeaderView().additionalHeadersVisible();
|
||||
}
|
||||
|
||||
private void delete() {
|
||||
if (mMessage != null) {
|
||||
// Disable the delete button after it's tapped (to try to prevent
|
||||
|
@ -59,7 +59,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
||||
private Account mAccount;
|
||||
private FontSizes mFontSizes = K9.getFontSizes();
|
||||
private Contacts mContacts;
|
||||
private ImageView mShowAdditionalHeadersIcon;
|
||||
private SavedState mSavedState;
|
||||
|
||||
private OnLayoutChangedListener mOnLayoutChangedListener;
|
||||
@ -99,7 +98,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
||||
mDateView = (TextView) findViewById(R.id.date);
|
||||
mTimeView = (TextView) findViewById(R.id.time);
|
||||
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());
|
||||
@ -111,7 +109,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
||||
mToView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewTo());
|
||||
mCcView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getMessageViewCC());
|
||||
|
||||
mShowAdditionalHeadersIcon.setOnClickListener(this);
|
||||
mFromView.setOnClickListener(this);
|
||||
mToView.setOnClickListener(this);
|
||||
mCcView.setOnClickListener(this);
|
||||
@ -127,10 +124,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.show_additional_headers_icon: {
|
||||
onShowAdditionalHeaders();
|
||||
break;
|
||||
}
|
||||
case R.id.from: {
|
||||
onAddSenderToContacts();
|
||||
break;
|
||||
@ -173,7 +166,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
||||
private void hideAdditionalHeaders() {
|
||||
mAdditionalHeadersView.setVisibility(View.GONE);
|
||||
mAdditionalHeadersView.setText("");
|
||||
mShowAdditionalHeadersIcon.setImageResource(R.drawable.show_more);
|
||||
}
|
||||
|
||||
|
||||
@ -192,7 +184,6 @@ public class MessageHeader extends ScrollView implements OnClickListener {
|
||||
// Show the additional headers that we have got.
|
||||
populateAdditionalHeadersView(additionalHeaders);
|
||||
mAdditionalHeadersView.setVisibility(View.VISIBLE);
|
||||
mShowAdditionalHeadersIcon.setImageResource(R.drawable.show_less);
|
||||
}
|
||||
if (!allHeadersDownloaded) {
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user