-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmyListViewAdapter.cs
More file actions
51 lines (36 loc) · 1.18 KB
/
myListViewAdapter.cs
File metadata and controls
51 lines (36 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System.Collections.Generic;
using Android.Content;
using Android.Views;
using Android.Widget;
namespace po4
{
class myListViewAdapter : BaseAdapter<holder>
{
private List<holder> mItems;
private Context mContext;
public myListViewAdapter(Context context, List<holder> items)
{
mItems = items;
mContext = context;
}
public override int Count => mItems.Count;
public override long GetItemId(int position)
{
return position;
}
public override holder this[int position] => mItems[position];
public override View GetView(int position, View convertView, ViewGroup parent)
{
View row = convertView;
if (row == null)
{
row = LayoutInflater.From(mContext).Inflate(Resource.Layout.RowFabio, null, false);
}
TextView txt1 = row.FindViewById<TextView>(Resource.Id.txt1);
txt1.Text = mItems[position].first;
TextView txt2 = row.FindViewById<TextView>(Resource.Id.txt2);
txt2.Text = mItems[position].second;
return row;
}
}
}