-
Notifications
You must be signed in to change notification settings - Fork 0
/
DetailAdapter.java
48 lines (36 loc) · 1.45 KB
/
DetailAdapter.java
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
package android.egypt.Mina.myapp;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.squareup.picasso.Picasso;
/**
* Created by user on 12/1/2016.
*/
public class DetailAdapter extends ArrayAdapter<String>{
Context myContext;
String[] Trailer;
public DetailAdapter(Context context, String[] Trailer) {
super(context, R.layout.list_item, Trailer);
this.Trailer = Trailer;
myContext = context;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View convertView1 = convertView;
if (convertView1 == null) {
LayoutInflater inflater = (LayoutInflater) myContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView1 = inflater.inflate(R.layout.list_item, parent, false);
}
ImageView imageView = (ImageView) convertView1.findViewById(R.id.imageView3);
TextView textView= (TextView) convertView1.findViewById(R.id.textView4);
textView.setText("Trailer "+ (position+1));
Log.i("ereeny", Trailer[position]);
Picasso.with(myContext).load(Trailer[position]).placeholder(R.mipmap.ic_launcher).into(imageView);
return convertView1;
}
}