Example #1
0
    @SuppressLint("NewApi")
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
      ViewHolder holder;
      if (convertView == null) {
        holder = new ViewHolder();
        convertView = mInflater.inflate(R.layout.order_item, null);
        holder.date = (TextView) convertView.findViewById(R.id.item_date);
        holder.location = (TextView) convertView.findViewById(R.id.item_location);
        holder.name = (TextView) convertView.findViewById(R.id.item_name);
        holder.time = (TextView) convertView.findViewById(R.id.item_time);
        holder.type = (TextView) convertView.findViewById(R.id.item_type);
        holder.company = (TextView) convertView.findViewById(R.id.item_company);
        holder.isDone = (TextView) convertView.findViewById(R.id.item_isDone);
        convertView.setTag(holder);
      } else {
        holder = (ViewHolder) convertView.getTag();
      }
      TaskInfo taskInfo = tasklist.get(position);
      String ServiceDate = null;
      String serviceBegin = taskInfo.ServiceBegin();
      String serviceEnd = taskInfo.ServiceEnd();
      if (serviceBegin.equals(serviceEnd)) {
        ServiceDate = serviceBegin;
      } else {
        ServiceDate = serviceBegin + "-" + serviceEnd;
      }
      holder.time.setText(taskInfo.OnboardTime());
      holder.date.setText(ServiceDate);
      holder.location.setText(taskInfo.PickupAddress());
      holder.name.setText(taskInfo.Customer());
      holder.type.setText(taskInfo.ServiceTypeName());
      holder.company.setText(taskInfo.getCustomerCompany());
      String isUpdate = taskInfo.getIsUpdate();
      int readmark = taskInfo.getReadmark();
      if (taskInfo.getRouteNoteCount() > 0) {
        holder.isDone.setVisibility(View.VISIBLE);
        holder.isDone.setText("已完成");
        holder.isDone.setBackgroundColor(Color.parseColor("#009944"));
      } else if (null != pauseNote && pauseNote.getTaskID().equals(taskInfo.TaskID())) {
        holder.isDone.setVisibility(View.VISIBLE);
        holder.isDone.setText("暂停中");
        holder.isDone.setBackgroundColor(Color.parseColor("#eb6100"));

        //				holder.isDone.setBackground(getResources().getColor(R.color.colorYellow));
      } else if (readmark == 1) {
        holder.isDone.setVisibility(View.GONE);
      } else if (readmark == 0) {
        holder.isDone.setVisibility(View.VISIBLE);
        holder.isDone.setBackground(getResources().getDrawable(R.drawable.bg_red));
        if (isUpdate.equals("0")) {
          holder.isDone.setText("新增");
        } else {
          holder.isDone.setText("修改");
        }
      } else {
        holder.isDone.setVisibility(View.GONE);
      }
      return convertView;
    }
 public View getView(int position, View convertView, ViewGroup parent) {
   ViewHolder holder = null;
   if (convertView == null) {
     convertView =
         LayoutInflater.from(PhotoShareActivity.this)
             .inflate(R.layout.photoshare_activity_location_item, null);
     holder = new ViewHolder();
     holder.icon =
         (ImageView) convertView.findViewById(R.id.photoshare_activity_location_item_icon);
     holder.name =
         (TextView) convertView.findViewById(R.id.photoshare_activity_location_item_name);
     holder.location =
         (TextView) convertView.findViewById(R.id.photoshare_activity_location_item_location);
     convertView.setTag(holder);
   } else {
     holder = (ViewHolder) convertView.getTag();
   }
   LocationResult result = mKXApplication.mMyLocationResults.get(position);
   if (mLocationPosition == position) {
     holder.icon.setVisibility(View.VISIBLE);
   } else {
     holder.icon.setVisibility(View.INVISIBLE);
   }
   holder.name.setText(result.getName());
   holder.location.setText(result.getLocation());
   return convertView;
 }
Example #3
0
    @Override
    public View getView(final int position, View convertView, ViewGroup parent) {
      View view = convertView;
      final ViewHolder holder;
      if (convertView == null) {
        view = LayoutInflater.from(context).inflate(R.layout.timeline_item, parent, false);
        holder = new ViewHolder();
        holder.location = (TextView) view.findViewById(R.id.tv_location);
        holder.time = (TextView) view.findViewById(R.id.tv_time);
        holder.description = (TextView) view.findViewById(R.id.tv_desc);
        holder.image = (ImageView) view.findViewById(R.id.iv_coverimg);
        view.setTag(holder);
      } else {
        holder = (ViewHolder) view.getTag();
      }
      final IndexModel model = data.get(position);
      holder.location.setText(model.location);
      Handler handler =
          new Handler() {

            @Override
            public void handleMessage(Message msg) {
              // TODO Auto-generated method stub
              super.handleMessage(msg);
              imageLoader.displayImage(
                  (String) msg.obj, holder.image, options, animateFirstListener);
            }
          };
      Hack.downloadPhoto(activity, model.coverImgUrl, handler);
      holder.image.setOnClickListener(
          new OnClickListener() {

            @Override
            public void onClick(View v) {
              // TODO Auto-generated method stub
              Intent intent = new Intent(activity, WaterfallActivity.class);
              intent.putExtra("galleryid", model.galleryID);
              activity.startActivity(intent);
            }
          });
      holder.time.setText(model.timeStart + "-" + model.timeEnd);
      holder.description.setText(model.galleryID);
      return view;
    }
Example #4
0
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    View rowView = convertView;
    if (rowView == null) {
      LayoutInflater inflater = this.context.getLayoutInflater();
      rowView = inflater.inflate(R.layout.row_waypoint, null);
      ViewHolder viewHolder = new ViewHolder();
      viewHolder.description = (TextView) rowView.findViewById(R.id.description);
      viewHolder.location = (TextView) rowView.findViewById(R.id.location);
      viewHolder.enter = (ImageView) rowView.findViewById(R.id.enter);
      viewHolder.leave = (ImageView) rowView.findViewById(R.id.leave);

      rowView.setTag(viewHolder);
    }

    Waypoint w = getItem(position);

    ViewHolder holder = (ViewHolder) rowView.getTag();
    holder.description.setText(w.getDescription());
    holder.location.setText(w.getLatitude() + ":" + w.getLongitude());

    if ((w.getRadius() != null) && (w.getRadius() > 0)) {

      if ((w.getTransitionType() & Geofence.GEOFENCE_TRANSITION_ENTER) != 0)
        holder.enter.setVisibility(View.VISIBLE);
      else holder.enter.setVisibility(View.GONE);

      if ((w.getTransitionType() & Geofence.GEOFENCE_TRANSITION_EXIT) != 0)
        holder.leave.setVisibility(View.VISIBLE);
      else holder.leave.setVisibility(View.GONE);

    } else {
      holder.enter.setVisibility(View.GONE);
      holder.leave.setVisibility(View.GONE);
    }

    return rowView;
  }
Example #5
0
  @Override
  public View getView(int i, View view, ViewGroup viewGroup) {
    ViewHolder holder = null;
    if (view == null) {
      holder = new ViewHolder();
      view = inflater.inflate(R.layout.userlist_item, null);

      holder.profileImage = (SmartImageView) view.findViewById(R.id.profile_img);
      holder.screenName = (TextView) view.findViewById(R.id.screen_name);
      holder.gender = (TextView) view.findViewById(R.id.gender);
      holder.location = (TextView) view.findViewById(R.id.location);
      holder.weiboCnt = (TextView) view.findViewById(R.id.weibo_cnt);
      holder.followCnt = (TextView) view.findViewById(R.id.follow_cnt);
      holder.fansCnt = (TextView) view.findViewById(R.id.fans_cnt);
      holder.description = (TextView) view.findViewById(R.id.description);
      view.setTag(holder);
    } else {
      holder = (ViewHolder) view.getTag();
    }
    final User user = this.users.get(i);
    holder.profileImage.setImageUrl(user.getProfileImageUrl());
    holder.screenName.setText(user.getScreenName());
    if (user.getGender().equals("m")) {
      holder.gender.setText("男");
    } else if (user.getGender().equals("f")) {
      holder.gender.setText("女");
    } else {
      holder.gender.setText("未知");
    }
    holder.location.setText(user.getLocation());
    holder.weiboCnt.setText(user.getStatusesCount() + "微博");
    holder.followCnt.setText(user.getFriendsCount() + "关注");
    holder.fansCnt.setText(user.getFollowersCount() + "粉丝");
    holder.description.setText("");
    return view;
  }
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    final ViewHolder holder;
    if (convertView == null) {
      convertView = minflater.inflate(R.layout.store_list_cell, null);
      holder = new ViewHolder();

      holder.location = ((TextView) convertView.findViewById(R.id.location));
      holder.address = ((TextView) convertView.findViewById(R.id.address));
      holder.mobile = ((TextView) convertView.findViewById(R.id.mobile));
      holder.mobileName = ((TextView) convertView.findViewById(R.id.mobileName));
      holder.call = ((Button) convertView.findViewById(R.id.bCall));

      convertView.setTag(holder);
    } else {
      holder = (ViewHolder) convertView.getTag();
    }

    StoreLocatorResponseObject slro = getItem(position);

    holder.location.setText(slro.location);
    holder.address.setText(slro.address);

    if (slro.mobileNumber != null && !slro.mobileNumber.isEmpty()) {
      holder.mobile.setText(slro.mobileNumber);
    } else if (slro.phoneNumber != null && !slro.phoneNumber.isEmpty()) {
      holder.mobile.setText(slro.phoneNumber);
    } else {
      holder.mobileName.setVisibility(View.GONE);
      holder.mobile.setVisibility(View.GONE);
      holder.call.setVisibility(View.GONE);
    }

    holder.call.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {

            if (UIUtilities.isPhoneAvailable(mContext)) {
              UIUtilities.showCallConfirmationAlert(
                  mContext,
                  holder.mobile.getText().toString(),
                  R.string.calling,
                  R.string.callingMessage,
                  R.string.nobtn,
                  R.string.yesbtn);

            } else {
              UIUtilities.showConfirmationAlert(
                  mContext,
                  R.string.dialog_title_information,
                  "Your device don't have call facility!",
                  R.string.dialog_button_Ok,
                  new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int which) {}
                  });
            }
          }
        });

    return convertView;
  }