Пример #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;
  }
Пример #2
0
 @Override
 public View getView(int position, View convertView, ViewGroup parent) {
   if (!favoritos) {
     Holder holder;
     if (convertView == null) {
       convertView = layoutInflater.inflate(R.layout.onibus_listview, null);
       holder = new Holder();
       holder.linhaNome = (TextView) convertView.findViewById(R.id.linha_nome);
       convertView.setTag(holder);
     } else {
       holder = (Holder) convertView.getTag();
     }
     Onibus onibus = lista.get(position);
     holder.linhaNome.setText(onibus.getLinha() + " - " + onibus.getNome());
   } else {
     Holder holder;
     if (convertView == null) {
       convertView = layoutInflater.inflate(R.layout.favoritos_listview, null);
       holder = new Holder();
       holder.linhaNome = (TextView) convertView.findViewById(R.id.linha_nome_favorito);
       convertView.setTag(holder);
     } else {
       holder = (Holder) convertView.getTag();
     }
     Onibus onibus = lista.get(position);
     holder.linhaNome.setText(onibus.getLinha() + " - " + onibus.getNome());
   }
   return convertView;
 }
Пример #3
0
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
      try {
        Holder myHolder;
        if (convertView == null) {
          myHolder = new Holder();
          convertView = inflater.inflate(R.layout.item_train_xibie_list_single, null);
          myHolder.seat_grad_tv = (TextView) convertView.findViewById(R.id.seat_grad_tv);
          myHolder.ticket_price_tv = (TextView) convertView.findViewById(R.id.ticket_price_tv);
          myHolder.remain_count_tv = (TextView) convertView.findViewById(R.id.remain_count_tv);
          myHolder.iv = (ImageView) convertView.findViewById(R.id.img);
          convertView.setTag(myHolder);
        } else {
          myHolder = (Holder) convertView.getTag();
        }
        // myHolder.iv.setBackgroundResource((Integer)
        // list.get(position).get("img"));
        if (position == this.currentID && !seats.get(position).getShengyu().equals("0")) {
          myHolder.iv.setBackgroundDrawable(
              c.getResources().getDrawable(R.drawable.checkmark_icon_selected));
          hasSelected = true;
          selectedSeatIndex = position;
          // 票价格和剩余票数 随所选座位变化
          ticket_price = Float.valueOf(seats.get(selectedSeatIndex).getPrice());
          remainTicketCount = Integer.valueOf(seats.get(selectedSeatIndex).getShengyu());
          seat_Type = seats.get(selectedSeatIndex).getType();
        } else if (!hasSelected && !seats.get(position).getShengyu().equals("0")) {
          myHolder.iv.setBackgroundDrawable(
              c.getResources().getDrawable(R.drawable.checkmark_icon_selected));
          hasSelected = true;
          selectedSeatIndex = position;
          ticket_price = Float.valueOf(seats.get(selectedSeatIndex).getPrice());
          remainTicketCount = Integer.valueOf(seats.get(selectedSeatIndex).getShengyu());
          seat_Type = seats.get(selectedSeatIndex).getType();
        } else {
          myHolder.iv.setBackgroundDrawable(
              c.getResources().getDrawable(R.drawable.checkmark_icon_unselected));
        }
        myHolder.seat_grad_tv.setText(seats.get(position).getType());
        myHolder.ticket_price_tv.setText("¥" + seats.get(position).getPrice());

        if (seats.get(position).getShengyu().equals("40")) {
          myHolder.remain_count_tv.setText("票源充足 ");
        } else {
          myHolder.remain_count_tv.setText("余票" + seats.get(position).getShengyu() + "张");
        }
        if (ti.getSeat_Type().equals(seats.get(position).getType())) { // 默认选中席别与前页列表中展现的相同
          selectedSeatIndex = currentID;
        }
        if (seats.get(position).getShengyu().equals("0")) { // 余票为0,不可预订
          myHolder.seat_grad_tv.setTextColor(getResources().getColor(R.color.gray));
          myHolder.ticket_price_tv.setTextColor(getResources().getColor(R.color.gray));
          myHolder.remain_count_tv.setTextColor(getResources().getColor(R.color.gray));
          myHolder.iv.setBackgroundDrawable(c.getResources().getDrawable(R.drawable.radio));
        }
      } catch (Exception e) {
        e.printStackTrace();
      }
      return convertView;
    }
Пример #4
0
    @Override
    public View getView(int i, View convertView, ViewGroup viewgroup) {
      // TODO Auto-generated method stub
      Holder childHolder = null;
      if (convertView == null) {
        childHolder = new Holder();
        convertView = mInflater.inflate(R.layout.respond_list_itemlayout, null);
        childHolder.phone = (TextView) convertView.findViewById(R.id.phoneTv);
        childHolder.isrespond = (TextView) convertView.findViewById(R.id.isRespond);
        convertView.setTag(childHolder);
      } else {
        childHolder = (Holder) convertView.getTag();
      }
      if (resonpList.get(i).get("type").equals("1")) {
        childHolder.phone.setText(resonpList.get(i).get("accept"));
        childHolder.isrespond.setText("接受");

      } else if (resonpList.get(i).get("type").equals("2")) {
        childHolder.phone.setText(resonpList.get(i).get("refuse"));
        childHolder.isrespond.setText("拒绝");
      } else {
        childHolder.phone.setText(resonpList.get(i).get("notRespond"));
        childHolder.isrespond.setText("未答复");
      }
      return convertView;
    }
    public Pair<ClassRepr, Set<UsageRepr.Usage>> getResult() {
      final ClassRepr repr =
          myTakeIntoAccount
              ? new ClassRepr(
                  myContext,
                  myAccess,
                  myFileName,
                  myName,
                  myContext.get(mySignature),
                  myContext.get(mySuperClass),
                  myInterfaces,
                  myNestedClasses,
                  myFields,
                  myMethods,
                  myTargets,
                  myRetentionPolicy,
                  myContext.get(myOuterClassName.get()),
                  myLocalClassFlag.get(),
                  myUsages)
              : null;

      if (repr != null) {
        repr.updateClassUsages(myContext, myUsages);
      }

      return new Pair<ClassRepr, Set<UsageRepr.Usage>>(repr, myUsages);
    }
Пример #6
0
    @Override
    public View getView(int position, View view, ViewGroup parent) {
      // TODO Auto-generated method stub
      if (view == null) {
        view =
            LayoutInflater.from(getApplicationContext()).inflate(R.layout.large_item_layout, null);
        holder = new Holder();

        holder.code = (TextView) view.findViewById(R.id.large_item_layout_product_code);
        holder.title = (TextView) view.findViewById(R.id.large_text_item);
        holder.quantity = (TextView) view.findViewById(R.id.large_text_quantity);
        holder.price = (TextView) view.findViewById(R.id.large_text_price);
        view.setTag(holder);
      } else {
        holder = (Holder) view.getTag();
      }

      //
      ArrayList<Product> list = basket.getList();

      Product p = list.get(position);
      String product_name = p.getName();
      String product_code = p.getProduct_Code();
      int product_quantity = basket.getMapQuan().get(p);
      int product_price = basket.getMapPrice().get(p);
      holder.code.setText(" <" + product_code + "> ");
      holder.title.setText(product_name);
      holder.quantity.setText(product_quantity + " item(s)");
      holder.price.setText(product_price + "");
      return view;
    }
Пример #7
0
  @Override
  public View getView(int position, View convertView, ViewGroup viewGroup) {
    Holder holder = null;
    View rowView = convertView;

    FileObj fileObj = filePathList.get(position);

    if (rowView == null) {

      Bitmap bitmap = BitmapFactory.decodeFile(fileObj.getFilePath());

      holder = new Holder();
      rowView = mInflater.inflate(R.layout.image_file_item, viewGroup, false);
      holder.picture = (ImageView) rowView.findViewById(R.id.picture);
      holder.text = (TextView) rowView.findViewById(R.id.text);
      holder.picture.setScaleType(ImageView.ScaleType.CENTER_CROP);

      holder.picture.setImageBitmap(bitmap);
      holder.picture.setScaleType(ImageView.ScaleType.CENTER_CROP);
      holder.text.setText(fileObj.getCreateTime());
      rowView.setTag(holder);

    } else {
      Bitmap bitmap = BitmapFactory.decodeFile(fileObj.getFilePath());
      holder = (Holder) rowView.getTag();
      holder.picture.setImageBitmap(bitmap);
      holder.picture.setScaleType(ImageView.ScaleType.CENTER_CROP);
      holder.text.setText(fileObj.getCreateTime());
    }
    return rowView;
  }
Пример #8
0
 public Collection<T> getToBeAdded() {
   List<T> adds = new ArrayList<T>();
   for (Holder<T> h : added) {
     adds.add(h.getValue());
   }
   return adds;
 }
Пример #9
0
 public void onDisable(int accountPos) {
   if (beneficiary_rg.getVisibility() != View.VISIBLE) {
     return;
   }
   AccountsModel mAccountsModel = getAccountsModel();
   String accountCode = null;
   if (mAccountsModel != null) {
     accountCode = mAccountsModel.getAccountCode();
   }
   accountPos = -1;
   if (accountCode != null && iBanCardaccounts != null) {
     int size = iBanCardaccounts.size();
     for (int i = 0; i < size; i++) {
       if (accountCode.equals(iBanCardaccounts.get(i).getAccountCode())) {
         accountPos = i;
         break;
       }
     }
   }
   if (disAblePosition == accountPos) {
     return;
   }
   if (disAblePosition >= 0) {
     Holder mHolder = (Holder) beneficiary_rg.getChildAt(disAblePosition).getTag();
     mHolder.onEnable(true);
   }
   disAblePosition = accountPos;
   if (disAblePosition >= 0) {
     Holder mHolder = (Holder) beneficiary_rg.getChildAt(disAblePosition).getTag();
     mHolder.onEnable(false);
   }
 }
Пример #10
0
  @Override
  public View view(int arg0, View arg1, ViewGroup arg2) {
    // TODO Auto-generated method stub
    Holder holder = null;
    final Project project = getData(arg0);
    if (arg1 == null) {
      arg1 = ShowUtil.LoadXmlView(getContext(), R.layout.project_item);
      holder = new Holder();
      holder.proName = (TextView) arg1.findViewById(R.id.project_item_name);
      holder.endTime = (TextView) arg1.findViewById(R.id.project_item_end_time);
      holder.serialNumber = (TextView) arg1.findViewById(R.id.project_item_serialNumber);
      holder.moneyType = (TextView) arg1.findViewById(R.id.project_item_moneytype);
      arg1.setTag(holder);
    } else {
      holder = (Holder) arg1.getTag();
    }
    holder.proName.setText(project.getName());
    boolean abort = Time.getInstance().dataIsAbort(project.getEndTime(), Time.DATE_PATTERN_6);
    holder.endTime.setText("截止时间:" + project.getEndTime() + (abort ? " 已截止" : ""));
    holder.serialNumber.setText("项目编号:" + project.getSerialNumber());
    holder.moneyType.setText("币种:" + project.getMoneyType());
    arg1.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View arg0) {
            // TODO Auto-generated method stub
            onItem(new Object[] {project});
          }
        });
    return arg1;
  }
Пример #11
0
  @Test
  public void testLdapReaderJob() {
    final LdapName name =
        LdapUtils.createLdapName(
            FACILITY.getNodeTypeName(), EFAN_NAME, UNIT.getNodeTypeName(), UNIT.getUnitTypeValue());

    final Holder<Boolean> read = new Holder<Boolean>(Boolean.FALSE);
    final ILdapReaderJob job =
        LDAP_SERVICE.createLdapReaderJob(
            new LdapSearchParams(name, LdapUtils.any(RECORD.getNodeTypeName())),
            new ILdapReadCompletedCallback() {
              @Override
              public void onLdapReadComplete() {
                read.setValue(Boolean.TRUE);
              }
            });
    job.schedule();
    try {
      job.join();
    } catch (final InterruptedException e) {
      Assert.fail("Not supposed to be interrupted.");
    }
    Assert.assertTrue(read.getValue());
    Assert.assertEquals(4, job.getSearchResult().getAnswerSet().size());
  }
Пример #12
0
  // Callback from one of the proxies to load the entire cache based
  // on a hit of getXXXXX (except for getId which doesn't need to go to database)
  public void loadCacheIfNeeded() {
    if (cacheLoaded) return;

    DboTableMeta metaDbo = metaClass.getMetaDbo();
    IndiceToVirtual virtKeys = new IndiceToVirtual(metaDbo, new ListWrappingCursor<byte[]>(keys));
    AbstractCursor<KeyValue<Row>> rows = session.find(metaDbo, virtKeys, false, true, null);
    String name = getClass().getSimpleName();
    log.info(
        name
            + ":just loaded rows for keylist(next convert to proxies)="
            + keys.size()
            + " for field="
            + field);
    int counter = 0;
    while (true) {
      com.alvazan.orm.api.z8spi.iter.AbstractCursor.Holder<KeyValue<Row>> holder = rows.nextImpl();
      if (holder == null) break;
      KeyValue<Row> kv = holder.getValue();
      Row row = kv.getValue();
      if (row != null || metaDbo.isEmbeddable()) {
        Holder<T> h = (Holder) originalHolders.get(counter);
        T value = h.getValue();
        if (value instanceof NoSqlProxy) {
          // inject the row into the proxy object here to load it's fields
          metaClass.fillInInstance(row, session, value);
          // ((NoSqlProxy)value).__injectData(row);
        }
      }

      counter++;
    }
    cacheLoaded = true;
  }
  @Override
  public View getView(final int position, View convertView, ViewGroup parent) {
    Holder holder = null;
    if (convertView == null) {
      holder = new Holder();
      convertView = inflater.inflate(R.layout.water_band_list_item, null);
      holder.tv_band_money = (TextView) convertView.findViewById(R.id.m_tv_band_money);
      holder.tv_band_name = (TextView) convertView.findViewById(R.id.m_tv_band_name);
      holder.iv_band_icon = (ImageView) convertView.findViewById(R.id.m_iv_band_icon);

      convertView.setTag(holder);
    } else {
      holder = (Holder) convertView.getTag();
    }
    WaterBand waterBand = waterBands.get(position);
    holder.tv_band_money.setText(
        "原价" + waterBand.getPrice() + "元/桶" + ",折扣价" + waterBand.getDis_price() + "元/桶");
    holder.tv_band_name.setText(waterBand.getName());
    finalBitmap.display(
        holder.iv_band_icon,
        waterBand.getImg_url(),
        defDrawable.getBitmap(),
        defDrawable.getBitmap());

    return convertView;
  }
        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
          Holder holder;
          if (convertView == null) {
            DisplayMetrics dm = new DisplayMetrics();
            BaijiaBrandListActivity.this.getWindowManager().getDefaultDisplay().getMetrics(dm);
            int width = dm.widthPixels;
            int itemwidth = (width / 3) - (2 * 5);

            holder = new Holder();
            convertView =
                (LinearLayout)
                    LinearLayout.inflate(
                        BaijiaBrandListActivity.this, R.layout.brandlist_item_layout, null);
            holder.imageview =
                (ImageView) convertView.findViewById(R.id.brandlist_item_layout_imageview);
            convertView.setTag(holder);

            Log.i("TAG", "BaiJiaBrandListActivity-->> w:" + itemwidth);
            holder.imageview.setLayoutParams(new LinearLayout.LayoutParams(itemwidth, itemwidth));
          } else {
            holder = (Holder) convertView.getTag();
          }

          String url = "";
          if (position <= (object_list.size() - 1)) {
            BrandInfoInfo bean = object_list.get(position);
            url = bean.getPic();
          }

          initPic(ToolsUtil.getImage(ToolsUtil.nullToString(url), 320, 0), holder.imageview);
          return convertView;
        }
Пример #15
0
  public void registerCallback(String forHref, ResourceCallback callback) {
    Holder holder = new Holder();
    holder.href = forHref;
    holder.callback = callback;

    callbacks.add(holder);
  }
  @Override
  public View getView(final int position, View convertView, ViewGroup viewGroup) {
    final Holder holder;

    if (convertView == null) {
      holder = new Holder();
      convertView = inflater.inflate(R.layout.list_view_item_comment_board, viewGroup, false);
      holder.deleteEntryButton = (ImageView) convertView.findViewById(R.id.delete_comment_button);
      holder.dateView = (TextView) convertView.findViewById(R.id.date_text_view);
      holder.contentView = (TextView) convertView.findViewById(R.id.content_text_view);
      holder.writerView = (TextView) convertView.findViewById(R.id.writer_text_view);
      convertView.setTag(holder);
    } else {
      holder = (Holder) convertView.getTag();
    }

    holder.dateView.setText(
        DateUtil.getInstance().formatMyDate(getItem(position).getDate().getValue()));
    holder.writerView.setText(getItem(position).getWriter());
    holder.contentView.setText(getItem(position).getMessage());

    final CommentBlackBoardActivity activity = (CommentBlackBoardActivity) context;
    holder.deleteEntryButton.setOnClickListener(
        new View.OnClickListener() {
          long commentId = getItem(position).getId();

          @Override
          public void onClick(View view) {
            activity.startDeleteComment(commentId, id);
          }
        });

    return convertView;
  }
Пример #17
0
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    View row = convertView;
    Holder holder;
    if (convertView == null) {
      LayoutInflater inflater =
          (LayoutInflater) this.getContext().getSystemService(getContext().LAYOUT_INFLATER_SERVICE);
      row = inflater.inflate(R.layout.row_layout, parent, false);
      holder = new Holder();
      holder.CuisineName = (TextView) row.findViewById(R.id.Name);
      holder.CuisineName.setTextColor(Color.BLACK);
      row.setTag(holder);
    } else {
      holder = (Holder) row.getTag();
    }
    final Cuisine cuisine = (Cuisine) getItem(position);
    holder.CuisineName.setText(cuisine.getName());
    final View.OnClickListener makeListener =
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            Intent intent = new Intent(context, CuisineBasedRestaurant.class);
            intent.putExtra(MESSAGE, cuisine.getId());
            intent.putExtra(ID, cuisine.getCity_id());
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(intent);
          }
        };

    row.setOnClickListener(makeListener);

    return row;
  }
Пример #18
0
  @Override
  public View getView(int i, View convertView, ViewGroup viewGroup) {
    Holder holder;

    if (convertView == null) {
      holder = new Holder();
      if (getItemViewType(i) == LocalMessageType.INCOMING.getId()) {
        convertView = mInflater.inflate(R.layout.list_view_item_message_incoming, viewGroup, false);
      } else if (getItemViewType(i) == LocalMessageType.OUTGOING_NOT_RECEIVED.getId()) {
        convertView =
            mInflater.inflate(
                R.layout.list_view_item_message_outgoing_not_received, viewGroup, false);
      } else {
        convertView =
            mInflater.inflate(R.layout.list_view_item_message_outgoing_received, viewGroup, false);
      }
      holder.content = (TextView) convertView.findViewById(R.id.item_message_content);
      holder.sendDate = (TextView) convertView.findViewById(R.id.item_message_date);
      convertView.setTag(holder);
    } else {
      holder = (Holder) convertView.getTag();
    }

    Message item = getItem(i);
    holder.content.setText(item.getContent());
    holder.sendDate.setText(convertDate(item.getSendDate()));

    return convertView;
  }
    @SuppressLint("InflateParams")
    @Override
    public View getView(int position, View convertView, ViewGroup viewGroup) {
      Holder holder;
      if (convertView == null) {
        convertView = inflater.inflate(R.layout.acciones_sobre_contacto_activity_item, null);
        holder = new Holder();
        holder.accion =
            (TextView) convertView.findViewById(R.id.acciones_sobre_contacto_item_accion);
        holder.valor = (TextView) convertView.findViewById(R.id.acciones_sobre_contacto_item_valor);
        holder.contactType =
            (TextView) convertView.findViewById(R.id.acciones_sobre_contacto_item_label);
        convertView.setTag(holder);
      } else {
        holder = (Holder) convertView.getTag();
      }

      Info info = (Info) getItem(position);
      holder.accion.setText(info.accion);
      holder.valor.setText(info.valor);

      if (info.contactType == null) {
        convertView
            .findViewById(R.id.acciones_sobre_contacto_item_label)
            .setVisibility(View.INVISIBLE);
        holder.contactType.setText("(null)");
      } else {
        convertView
            .findViewById(R.id.acciones_sobre_contacto_item_label)
            .setVisibility(View.VISIBLE);
        holder.contactType.setText(info.contactType);
      }

      return convertView;
    }
Пример #20
0
 @Override
 public View getView(int arg0, View arg1, ViewGroup arg2) {
   // TODO Auto-generated method stub
   Holder holder;
   if (arg1 == null) {
     holder = new Holder();
     arg1 = View.inflate(context, R.layout.item_image_bucket, null);
     holder.iv = (ImageView) arg1.findViewById(R.id.image);
     holder.selected = (ImageView) arg1.findViewById(R.id.isselected);
     holder.name = (TextView) arg1.findViewById(R.id.name);
     holder.count = (TextView) arg1.findViewById(R.id.count);
     arg1.setTag(holder);
   } else {
     holder = (Holder) arg1.getTag();
   }
   ImageBucket item = dataList.get(arg0);
   holder.count.setText("共" + item.count + "张");
   holder.name.setText(item.bucketName);
   holder.selected.setVisibility(View.GONE);
   if (item.imageList != null && item.imageList.size() > 0) {
     String thumbPath = item.imageList.get(0).thumbnailPath;
     String sourcePath = item.imageList.get(0).imagePath;
     holder.iv.setTag(sourcePath);
     cache.displayBmp(holder.iv, thumbPath, sourcePath, callback);
   } else {
     holder.iv.setImageBitmap(null);
     Log.e(TAG, "no images in bucket " + item.bucketName);
   }
   return arg1;
 }
Пример #21
0
  @Override
  public View getView(int position, View view, ViewGroup viewGroup) {
    if (view == null) {
      LayoutInflater inflater =
          (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      view = inflater.inflate(R.layout.device_row, viewGroup, false);
      viewHolder = new Holder();
      viewHolder.txtDeviceName = (TextView) view.findViewById(R.id.deviceName);
      viewHolder.txtDeviceModel = (TextView) view.findViewById(R.id.deviceModel);
      viewHolder.txtDeviceType = (TextView) view.findViewById(R.id.deviceType);
      view.setTag(viewHolder);
    } else {
      viewHolder = (Holder) view.getTag();
    }

    DevicesBO.Devices deviceInfo = devicesBean.getDevices().get(position);
    viewHolder.txtDeviceName.setText(deviceInfo.getName());
    viewHolder.txtDeviceModel.setText(deviceInfo.getModel());
    viewHolder.txtDeviceType.setText(deviceInfo.getDeviceType());

    if (position % 2 == 1) {
      view.setBackgroundColor(Color.GRAY);
    } else {
      view.setBackgroundColor(Color.LTGRAY);
    }

    return view;
  }
  private void populateView(Holder holder, int position) {

    ExhibitionsInfo exhibitionsInfo = getExhibitionsLists().get(position);

    holder.setExhibitionAvator(exhibitionsInfo.getExhibitionAvatorId());
    holder.setExhibitionDesc(exhibitionsInfo.getExhibitionDesc());
    holder.setExhibitionTitle(exhibitionsInfo.getExhibitionTitle());
  }
    @Override
    public void visitOuterClass(final String owner, final String name, final String desc) {
      myOuterClassName.set(owner);

      if (name != null) {
        myLocalClassFlag.set(true);
      }
    }
  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;
  }
 private static boolean isIndexedListLoopStatement(PsiForStatement forStatement, boolean ignoreUntypedCollections) {
   final PsiStatement initialization = forStatement.getInitialization();
   if (!(initialization instanceof PsiDeclarationStatement)) {
     return false;
   }
   final PsiDeclarationStatement declaration = (PsiDeclarationStatement)initialization;
   final PsiElement[] declaredElements = declaration.getDeclaredElements();
   final PsiElement secondDeclaredElement;
   if (declaredElements.length == 1) {
     secondDeclaredElement = null;
   }
   else if (declaredElements.length == 2) {
     secondDeclaredElement = declaredElements[1];
   }
   else {
     return false;
   }
   final PsiElement declaredElement = declaredElements[0];
   if (!(declaredElement instanceof PsiVariable)) {
     return false;
   }
   final PsiVariable indexVariable = (PsiVariable)declaredElement;
   final PsiExpression initialValue = indexVariable.getInitializer();
   if (initialValue == null) {
     return false;
   }
   final Object constant = ExpressionUtils.computeConstantExpression(initialValue);
   if (!(constant instanceof Number)) {
     return false;
   }
   final Number number = (Number)constant;
   if (number.intValue() != 0) {
     return false;
   }
   final PsiExpression condition = forStatement.getCondition();
   final Holder collectionHolder = getCollectionFromSizeComparison(condition, indexVariable, secondDeclaredElement);
   if (collectionHolder == null) {
     return false;
   }
   final PsiStatement update = forStatement.getUpdate();
   if (!VariableAccessUtils.variableIsIncremented(indexVariable, update)) {
     return false;
   }
   final PsiStatement body = forStatement.getBody();
   if (!isIndexVariableOnlyUsedAsListIndex(collectionHolder, indexVariable, body)) {
     return false;
   }
   if (collectionHolder != Holder.DUMMY) {
     final PsiVariable collection = collectionHolder.getVariable();
     final PsiClassType collectionType = (PsiClassType)collection.getType();
     final PsiType[] parameters = collectionType.getParameters();
     if (ignoreUntypedCollections && parameters.length == 0) {
       return false;
     }
     return !VariableAccessUtils.variableIsAssigned(collection, body);
   }
   return true;
 }
Пример #26
0
  @Override
  public Integer call() {
    logger.debug("Start runner");

    logger.info(holder.getOption1() + " " + holder.getOption2());
    done = true;
    logger.debug("End runner");

    return 0;
  }
  @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.train_list_item, null);
    holder.TrainName = (TextView) rowView.findViewById(R.id.train_name);
    holder.StationName1 = (TextView) rowView.findViewById(R.id.station_name1);
    holder.StationName2 = (TextView) rowView.findViewById(R.id.station_name2);
    holder.DepartureTime = (TextView) rowView.findViewById(R.id.departure_time);
    holder.ArrivalTime = (TextView) rowView.findViewById(R.id.arrival_time);
    holder.TravelTime = (TextView) rowView.findViewById(R.id.travel_time);
    holder.ClassesAvailable = (TextView) rowView.findViewById(R.id.classes_available);
    holder.RunsOnDays = (TextView) rowView.findViewById(R.id.runs_on);

    holder.TrainName.setText(Trains.get(position).TrainName);
    holder.StationName1.setText(Trains.get(position).Station1);
    holder.StationName2.setText(Trains.get(position).Station2);
    holder.DepartureTime.setText(Trains.get(position).DepatureTime);
    holder.ArrivalTime.setText(Trains.get(position).ArrivalTime);
    holder.TravelTime.setText(Trains.get(position).TravelTime);
    holder.ClassesAvailable.setText(Trains.get(position).ClassesAvailable);
    holder.RunsOnDays.setText(Trains.get(position).RunsOnDays);

    return rowView;
  }
Пример #28
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;
 }
Пример #29
0
 @Override
 public View newView(Context context, Cursor cursor, ViewGroup parent) {
   View result = LayoutInflater.from(context).inflate(R.layout.chat_list_item, parent, false);
   Holder holder = new Holder();
   holder.titleView = (TextView) result.findViewById(R.id.title);
   holder.unread = (TextView) result.findViewById(R.id.unread);
   holder.lastTime = (TextView) result.findViewById(R.id.lastTime);
   holder.lastMsg = (TextView) result.findViewById(R.id.lastMsg);
   result.setTag(holder);
   return result;
 }
Пример #30
0
 @Override
 public void bindView(View view, Context context, Cursor cursor) {
   Holder holder = (Holder) view.getTag();
   ChatListQuery.Row row = new ChatListQuery.Row(cursor);
   holder.titleView.setText(row.chatTitle);
   holder.lastMsg.setText(row.lastMsgText);
   holder.lastTime.setText(sdf.format(new Date(row.lastMsgTime)));
   holder.unread.setText(Long.toString(row.unreadMessagesCount));
   holder.unread.setVisibility((row.unreadMessagesCount > 0) ? View.VISIBLE : View.GONE);
   holder.id = row.chatId;
 }