Ejemplo n.º 1
0
  @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;
  }
  @SuppressLint({"ViewHolder", "InflateParams"})
  @Override
  public View getView(final int position, View convertView, ViewGroup parent) {
    // 	TODO Auto-generated method stub

    Holder holder = new Holder();
    View rowView;

    rowView = inflater.inflate(R.layout.list_row, null);

    holder.fileName = (TextView) rowView.findViewById(R.id.title);
    holder.duration = (TextView) rowView.findViewById(R.id.artist);
    holder.size = (TextView) rowView.findViewById(R.id.duration);
    holder.category = (TextView) rowView.findViewById(R.id.category);
    holder.description = (TextView) rowView.findViewById(R.id.description);

    holder.img = (ImageView) rowView.findViewById(R.id.list_image);

    holder.fileName.setText(result[position]);
    holder.duration.setText(durations[position]);
    holder.size.setText(sizes[position]);
    holder.category.setText(categories[position]);
    holder.description.setText(descs[position]);

    holder.img.setImageResource(imageId[position]);

    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;
  }
Ejemplo n.º 4
0
 @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;
 }
Ejemplo n.º 5
0
 @Override
 public View getView(int arg0, View convertView, ViewGroup v) {
   if (convertView == null) {
     convertView = inflater.inflate(R.layout.item_menu, null);
     holder = new Holder();
     convertView.setTag(holder);
   } else {
     holder = (Holder) convertView.getTag();
   }
   holder.img = (ImageView) convertView.findViewById(R.id.img_menu);
   holder.name = (TextView) convertView.findViewById(R.id.tv_menu);
   holder.img.setImageResource(imgId[arg0]);
   holder.name.setText(texts[arg0]);
   return convertView;
 }
Ejemplo n.º 6
0
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    final Holder holder;
    if (convertView == null) {
      convertView = mInflater.inflate(resource, parent, false);
      holder = new Holder();
      holder.chkBox = (CheckBox) convertView.findViewById(R.id.checkbox);
      holder.img = (ImageView) convertView.findViewById(R.id.icon);
      holder.title = (TextView) convertView.findViewById(R.id.title);
      holder.subtitle = (TextView) convertView.findViewById(R.id.subtitle);
      convertView.setTag(holder);
    } else {
      holder = (Holder) convertView.getTag();
    }

    bindView(position, holder);

    convertView.setBackgroundColor(Color.TRANSPARENT);
    // when we scroll the gridview, we may creating the new item
    // in this case, we need to know the status of the checkbox

    return convertView;
  }