Search in sources :

Example 1 with MaterialSearchView

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;
        }
    });
}
Also used : JSONObject(org.json.JSONObject) SessionManager(dz.easy.androidclient.Util.SessionManager) JSONException(org.json.JSONException) MaterialSearchView(com.miguelcatalan.materialsearchview.MaterialSearchView) RecyclerView(android.support.v7.widget.RecyclerView) Toolbar(android.support.v7.widget.Toolbar)

Example 2 with MaterialSearchView

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
        }
    });
}
Also used : MaterialSearchView(com.miguelcatalan.materialsearchview.MaterialSearchView) Toolbar(android.support.v7.widget.Toolbar)

Example 3 with MaterialSearchView

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
        }
    });
}
Also used : MaterialSearchView(com.miguelcatalan.materialsearchview.MaterialSearchView) Toolbar(android.support.v7.widget.Toolbar)

Example 4 with MaterialSearchView

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
        }
    });
}
Also used : MaterialSearchView(com.miguelcatalan.materialsearchview.MaterialSearchView) Toolbar(android.support.v7.widget.Toolbar)

Example 5 with MaterialSearchView

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
        }
    });
}
Also used : MaterialSearchView(com.miguelcatalan.materialsearchview.MaterialSearchView) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

MaterialSearchView (com.miguelcatalan.materialsearchview.MaterialSearchView)10 Toolbar (android.support.v7.widget.Toolbar)9 RecyclerView (android.support.v7.widget.RecyclerView)3 View (android.view.View)2 TextView (android.widget.TextView)2 Intent (android.content.Intent)1 NinePatchDrawable (android.graphics.drawable.NinePatchDrawable)1 RecognizerIntent (android.speech.RecognizerIntent)1 ActionBar (android.support.v7.app.ActionBar)1 ActionBarActivity (android.support.v7.app.ActionBarActivity)1 ActionBarDrawerToggle (android.support.v7.app.ActionBarDrawerToggle)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 Window (android.view.Window)1 AdapterView (android.widget.AdapterView)1 ImageView (android.widget.ImageView)1 LinearLayout (android.widget.LinearLayout)1 BindView (butterknife.BindView)1 BmobUser (cn.bmob.v3.BmobUser)1 MaterialDialog (com.afollestad.materialdialogs.MaterialDialog)1 DescriptionAnimation (com.daimajia.slider.library.Animations.DescriptionAnimation)1