Search in sources :

Example 1 with OnChildClickListener

use of android.widget.ExpandableListView.OnChildClickListener in project ExoPlayer by google.

the class SampleChooserActivity method onSampleGroups.

private void onSampleGroups(final List<SampleGroup> groups, boolean sawError) {
    if (sawError) {
        Toast.makeText(getApplicationContext(), R.string.sample_list_load_error, Toast.LENGTH_LONG).show();
    }
    ExpandableListView sampleList = (ExpandableListView) findViewById(R.id.sample_list);
    sampleList.setAdapter(new SampleAdapter(this, groups));
    sampleList.setOnChildClickListener(new OnChildClickListener() {

        @Override
        public boolean onChildClick(ExpandableListView parent, View view, int groupPosition, int childPosition, long id) {
            onSampleSelected(groups.get(groupPosition).samples.get(childPosition));
            return true;
        }
    });
}
Also used : View(android.view.View) TextView(android.widget.TextView) ExpandableListView(android.widget.ExpandableListView) ExpandableListView(android.widget.ExpandableListView) OnChildClickListener(android.widget.ExpandableListView.OnChildClickListener)

Example 2 with OnChildClickListener

use of android.widget.ExpandableListView.OnChildClickListener in project ETSMobile-Android2 by ApplETS.

the class BottinFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    ViewGroup v = (ViewGroup) inflater.inflate(R.layout.fragment_bottin, container, false);
    // get the listview
    expListView = (ExpandableListView) v.findViewById(R.id.expandableListView_service_employe);
    //Ouverture du détail
    expListView.setOnChildClickListener(new OnChildClickListener() {

        @Override
        public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
            FicheEmploye ficheEmploye = (FicheEmploye) listAdapter.getChild(groupPosition, childPosition);
            Intent i = new Intent(getActivity(), BottinDetailsActivity.class);
            i.putExtra("nom", ficheEmploye.Nom);
            i.putExtra("prenom", ficheEmploye.Prenom);
            i.putExtra("telBureau", ficheEmploye.TelBureau);
            i.putExtra("emplacement", ficheEmploye.Emplacement);
            i.putExtra("courriel", ficheEmploye.Courriel);
            i.putExtra("service", ficheEmploye.Service);
            i.putExtra("titre", ficheEmploye.Titre);
            getActivity().startActivity(i);
            return true;
        }
    });
    // create empty data
    listDataChild = new HashMap<>();
    listDataHeader = new ArrayList<>();
    // create custom adapter
    listAdapter = new ExpandableListAdapter(getActivity(), listDataHeader, listDataChild);
    // setting list adapter
    expListView.setAdapter(listAdapter);
    AnalyticsHelper.getInstance(getActivity()).sendScreenEvent(getClass().getSimpleName());
    return v;
}
Also used : ViewGroup(android.view.ViewGroup) Intent(android.content.Intent) ExpandableListAdapter(ca.etsmtl.applets.etsmobile.ui.adapter.ExpandableListAdapter) FicheEmploye(ca.etsmtl.applets.etsmobile.model.FicheEmploye) SearchView(android.support.v7.widget.SearchView) View(android.view.View) ExpandableListView(android.widget.ExpandableListView) BottinDetailsActivity(ca.etsmtl.applets.etsmobile.ui.activity.BottinDetailsActivity) OnChildClickListener(android.widget.ExpandableListView.OnChildClickListener) ExpandableListView(android.widget.ExpandableListView)

Aggregations

View (android.view.View)2 ExpandableListView (android.widget.ExpandableListView)2 OnChildClickListener (android.widget.ExpandableListView.OnChildClickListener)2 Intent (android.content.Intent)1 SearchView (android.support.v7.widget.SearchView)1 ViewGroup (android.view.ViewGroup)1 TextView (android.widget.TextView)1 FicheEmploye (ca.etsmtl.applets.etsmobile.model.FicheEmploye)1 BottinDetailsActivity (ca.etsmtl.applets.etsmobile.ui.activity.BottinDetailsActivity)1 ExpandableListAdapter (ca.etsmtl.applets.etsmobile.ui.adapter.ExpandableListAdapter)1