SHOW:
|
|
- or go back to the newest paste.
| 1 | package com.tkm.mshop.adapters; | |
| 2 | ||
| 3 | import java.util.ArrayList; | |
| 4 | ||
| 5 | import android.content.Context; | |
| 6 | import android.view.LayoutInflater; | |
| 7 | import android.view.View; | |
| 8 | import android.view.ViewGroup; | |
| 9 | import android.widget.ArrayAdapter; | |
| 10 | ||
| 11 | - | import com.tkm.mshop.R; |
| 11 | + | |
| 12 | ||
| 13 | - | import com.tkm.mshop.view.ImageUrlCacheView; |
| 13 | + | public class ProductAdapter extends ArrayAdapter<BasketListElement> {
|
| 14 | - | import com.tkm.mshop.view.PriceViewer; |
| 14 | + | |
| 15 | - | import com.tkm.mshop.view.TextViewCustomFont; |
| 15 | + | private ArrayList<BasketListElement> items = null; |
| 16 | private int layoutID = 0; | |
| 17 | - | public class ListSeparatorAdapter extends ArrayAdapter<BasketListElement> {
|
| 17 | + | |
| 18 | public synchronized ArrayList<BasketListElement> getItems() {
| |
| 19 | - | private ArrayList<BasketListElement> headers = null; |
| 19 | + | return items; |
| 20 | } | |
| 21 | ||
| 22 | - | return headers; |
| 22 | + | public ProductAdapter(Context context, int textViewResourceId, |
| 23 | int layoutelemID, ArrayList<BasketListElement> objects) {
| |
| 24 | super(context, textViewResourceId, objects); | |
| 25 | - | public ListSeparatorAdapter(Context context, int textViewResourceId, |
| 25 | + | this.items = objects; |
| 26 | - | ArrayList<BasketListElement> objects) {
|
| 26 | + | this.layoutID = layoutelemID; |
| 27 | } | |
| 28 | - | this.headers = objects; |
| 28 | + | |
| 29 | @Override | |
| 30 | public View getView(int position, View convertView, ViewGroup parent) {
| |
| 31 | View v = convertView; | |
| 32 | if (v == null) {
| |
| 33 | LayoutInflater vi = (LayoutInflater) this.getContext() | |
| 34 | .getSystemService(Context.LAYOUT_INFLATER_SERVICE); | |
| 35 | v = vi.inflate(this.layoutID, null); | |
| 36 | ||
| 37 | - | v = vi.inflate(R.layout.listlists_elem, null); |
| 37 | + | |
| 38 | if (v != null) {
| |
| 39 | // on r�plique les donn�es | |
| 40 | BasketListElement ref = this.items.get(position); | |
| 41 | - | //BasketListElement ref = this.headers.get(position); |
| 41 | + | ref.copy(v); |
| 42 | - | //ref.copy(v); |
| 42 | + | |
| 43 | return v; | |
| 44 | } | |
| 45 | ||
| 46 | } |