mirror of
https://github.com/moparisthebest/k-9
synced 2024-12-25 09:08:49 -05:00
Merge pull request #265 from jca02266/master
If there is no message, it should return to a MessageList.
This commit is contained in:
commit
1a034d3e59
@ -1356,14 +1356,12 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showNextMessageOrReturn() {
|
public void showNextMessageOrReturn() {
|
||||||
if (K9.messageViewReturnToList()) {
|
if (K9.messageViewReturnToList() || !showNextMessage()) {
|
||||||
if (mDisplayMode == DisplayMode.SPLIT_VIEW) {
|
if (mDisplayMode == DisplayMode.SPLIT_VIEW) {
|
||||||
showMessageViewPlaceHolder();
|
showMessageViewPlaceHolder();
|
||||||
} else {
|
} else {
|
||||||
showMessageList();
|
showMessageList();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
showNextMessage();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1377,19 +1375,25 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
|
|||||||
mActionBarSubject.setMessageHeader(header);
|
mActionBarSubject.setMessageHeader(header);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showNextMessage() {
|
private boolean showNextMessage() {
|
||||||
MessageReference ref = mMessageViewFragment.getMessageReference();
|
MessageReference ref = mMessageViewFragment.getMessageReference();
|
||||||
if (ref != null) {
|
if (ref != null) {
|
||||||
mMessageListFragment.openNext(ref);
|
if (mMessageListFragment.openNext(ref)) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private void showPreviousMessage() {
|
private boolean showPreviousMessage() {
|
||||||
MessageReference ref = mMessageViewFragment.getMessageReference();
|
MessageReference ref = mMessageViewFragment.getMessageReference();
|
||||||
if (ref != null) {
|
if (ref != null) {
|
||||||
mMessageListFragment.openPrevious(ref);
|
if (mMessageListFragment.openPrevious(ref)) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private void showMessageList() {
|
private void showMessageList() {
|
||||||
mMessageListWasDisplayed = true;
|
mMessageListWasDisplayed = true;
|
||||||
|
@ -2882,22 +2882,24 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void openPrevious(MessageReference messageReference) {
|
public boolean openPrevious(MessageReference messageReference) {
|
||||||
int position = getPosition(messageReference);
|
int position = getPosition(messageReference);
|
||||||
if (position <= 0) {
|
if (position <= 0) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
openMessageAtPosition(position - 1);
|
openMessageAtPosition(position - 1);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void openNext(MessageReference messageReference) {
|
public boolean openNext(MessageReference messageReference) {
|
||||||
int position = getPosition(messageReference);
|
int position = getPosition(messageReference);
|
||||||
if (position < 0 || position == mAdapter.getCount() - 1) {
|
if (position < 0 || position == mAdapter.getCount() - 1) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
openMessageAtPosition(position + 1);
|
openMessageAtPosition(position + 1);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isFirst(MessageReference messageReference) {
|
public boolean isFirst(MessageReference messageReference) {
|
||||||
|
Loading…
Reference in New Issue
Block a user