mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-10-25 06:05:54 +03:00
804: Fixed prev and submit button in search
While doing searching, if the content is changed, the search result will NOT change. So if prev and submit are clicked, it may not give the correct respond.
This commit is contained in:
parent
117a3c8e24
commit
5bfb3ee70a
1 changed files with 2 additions and 0 deletions
|
@ -102,6 +102,7 @@ public abstract class SearchableBaseNoteFragment extends BaseNoteFragment {
|
|||
|
||||
if (prev != null) {
|
||||
prev.setOnClickListener(v -> {
|
||||
occurrenceCount = countOccurrences(getContent(), searchView.getQuery().toString());
|
||||
currentOccurrence--;
|
||||
jumpToOccurrence();
|
||||
colorWithText(searchView.getQuery().toString(), currentOccurrence);
|
||||
|
@ -114,6 +115,7 @@ public abstract class SearchableBaseNoteFragment extends BaseNoteFragment {
|
|||
|
||||
@Override
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
colorWithText(query, currentOccurrence);
|
||||
currentOccurrence++;
|
||||
jumpToOccurrence();
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue