mirror of
https://github.com/leanote/leanote-android.git
synced 2025-10-14 14:10:56 +00:00
Search small adjustments
This commit is contained in:
@@ -91,7 +91,7 @@ public class NoteDataStore {
|
||||
DatabaseWrapper databaseWrapper = FlowManager.getWritableDatabase(AppDataBase.class);
|
||||
String query = "select id from note where userid = ? and istrash = 0 and isdeleted = 0 and id in " +
|
||||
"(select rowid from fts_note where fts_note match ?)";////查询Content中满足条件的记录
|
||||
Cursor cursor = databaseWrapper.rawQuery(query, new String[]{Account.getCurrent().getUserId(), keyword});
|
||||
Cursor cursor = databaseWrapper.rawQuery(query, new String[]{Account.getCurrent().getUserId(), "*" + keyword + "*"});
|
||||
while(cursor.moveToNext()) {
|
||||
set.add(cursor.getLong(cursor.getColumnIndex("id")));
|
||||
}
|
||||
|
@@ -33,15 +33,15 @@ public class SearchActivity extends BaseActivity {
|
||||
mSearchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
||||
@Override
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
return false;
|
||||
NoteFragment.Mode mode = NoteFragment.Mode.SEARCH;
|
||||
mode.setKeywords(query);
|
||||
mNoteFragment.setMode(mode);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextChange(String newText) {
|
||||
NoteFragment.Mode mode = NoteFragment.Mode.SEARCH;
|
||||
mode.setKeywords(newText);
|
||||
mNoteFragment.setMode(mode);
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user