use of com.miguelcatalan.materialsearchview.MaterialSearchView in project easy by MehdiBenmesa.
the class RendezVousActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_rende_vous);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar3);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle("Chercher un enseignant");
toolbar.setTitleTextColor(Color.parseColor("#FFFFFF"));
lstView = (RecyclerView) findViewById(R.id.lstView);
/*ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, lstSource);
lstView.setAdapter(adapter);*/
SessionManager sessionManager = new SessionManager(this);
try {
user = new JSONObject(sessionManager.getUser());
} catch (JSONException e) {
e.printStackTrace();
}
getTeachers();
searcheView = (MaterialSearchView) findViewById(R.id.searche_view);
searcheView.setOnSearchViewListener(new MaterialSearchView.SearchViewListener() {
@Override
public void onSearchViewShown() {
}
@Override
public void onSearchViewClosed() {
lstView = (RecyclerView) findViewById(R.id.lstView);
/*ArrayAdapter adapter = new ArrayAdapter(RendezVousActivity.this, android.R.layout.simple_list_item_1, lstSource);
lstView.setAdapter(adapter);*/
// getTeachers();
}
});
searcheView.setOnQueryTextListener(new MaterialSearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
if (newText != null && !newText.isEmpty()) {
getTeachersSearcheed(newText);
} else {
getTeachers();
}
return true;
}
});
}
use of com.miguelcatalan.materialsearchview.MaterialSearchView in project MaterialSearchView by MiguelCatalan.
the class ColoredActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_colored);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
searchView = (MaterialSearchView) findViewById(R.id.search_view);
searchView.setVoiceSearch(false);
searchView.setCursorDrawable(R.drawable.color_cursor_white);
searchView.setSuggestions(getResources().getStringArray(R.array.query_suggestions));
searchView.setOnQueryTextListener(new MaterialSearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
Snackbar.make(findViewById(R.id.container), "Query: " + query, Snackbar.LENGTH_LONG).show();
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
// Do some magic
return false;
}
});
searchView.setOnSearchViewListener(new MaterialSearchView.SearchViewListener() {
@Override
public void onSearchViewShown() {
// Do some magic
}
@Override
public void onSearchViewClosed() {
// Do some magic
}
});
}
use of com.miguelcatalan.materialsearchview.MaterialSearchView in project MaterialSearchView by MiguelCatalan.
the class DefaultActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_default);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
searchView = (MaterialSearchView) findViewById(R.id.search_view);
searchView.setVoiceSearch(false);
searchView.setCursorDrawable(R.drawable.custom_cursor);
searchView.setEllipsize(true);
searchView.setSuggestions(getResources().getStringArray(R.array.query_suggestions));
searchView.setOnQueryTextListener(new MaterialSearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
Snackbar.make(findViewById(R.id.container), "Query: " + query, Snackbar.LENGTH_LONG).show();
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
// Do some magic
return false;
}
});
searchView.setOnSearchViewListener(new MaterialSearchView.SearchViewListener() {
@Override
public void onSearchViewShown() {
// Do some magic
}
@Override
public void onSearchViewClosed() {
// Do some magic
}
});
}
use of com.miguelcatalan.materialsearchview.MaterialSearchView in project MaterialSearchView by MiguelCatalan.
the class InputTypeActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_input_type);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
searchView = (MaterialSearchView) findViewById(R.id.search_view);
searchView.setVoiceSearch(false);
searchView.setCursorDrawable(R.drawable.custom_cursor);
searchView.setEllipsize(true);
searchView.setSuggestions(getResources().getStringArray(R.array.query_suggestions));
searchView.setOnQueryTextListener(new MaterialSearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
Snackbar.make(findViewById(R.id.container), "Query: " + query, Snackbar.LENGTH_LONG).show();
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
// Do some magic
return false;
}
});
searchView.setOnSearchViewListener(new MaterialSearchView.SearchViewListener() {
@Override
public void onSearchViewShown() {
// Do some magic
}
@Override
public void onSearchViewClosed() {
// Do some magic
}
});
}
use of com.miguelcatalan.materialsearchview.MaterialSearchView in project MaterialSearchView by MiguelCatalan.
the class VoiceActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_voice);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
searchView = (MaterialSearchView) findViewById(R.id.search_view);
searchView.setVoiceSearch(true);
searchView.setCursorDrawable(R.drawable.color_cursor_white);
searchView.setSuggestions(getResources().getStringArray(R.array.query_suggestions));
searchView.setOnQueryTextListener(new MaterialSearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
Snackbar.make(findViewById(R.id.container), "Query: " + query, Snackbar.LENGTH_LONG).show();
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
// Do some magic
return false;
}
});
searchView.setOnSearchViewListener(new MaterialSearchView.SearchViewListener() {
@Override
public void onSearchViewShown() {
// Do some magic
}
@Override
public void onSearchViewClosed() {
// Do some magic
}
});
}
Aggregations