-
-
Save JavaYank/7b5aa4a216d660210cb7b4beebb227ad to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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