@Override public View getView(final int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub final Holder holder = new Holder(); View rowView = convertView; rowView = inflater.inflate(R.layout.contactlistitem, null); holder.tv = (TextView) rowView.findViewById(R.id.contactname); holder.img = (ImageView) rowView.findViewById(R.id.contactimage); holder.tv.setText(contactNames.get(position)); holder.img.setImageBitmap(Utils.getFacebookPhoto(context, phoneNumber.get(position))); /*new AsyncTask<String, Void, Bitmap>() { @Override protected Bitmap doInBackground(String... params) { return ; } @Override protected void onPostExecute(Bitmap result) { super.onPostExecute(result); } }.execute(); rowView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { } });*/ return rowView; }
public View getView(final int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub final View rowView; rowView = inflater.inflate(R.layout.row, null); holder.tv = (TextView) rowView.findViewById(R.id.eventDescription); holder.img = (ImageView) rowView.findViewById(R.id.eventImage); holder.tv.setText(eventName.get(position)); holder.tvDistance = (TextView) rowView.findViewById(R.id.tvDistanceEventList); holder.tvCategories = (TextView) rowView.findViewById(R.id.tvCategories); int listCat = 0; for (int j = 0; j < categories.get(position).length(); j++) { if (categories.get(position).charAt(j) == ';') { listCat++; } } if (listCat > 0) { String categoriesSplit[] = categories.get(position).split(";"); StringBuilder categoriesList = new StringBuilder(); for (int i = 0; i < categoriesSplit.length; i++) { categoriesList.append(categoriesSplit[i] + "\n"); } holder.tvCategories.setText(categoriesList); } else { holder.tvCategories.setText(categories.get(position)); } LatLng eventLocation = new LatLng(locLon.get(position), locLat.get(position)); holder.tvDistance.setText( "Odległość od Ciebie: " + String.valueOf(MapTab.getDistance(eventLocation)) + "km"); String imageUrl = "http://188.122.12.144:50000/" + imageId.get(position); rowView.setTag(imageUrl); Picasso.with(rowView.getContext()).load(imageUrl).into(holder.img); rowView.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { EventDetail.who = 2; EventDetailTab.eventsList = UserEventsTab.getUserEvents; MapTab.events = UserEventsTab.getUserEvents; imageNumber = (int) getItem(position); EventDetailTab.index = imageNumber; MapTab.index = imageNumber; EventDetail.imgNumber = imageNumber; Intent intent = new Intent(context, EventDetail.class); context.startActivity(intent); } }); return rowView; }
@Override public View getView(int position, View convertView, ViewGroup parent) { Holder holder = new Holder(); View rowView; rowView = inflater.inflate(R.layout.custom_draw_item, null); holder.tv = (TextView) rowView.findViewById(R.id.nav_item); holder.img = (ImageView) rowView.findViewById(R.id.list_icon); holder.tv.setText(options[position]); holder.img.setImageResource(imageID[position]); return rowView; }
@Override public View getView(int position, View convertView, ViewGroup parent) { Holder holder; View v = convertView; if (convertView == null) { holder = new Holder(); v = inflater.inflate(R.layout.layout_custom_dialog_item, null); holder.tv = (TextView) v.findViewById(R.id.tv); v.setTag(holder); } else { holder = (Holder) v.getTag(); } holder.tv.setText(numbers[position]); return v; }
/* This is where we fill-in the views with the contents of the cursor. */ @Override public void bindView(View convertView, Context context, Cursor cur) { // our view is pretty simple here --- just a text view // we'll keep the UI functional with a simple (and slow!) binding. MovieInfo mi = new MovieInfo( cur.getString(MovieFragment.COL_MOVIE_KEY), cur.getString(MovieFragment.COL_MOVIE_ORIGINAL_TITLE), cur.getString(MovieFragment.COL_MOVIE_POSTER_IMAGE), cur.getString(MovieFragment.COL_MOVIE_PLOT_SYNOPSIS), cur.getString(MovieFragment.COL_MOVIE_USER_RATING), cur.getString(MovieFragment.COL_MOVIE_RELEASE_DATE), cur.getString(MovieFragment.COL_MOVIE_BACKDROP_PATH)); ImageView imageView; Holder holder = new Holder(); holder.tv = (TextView) convertView.findViewById(R.id.custom_grid_textview); holder.iv = (ImageView) convertView.findViewById(R.id.custom_grid_imageview); if (null == mi) { Picasso.with(mContext) // .load(mThumbIds[position]) .load(R.drawable.error) .error(R.drawable.error) // .noFade().resize(150, 150) // .centerCrop() .into(holder.iv); holder.tv.setText("Error"); } else { // Log.v(TAG, "position = " + position); String url = "http://image.tmdb.org/t/p/w185/" + mi.poster_image; // String url = "http://image.tmdb.org/t/p/w185/" + // cur.getString(MovieFragment.COL_MOVIE_POSTER_IMAGE); Log.v(TAG, "URL " + url); Picasso.with(mContext) .load(url) .error(R.drawable.error) // .noFade().resize(150, 150) // .centerCrop() .into(holder.iv); // holder.tv.setText(cur.getString(MovieFragment.COL_MOVIE_ORIGINAL_TITLE)); holder.tv.setText(mi.original_title); } }
@Override public View getView(final int position, View convertView, final ViewGroup parent) { // TODO Auto-generated method stub Holder holder = new Holder(); View rowView; rowView = inflater.inflate(R.layout.cart_list_row, parent, false); notifyDataSetChanged(); holder.tv = (TextView) rowView.findViewById(R.id.cartText); holder.tv1 = (TextView) rowView.findViewById(R.id.cartQuantity); holder.tv2 = (TextView) rowView.findViewById(R.id.cartPrice); holder.tv.setText(title.get(position)); holder.tv1.setText(quantity.get(position)); holder.tv2.setText(price.get(position)); return rowView; }