mirror of
https://github.com/nextcloud/android.git
synced 2024-11-24 06:05:42 +03:00
Prevent that arbitrary text is queried instead of selecting a user / group of the suggestions list
This commit is contained in:
parent
9cdaddefa3
commit
2d854bc5a9
1 changed files with 17 additions and 0 deletions
|
@ -34,6 +34,7 @@ import android.widget.SearchView;
|
|||
|
||||
import com.owncloud.android.R;
|
||||
import com.owncloud.android.datamodel.OCFile;
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
|
||||
/**
|
||||
* Fragment for Searching users and groups
|
||||
|
@ -103,6 +104,22 @@ public class SearchFragment extends Fragment {
|
|||
);
|
||||
searchView.setIconifiedByDefault(false); // do not iconify the widget; expand it by default
|
||||
|
||||
//searchView.setImeOptions(EditorInfo.IME_ACTION_NEXT | EditorInfo.IME_FLAG_NO_FULLSCREEN);
|
||||
|
||||
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
||||
@Override
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
Log_OC.v(TAG, "onQueryTextSubmit intercepted, query: " + query);
|
||||
return true; // return true to prevent the query is processed to be queried;
|
||||
// a user / group will be picked only if selected in the list of suggestions
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextChange(String newText) {
|
||||
return false; // let it for the parent listener in the hierarchy / default behaviour
|
||||
}
|
||||
});
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue