Restart search after pausing

This commit is contained in:
Alex Sytnyk 2018-10-29 16:41:16 +02:00
parent 27aa4ae4a7
commit 566e2fe544

View file

@ -22,6 +22,7 @@ import android.support.v7.widget.Toolbar;
import android.text.Editable; import android.text.Editable;
import android.text.Spannable; import android.text.Spannable;
import android.text.SpannableString; import android.text.SpannableString;
import android.text.TextUtils;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.text.style.ForegroundColorSpan; import android.text.style.ForegroundColorSpan;
import android.view.KeyEvent; import android.view.KeyEvent;
@ -178,6 +179,7 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
private boolean newSearch; private boolean newSearch;
private boolean interruptedSearch; private boolean interruptedSearch;
private boolean pausedSearch;
private long hideTimeMs; private long hideTimeMs;
private boolean expired; private boolean expired;
private boolean poiFilterApplied; private boolean poiFilterApplied;
@ -985,12 +987,17 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
} }
expired = false; expired = false;
paused = false; paused = false;
if (pausedSearch && !TextUtils.isEmpty(searchQuery)) {
runSearch();
}
pausedSearch = false;
} }
@Override @Override
public void onPause() { public void onPause() {
super.onPause(); super.onPause();
paused = true; paused = true;
pausedSearch = searching;
hideTimeMs = System.currentTimeMillis(); hideTimeMs = System.currentTimeMillis();
stopLocationUpdate(); stopLocationUpdate();
hideProgressBar(); hideProgressBar();