blob: 0ac58e7a4e04ae9a6a7c538711366a0d2c2796f1 (
plain)
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
|
package de.danoeh.antennapod.adapter;
import java.util.List;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.miroguide.model.MiroGuideChannel;
public class MiroGuideChannelListAdapter extends ArrayAdapter<MiroGuideChannel> {
public MiroGuideChannelListAdapter(Context context, int textViewResourceId,
List<MiroGuideChannel> objects) {
super(context, textViewResourceId, objects);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Holder holder;
MiroGuideChannel channel = getItem(position);
// Inflate Layout
if (convertView == null) {
holder = new Holder();
LayoutInflater inflater = (LayoutInflater) getContext()
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.miroguide_channellist_item, null);
holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
convertView.setTag(holder);
} else {
holder = (Holder) convertView.getTag();
}
holder.title.setText(channel.getName());
return convertView;
}
static class Holder {
TextView title;
}
}
|