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;
}
});
}
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;
}
Aggregations