1 | package ve.gob.cenditel.tibisaymovil; |
---|
2 | |
---|
3 | |
---|
4 | import android.content.Context; |
---|
5 | import android.view.LayoutInflater; |
---|
6 | import android.view.View; |
---|
7 | import android.view.ViewGroup; |
---|
8 | import android.widget.ArrayAdapter; |
---|
9 | import android.widget.TextView; |
---|
10 | |
---|
11 | /** |
---|
12 | * Adaptador para mostrar la lista de funciones disponibles al inicio |
---|
13 | * de la aplicación. |
---|
14 | * |
---|
15 | */ |
---|
16 | public class FunctionListAdapter extends ArrayAdapter<String> { |
---|
17 | private final Context context; |
---|
18 | private final String[] values; |
---|
19 | |
---|
20 | public FunctionListAdapter(Context context, String[] values) { |
---|
21 | super(context, R.layout.list_item, values); |
---|
22 | this.context = context; |
---|
23 | this.values = values; |
---|
24 | } |
---|
25 | |
---|
26 | @Override |
---|
27 | public View getView(int position, View convertView, ViewGroup parent) { |
---|
28 | LayoutInflater inflater = (LayoutInflater) context |
---|
29 | .getSystemService(Context.LAYOUT_INFLATER_SERVICE); |
---|
30 | |
---|
31 | View rowView = inflater.inflate(R.layout.list_item, parent, false); |
---|
32 | TextView textView1 = (TextView) rowView.findViewById(R.id.textView1); |
---|
33 | //TextView textView2 = (TextView) rowView.findViewById(R.id.textView2); |
---|
34 | textView1.setText(values[position]); |
---|
35 | |
---|
36 | // Change icon based on name |
---|
37 | String s = values[position]; |
---|
38 | |
---|
39 | System.out.println(s); |
---|
40 | |
---|
41 | return rowView; |
---|
42 | } |
---|
43 | } |
---|