Skip to content

Instantly share code, notes, and snippets.

@JavaYank
Created January 18, 2019 06:24
Show Gist options
  • Save JavaYank/7b5aa4a216d660210cb7b4beebb227ad to your computer and use it in GitHub Desktop.
Save JavaYank/7b5aa4a216d660210cb7b4beebb227ad to your computer and use it in GitHub Desktop.
public class ListViewPaymentServiceAdapter extends BaseAdapter {
private Context mContext;
private List<String> icon;
private List<String> title;
private LayoutInflater mInflater;
public ListViewPaymentServiceAdapter(Context con, List<String> icons, List<String> titles) {
this.mContext = con;
this.icon = icons;
this.title = titles;
mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public int getCount() {
return title.size();
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = convertView;
if (convertView == null) view = mInflater.inflate(R.layout.item_list_row, parent, false);
TextView textView = view.findViewById(R.id.listViewText);
ImageView imageView = view.findViewById(R.id.listViewImg);
textView.setText(title.get(position));
Picasso.get().load("https://cabinet.smst.uz/images/icons/"+icon.get(position)).into(imageView);
return view;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment