mirror of https://github.com/M66B/FairEmail.git
Reset search once only
This commit is contained in:
parent
cd608fb5f7
commit
0f4221ba65
|
@ -161,7 +161,9 @@ public class FragmentMessages extends FragmentBase {
|
||||||
private long primary;
|
private long primary;
|
||||||
private boolean outbox = false;
|
private boolean outbox = false;
|
||||||
private boolean connected;
|
private boolean connected;
|
||||||
|
private boolean reset = false;
|
||||||
private String searching = null;
|
private String searching = null;
|
||||||
|
private boolean loading = false;
|
||||||
private boolean manual = false;
|
private boolean manual = false;
|
||||||
private Integer lastUnseen = null;
|
private Integer lastUnseen = null;
|
||||||
|
|
||||||
|
@ -1867,6 +1869,7 @@ public class FragmentMessages extends FragmentBase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSaveInstanceState(Bundle outState) {
|
public void onSaveInstanceState(Bundle outState) {
|
||||||
|
outState.putBoolean("fair:reset", reset);
|
||||||
outState.putString("fair:searching", searching);
|
outState.putString("fair:searching", searching);
|
||||||
|
|
||||||
outState.putBoolean("fair:autoExpanded", autoExpanded);
|
outState.putBoolean("fair:autoExpanded", autoExpanded);
|
||||||
|
@ -1902,6 +1905,7 @@ public class FragmentMessages extends FragmentBase {
|
||||||
super.onActivityCreated(savedInstanceState);
|
super.onActivityCreated(savedInstanceState);
|
||||||
|
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
|
reset = savedInstanceState.getBoolean("fair:reset");
|
||||||
searching = savedInstanceState.getString("fair:searching");
|
searching = savedInstanceState.getString("fair:searching");
|
||||||
|
|
||||||
autoExpanded = savedInstanceState.getBoolean("fair:autoExpanded");
|
autoExpanded = savedInstanceState.getBoolean("fair:autoExpanded");
|
||||||
|
@ -2587,7 +2591,7 @@ public class FragmentMessages extends FragmentBase {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (viewType == AdapterMessage.ViewType.SEARCH) {
|
} else if (viewType == AdapterMessage.ViewType.SEARCH && !reset) {
|
||||||
new SimpleTask<Void>() {
|
new SimpleTask<Void>() {
|
||||||
@Override
|
@Override
|
||||||
protected Void onExecute(Context context, Bundle args) {
|
protected Void onExecute(Context context, Bundle args) {
|
||||||
|
@ -2597,6 +2601,7 @@ public class FragmentMessages extends FragmentBase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onExecuted(Bundle args, Void data) {
|
protected void onExecuted(Bundle args, Void data) {
|
||||||
|
reset = true;
|
||||||
loadMessagesNext(top);
|
loadMessagesNext(top);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2609,8 +2614,6 @@ public class FragmentMessages extends FragmentBase {
|
||||||
loadMessagesNext(top);
|
loadMessagesNext(top);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean loading = false;
|
|
||||||
|
|
||||||
private void loadMessagesNext(final boolean top) {
|
private void loadMessagesNext(final boolean top) {
|
||||||
if (top)
|
if (top)
|
||||||
adapter.gotoTop();
|
adapter.gotoTop();
|
||||||
|
|
Loading…
Reference in New Issue