@Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder vh; if (convertView == null) { // inflate the layout LayoutInflater inflater = ((Activity) context).getLayoutInflater(); convertView = inflater.inflate(R.layout.item_message, parent, false); vh = new ViewHolder(); vh.username = (TextView) convertView.findViewById(R.id.msg_user); vh.message = (TextView) convertView.findViewById(R.id.msg_message); vh.date = (TextView) convertView.findViewById(R.id.msg_date); convertView.setTag(vh); } else { vh = (ViewHolder) convertView.getTag(); } vh.username.setText(getItem(position).getUsername()); vh.message.setText(Html.fromHtml(getItem(position).getMsg())); try { vh.date.setText(DateHelper.getFormattedDate(getItem(position).getDate())); } catch (ParseException e) { Log.e(Constants.TAG, "error parsing date", e); } return convertView; }
@Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; long duree; if (convertView == null) { holder = new ViewHolder(); convertView = inflater.inflate(R.layout.history_list_item, parent, false); holder.date = (TextView) convertView.findViewById(R.id.history_list_item_date); holder.period = (TextView) convertView.findViewById(R.id.history_list_item_period); holder.hours = (TextView) convertView.findViewById(R.id.history_list_item_hours); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } holder.date.setText(dateFormat.format(tataDays.get(position).getDate())); holder.period.setText( hoursFormat.format(tataDays.get(position).getBegin()) + " - " + hoursFormat.format(tataDays.get(position).getEnd())); duree = tataDays.get(position).getEnd().getTime() - tataDays.get(position).getBegin().getTime(); holder.hours.setText(Utility.convertSecondsToHHMmSs(duree)); return convertView; }
@Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder = null; if (convertView == null) { convertView = mInflater.inflate(R.layout.sms_list_item, parent, false); holder = new ViewHolder(); holder.name = (TextView) convertView.findViewById(R.id.name); holder.count = (TextView) convertView.findViewById(R.id.count); holder.date = (TextView) convertView.findViewById(R.id.date); holder.content = (TextView) convertView.findViewById(R.id.content); } else { holder = (ViewHolder) convertView.getTag(); } holder.name.setText(smsList.get(position).getAddress()); holder.count.setText("(" + smsList.get(position).getMsg_count() + ")"); this.date.setTime(smsList.get(position).getDate()); holder.date.setText(this.sdf.format(date)); holder.content.setText(smsList.get(position).getMsg_snippet()); convertView.setTag(holder); return convertView; }
@Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder viewHolder; if (convertView == null) { LayoutInflater inflater = LayoutInflater.from(getContext()); convertView = inflater.inflate(R.layout.list_view_activitybook_adapter, parent, false); viewHolder = new ViewHolder(); viewHolder.title = (TextView) convertView.findViewById(R.id.tvTitle); viewHolder.date = (TextView) convertView.findViewById(R.id.tvDate); viewHolder.active = (TextView) convertView.findViewById(R.id.tvActive); convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder) convertView.getTag(); } Activitybook item = getItem(position); viewHolder.title.setText(item.getName()); viewHolder.date.setText("Created On: " + item.getCreatedAt()); if (item.getActive() != null && item.getActive().equals("1")) viewHolder.active.setText("Active"); else viewHolder.active.setText("Inactive"); return convertView; }
@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; }
@Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder viewHolder = null; if (convertView == null) { convertView = mLayoutInflater.inflate(R.layout.item_my_message, null); viewHolder = new ViewHolder(); viewHolder.img = (ImageView) convertView.findViewById(R.id.item_my_message_imageview); viewHolder.nameTextView = (TextView) convertView.findViewById(R.id.item_my_message_name); viewHolder.date = (TextView) convertView.findViewById(R.id.item_my_message_date); viewHolder.circleImage = (ImageView) convertView.findViewById(R.id.circle); convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder) convertView.getTag(); } MyMessageItem item = getItem(position); viewHolder.nameTextView.setText(item.nickname); viewHolder.date.setText(item.last_time); /*SystemManager.getInstance().getSystem(SystemImageLoader.class) .displayImageSquare(item.image, viewHolder.img);*/ getSystem(SystemCommon.class) .displayDefaultImage( ActivityChatList.this, viewHolder.img, item.image, SystemCommon.SQUARE); if (item.readed.equals("1")) { viewHolder.circleImage.setVisibility(ImageView.INVISIBLE); } else { viewHolder.circleImage.setVisibility(ImageView.VISIBLE); } return convertView; }
@Override public View getView(int position, View convertView, ViewGroup parent) { View view = convertView; final ViewHolder holder; if (convertView == null) { view = LayoutInflater.from(mContext).inflate(R.layout.xianshi_shouji_leavewords_item, null); holder = new ViewHolder(); holder.content = (TextView) view.findViewById(R.id.pinglun_content); holder.date = (TextView) view.findViewById(R.id.pinglun_date); holder.name = (TextView) view.findViewById(R.id.pinglun_name); holder.category = (TextView) view.findViewById(R.id.pinglun_category); holder.number = (TextView) view.findViewById(R.id.pinglun_nub); view.setTag(holder); } else { holder = (ViewHolder) view.getTag(); } holder.content.setText(mLinkedList.get(position).getContent()); holder.date.setText( MyUtlis.TimeStamp2DateList(mLinkedList.get(position).getCtime(), context)); holder.name.setText( getResources().getString(R.string.contact_name) + mLinkedList.get(position).getNickname()); holder.category.setText(mLinkedList.get(position).getCategory()); holder.number.setText( getResources().getString(R.string.contact) + mLinkedList.get(position).getContact()); return view; }
@Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { holder = new ViewHolder(); convertView = inflater.inflate(R.layout.all_patient_appo_item, parent, false); holder.layout = (RelativeLayout) convertView.findViewById(R.id.layout); holder.date = (TextView) convertView.findViewById(R.id.date); holder.visitType = (TextView) convertView.findViewById(R.id.visitType); holder.time = (TextView) convertView.findViewById(R.id.time); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } final int pos = position; holder.date.setText( UtilSingleInstance.getInstance() .getOnlyDateFormattedInStringFormatUsingLong(appointment.get(position).getDateTime())); holder.time.setText( UtilSingleInstance.getInstance() .getOnlyTimeFormattedInStringFormatUsingLong(appointment.get(position).getDateTime())); holder.visitType.setText( UtilSingleInstance.getUserVisitType(appointment.get(position).getVisitType())); // holder.time.setText(appointment.get(position).getBookTime()); return convertView; }
// 设置主列表布局中的详细内容 @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder = null; final String iNumbers = (String) mList.get(position).get(mIndex[1]); String iDate = (String) mList.get(position).get(mIndex[2]); final String iIssueNo = (String) mList.get(position).get(mIndex[3]); if (convertView == null) { convertView = mInflater.inflate(R.layout.win_lot_high_frequency_item, null); holder = new ViewHolder(); holder.date = (TextView) convertView.findViewById(R.id.notice_prizes_single_specific_noticedDate_id); holder.issue = (TextView) convertView.findViewById(R.id.notice_prizes_single_specific_issue_id); holder.imgView = (ImageView) convertView.findViewById(R.id.notice_prizes_single_specific_img); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } holder.imgView.setVisibility(ImageView.INVISIBLE); holder.date.setText(iNumbers); holder.date.setTextColor(Color.RED); holder.issue.setText("第" + iIssueNo + "期"); return convertView; }
@Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub ViewHolder holder; if (convertView == null) { convertView = inflater.inflate(R.layout.message_list_item, null); holder = new ViewHolder(); holder.icon = (ImageView) convertView.findViewById(R.id.recent_userhead); holder.name = (TextView) convertView.findViewById(R.id.recent_name); holder.date = (TextView) convertView.findViewById(R.id.recent_time); holder.msg = (TextView) convertView.findViewById(R.id.recent_msg); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } final KFChatEntity entity = list.get(position); KFSLog.d("conv.id " + entity.getId() + " conv.name:" + entity.getName()); // 首先获取昵称,如果昵称未设置,则显示对方用户名 if (entity.isSend() == 1) // 自己发送的消息 { holder.name.setText("自己发送的消息"); // 设置自己的头像 updateVCardThread(KFSettingsManager.getSettingsManager(context).getUsername(), holder.icon); } else { // 收到对方的消息 String nickname = KFIMInterfaces.getOtherNickname(entity.getName()); if (nickname == null) { nickname = entity.getName(); } holder.name.setText("收到来自:" + nickname + "的消息"); // 设置对方的头像 updateVCardThread(entity.getName(), holder.icon); } holder.name.setTextColor(Color.BLACK); holder.date.setText(entity.getDate()); holder.msg.setText("消息ID:" + entity.getId() + " 消息内容:" + entity.getText()); convertView.setOnCreateContextMenuListener( new OnCreateContextMenuListener() { @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { // TODO Auto-generated method stub Log.d(TAG, "setOnCreateContextMenuListener"); } }); return convertView; }
@Override public View getView(final int position, View convertView, ViewGroup parent) { View view = null; if (convertView == null) { view = LayoutInflater.from(context).inflate(R.layout.item_post, parent, false); } else { view = convertView; } ViewHolder holder; if (view.getTag() == null) { holder = new ViewHolder(); holder.date = (TextView) view.findViewById(R.id.item_post_date); holder.name = (TextView) view.findViewById(R.id.item_post_name); holder.excerpt = (TextView) view.findViewById(R.id.item_post_excerpt); holder.click = (RelativeLayout) view.findViewById(R.id.item_post_click); holder.cardView = (CardView) view.findViewById(R.id.item_post_card_view); holder.readTag = (TextView) view.findViewById(R.id.item_post_read_tag); } else { holder = (ViewHolder) view.getTag(); } holder.date.setVisibility(View.GONE); String lastDate = null; if (position != 0) { lastDate = getItem(position - 1).getDate(); } String nowDate = getItem(position).getDate(); if (lastDate == null || !lastDate.equals(nowDate)) { holder.date.setVisibility(View.VISIBLE); } holder.date.setText(getItem(position).getDate()); holder.name.setText(map.get(getItem(position).getName())); holder.excerpt.setText(getItem(position).getExcerpt()); holder.cardView.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { clickCallBack.onClick(position, getItem(position)); } }); // 未读标识 String date = getItem(position).getDate(); date = date.replaceAll("-", ""); boolean isRead = readDB.isRead(date, getItem(position).getName()); holder.readTag.setVisibility(View.VISIBLE); if (isRead) { holder.readTag.setVisibility(View.INVISIBLE); } return view; }
public static ViewHolder getHolder(View convertView) { ViewHolder holder = new ViewHolder(); holder.isGroupHolder = true; holder.groupName = (TextView) convertView.findViewById(R.id.schedule_name); holder.date = (TextView) convertView.findViewById(R.id.schedule_date); holder.size = 0; for (int i = 0; i < DEFAULT_NUM_ENTRANTS; i++) { addRow(convertView.findViewById(rowIds[i]), i, holder); } return holder; }
@Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = mInflater.inflate(R.layout.post, parent, false); mViewHolder = new ViewHolder(); mViewHolder.thumbnail = (ImageView) convertView.findViewById(R.id.post_thumbnail); mViewHolder.author = (TextView) convertView.findViewById(R.id.post_author); mViewHolder.title = (TextView) convertView.findViewById(R.id.post_title); mViewHolder.date = (TextView) convertView.findViewById(R.id.post_date); convertView.setTag(mViewHolder); } else { mViewHolder = (ViewHolder) convertView.getTag(); } mPost = mPosts.get(position); /*if (mPost.getThumbnail() != null) { */ /*new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... params) { try { URL url = new URL(mPost.getThumbnail()); mBitmap = BitmapFactory.decodeStream(url.openConnection().getInputStream()); } catch (MalformedURLException e) { } catch (IOException e) { } return null; } }.execute();*/ /* mViewHolder.thumbnail.setImageBitmap(mBitmap); } Picasso.with(mActivity) .load(mPost.getThumbnail()) .into(mViewHolder.thumbnail); */ mViewHolder.date.setText(mPost.getStartDate() + " to " + mPost.getEndDate()); mViewHolder.title.setText(mPost.getNameTitle() + ""); mViewHolder.author.setText(mPost.getDescription()); // mViewHolder.date.setText(mPost.getStartDateString()); return convertView; }
@Override public View getView(final int position, View convertView, ViewGroup parent) { final ViewHolder viewHolder; LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); if (convertView == null) { viewHolder = new ViewHolder(); convertView = inflater.inflate(R.layout.listviewadaptor, null); viewHolder.title = (TextView) convertView.findViewById(R.id.textTitleOfTask); viewHolder.description = (TextView) convertView.findViewById(R.id.textDescription); viewHolder.importanceRating = (RatingBar) convertView.findViewById(R.id.listItemRatingImporatnce); viewHolder.isCompleted = (CheckBox) convertView.findViewById(R.id.checkWorkCompleted); viewHolder.date = (TextView) convertView.findViewById(R.id.lastDate); viewHolder.deleteItem = (ImageView) convertView.findViewById(R.id.deleteItem); convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder) convertView.getTag(); } viewHolder.title.setText(tasks.get(position).getTaskTitle()); int a = tasks.get(position).isCompleted() ? viewHolder.title.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG : 0; viewHolder.title.setPaintFlags(a); ////////////////////////////////////////////////////////////////// viewHolder.date.setText("Last Date: \n" + tasks.get(position).getTaskDate()); viewHolder.deleteItem.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { // onclick. onDeleteClicked(position); } }); ////////////////////////////////////////////////////////////////// viewHolder.isCompleted.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { // onclick. onClickCheckbox(position, tasks.get(position).isCompleted()); } }); viewHolder.description.setText(tasks.get(position).getTaskDescription()); viewHolder.importanceRating.setProgress(tasks.get(position).getImportanceStarRating() * 2); viewHolder.isCompleted.setChecked(tasks.get(position).isCompleted()); return convertView; }
public View getView(int position, View view, ViewGroup parent) { ViewHolder holder; // LayoutInflater inflater = (LayoutInflater) context.getSystemService // (Activity.LAYOUT_INFLATER_SERVICE); if (view == null) { view = LayoutInflater.from(context).inflate(R.layout.pic_and_text_list, parent, false); holder = new ViewHolder(); holder.data = (TextView) view.findViewById(R.id.data); holder.date = (TextView) view.findViewById(R.id.date); holder.id = (TextView) view.findViewById(R.id.id); view.setTag(holder); } else holder = (ViewHolder) view.getTag(); // set textviews and imageview for (int i = 0; i < items.size(); i++) { JSONObject fullContentItem = getItem(position); try { String id = fullContentItem.getString("id"); holder.id.setText("ID: " + id); String data = fullContentItem.getString("data"); holder.data.setText("Data: " + data); String date = fullContentItem.getString("date"); holder.date.setText("Date: " + date); String type = fullContentItem.getString("type"); // if (type.equals("image")) { // Picasso.with(context) // .load(data) // .into(holder.icon); // } // else if (type.equals("text")){ //// homeActivity.addShowHideListener(holder, webViewFragment); // // // // } } catch (JSONException e) { e.printStackTrace(); } } return view; }
@Override public View getView(int position, View convertView, ViewGroup parent) { View view = convertView; ViewHolder holder = null; if (view == null) { view = context.getLayoutInflater().inflate(R.layout.program_list_widget, null); holder = new ViewHolder(); holder.title = (TextView) view.findViewById(R.id.title); holder.state = (ImageView) view.findViewById(R.id.state); holder.time = (TextView) view.findViewById(R.id.time); holder.date = (TextView) view.findViewById(R.id.date); holder.duration = (TextView) view.findViewById(R.id.duration); holder.progress = (TextView) view.findViewById(R.id.progress); holder.seriesInfo = (TextView) view.findViewById(R.id.series_info); holder.contentType = (TextView) view.findViewById(R.id.content_type); holder.summary = (TextView) view.findViewById(R.id.summary); holder.description = (TextView) view.findViewById(R.id.description); holder.genre = (TextView) view.findViewById(R.id.genre); view.setTag(holder); } else { holder = (ViewHolder) view.getTag(); } // Get the program and assign all the values Program p = getItem(position); if (p != null) { holder.title.setText(p.title); Utils.setState(holder.state, p.recording); Utils.setDate(holder.date, p.start); Utils.setTime(holder.time, p.start, p.stop); Utils.setDuration(holder.duration, p.start, p.stop); Utils.setProgressText(holder.progress, p.start, p.stop); Utils.setDescription(null, holder.summary, p.summary); Utils.setDescription(null, holder.description, p.description); Utils.setContentType(null, holder.contentType, p.contentType); Utils.setSeriesInfo(null, holder.seriesInfo, p.seriesInfo); Utils.setGenreColor(context, holder.genre, p, TAG); } return view; }
@Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub if (convertView != null) { holder = (ViewHolder) convertView.getTag(); } else { convertView = LayoutInflater.from(mContext).inflate(R.layout.comment_item, null); holder = new ViewHolder(); holder.content = (TextView) convertView.findViewById(R.id.comm_list_content); holder.date = (TextView) convertView.findViewById(R.id.comm_list_date); holder.name = (TextView) convertView.findViewById(R.id.comm_list_username); holder.imageView_head = (ImageView) convertView.findViewById(R.id.comm_list_usericon); convertView.setTag(holder); } CommentOfStatus comment = comments.get(position); holder.content.setText(comment.getContent()); holder.date.setText(comment.getCtime()); holder.name.setText(comment.getComment_user().getUname()); imageLoader.DisplayImage(comment.getComment_user().getHeadicon(), holder.imageView_head); strcontent = comment.getContent(); return convertView; }
// 设置主列表布局中的详细内容 @Override public View getView(int position, View convertView, ViewGroup parent) { RWSharedPreferences shellRW = new RWSharedPreferences(NoticeMainActivity.this, ShellRWConstants.CAIZHONGSETTING); String iGameType = (String) mList.get(position).get(mIndex[0]); String Codetry = ""; if (iGameType.equals("fc3d")) { Codetry = (String) mList.get(position).get("tryCode"); } String iNumbers = (String) mList.get(position).get(mIndex[1]); String iDate = (String) mList.get(position).get(mIndex[2]); final String iIssue = (String) mList.get(position).get(mIndex[3]); String iIssueNo = "第" + iIssue + "期"; ViewHolder holder = null; convertView = mInflater.inflate(R.layout.notice_prizes_main_layout, null); holder = new ViewHolder(); holder.icon = (ImageView) convertView.findViewById(R.id.icon); holder.name = (TextView) convertView.findViewById(R.id.notice_prizes_main_title); holder.numbers = (LinearLayout) convertView.findViewById(R.id.ball_linearlayout); holder.date = (TextView) convertView.findViewById(R.id.notice_prizes_dateAndTimeId); holder.issue = (TextView) convertView.findViewById(R.id.notice_prizes_issueId); holder.lookBtn = (Button) convertView.findViewById(R.id.notice_prizes_main_btn_jc); holder.rLayout = (RelativeLayout) convertView.findViewById(R.id.notice_prizes_relative); holder.numbers.removeAllViews(); convertView.setTag(holder); holder.name.setText(getName(iGameType)); holder.icon.setImageResource(getIcon(iGameType)); if (iGameType.equals("ssq")) { holder.date.setText(iDate); holder.date.setVisibility(TextView.VISIBLE); holder.issue.setText(iIssueNo); holder.issue.setVisibility(TextView.VISIBLE); // zlm 7.28 代码修改:添加号码排序 int i1, i2, i3; String iShowNumber; OneBallView tempBallView; int[] ssqInt01 = new int[6]; int[] ssqInt02 = new int[6]; String[] ssqStr = new String[6]; for (i2 = 0; i2 < 6; i2++) { iShowNumber = iNumbers.substring(i2 * 2, i2 * 2 + 2); ssqInt01[i2] = Integer.valueOf(iShowNumber); } ssqInt02 = PublicMethod.sort(ssqInt01); for (i3 = 0; i3 < 6; i3++) { if (ssqInt02[i3] < 10) { ssqStr[i3] = "0" + ssqInt02[i3]; } else { ssqStr[i3] = "" + ssqInt02[i3]; } } for (i1 = 0; i1 < 6; i1++) { // iShowNumber = iNumbers.substring(i1 * 2, i1 * 2 + 2); tempBallView = new OneBallView(convertView.getContext(), 1); tempBallView.initBall(BALL_WIDTH, BALL_WIDTH, ssqStr[i1], aRedColorResId); tempBallView.setScaleType(ScaleType.CENTER_INSIDE); holder.numbers.addView(tempBallView); } iShowNumber = iNumbers.substring(12, 14); tempBallView = new OneBallView(convertView.getContext(), 1); tempBallView.initBall(BALL_WIDTH, BALL_WIDTH, iShowNumber, aBlueColorResId); holder.numbers.addView(tempBallView); } else if (iGameType.equals("fc3d")) { holder.date.setText(iDate); holder.date.setVisibility(TextView.VISIBLE); holder.issue.setText(iIssueNo); holder.issue.setVisibility(TextView.VISIBLE); int i1; // zlm 7.30 代码修改:修改福彩3D号码 int iShowNumber; OneBallView tempBallView; for (i1 = 0; i1 < 3; i1++) { iShowNumber = Integer.valueOf(iNumbers.substring(i1 * 2, i1 * 2 + 2)); tempBallView = new OneBallView(convertView.getContext(), 1); tempBallView.initBall(BALL_WIDTH, BALL_WIDTH, "" + iShowNumber, aRedColorResId); holder.numbers.addView(tempBallView); } TextView trycode = new TextView(NoticeMainActivity.this); trycode.setTextColor(Color.BLUE); trycode.setTextSize(17); trycode.setPadding(10, 10, 0, 0); String codeshow = ""; for (i1 = 0; i1 < 3; i1++) { codeshow += Codetry.substring(i1 * 2 + 1, i1 * 2 + 2); if (i1 != 2) { codeshow += ","; } } trycode.setText("试机号:" + codeshow); holder.numbers.addView(trycode); } else if (iGameType.equals("qlc")) { int deletW = 4; holder.date.setText(iDate); holder.date.setVisibility(TextView.VISIBLE); holder.issue.setText(iIssueNo); holder.issue.setVisibility(TextView.VISIBLE); // zlm 7.28 代码修改:添加号码排序 int i1, i2, i3; String iShowNumber; OneBallView tempBallView; int[] ssqInt01 = new int[7]; int[] ssqInt02 = new int[7]; String[] ssqStr = new String[7]; for (i2 = 0; i2 < 7; i2++) { iShowNumber = iNumbers.substring(i2 * 2, i2 * 2 + 2); ssqInt01[i2] = Integer.valueOf(iShowNumber); } ssqInt02 = PublicMethod.sort(ssqInt01); for (i3 = 0; i3 < 7; i3++) { if (ssqInt02[i3] < 10) { ssqStr[i3] = "0" + ssqInt02[i3]; } else { ssqStr[i3] = "" + ssqInt02[i3]; } } for (i1 = 0; i1 < 7; i1++) { tempBallView = new OneBallView(convertView.getContext(), 1); tempBallView.initBall( BALL_WIDTH - deletW, BALL_WIDTH - deletW, ssqStr[i1], aRedColorResId); holder.numbers.addView(tempBallView); } // zlm 8.3 代码修改 :添加七乐彩蓝球 iShowNumber = iNumbers.substring(14, 16); tempBallView = new OneBallView(convertView.getContext(), 1); tempBallView.initBall( BALL_WIDTH - deletW, BALL_WIDTH - deletW, iShowNumber, aBlueColorResId); holder.numbers.addView(tempBallView); } else if (iGameType.equals("cjdlt")) { holder.date.setText(iDate); holder.date.setVisibility(TextView.VISIBLE); holder.issue.setText(iIssueNo); holder.issue.setVisibility(TextView.VISIBLE); // zlm 7.28 代码修改:添加号码排序 int i1, i2, i3; String iShowNumber = ""; OneBallView tempBallView; int[] cjdltInt01 = new int[5]; int[] cjdltInt02 = new int[5]; int[] cjdltInt03 = new int[2]; int[] cjdltInt04 = new int[2]; String[] cjdltStr = new String[5]; String[] cjdltStr1 = new String[2]; for (i2 = 0; i2 < 5; i2++) { iShowNumber = iNumbers.substring(i2 * 3, i2 * 3 + 2); cjdltInt01[i2] = Integer.valueOf(iShowNumber); } cjdltInt02 = PublicMethod.sort(cjdltInt01); for (i3 = 0; i3 < 5; i3++) { if (cjdltInt02[i3] < 10) { cjdltStr[i3] = "0" + cjdltInt02[i3]; } else { cjdltStr[i3] = "" + cjdltInt02[i3]; } } for (i1 = 0; i1 < 5; i1++) { tempBallView = new OneBallView(convertView.getContext(), 1); tempBallView.initBall(BALL_WIDTH, BALL_WIDTH, cjdltStr[i1], aRedColorResId); holder.numbers.addView(tempBallView); } for (i2 = 0; i2 < 2; i2++) { try { iShowNumber = iNumbers.substring(i2 * 3 + 15, i2 * 3 + 17); } catch (Exception e) { e.printStackTrace(); } cjdltInt03[i2] = Integer.valueOf(iShowNumber); } cjdltInt04 = PublicMethod.sort(cjdltInt03); for (i3 = 0; i3 < 2; i3++) { if (cjdltInt04[i3] < 10) { cjdltStr1[i3] = "0" + cjdltInt04[i3]; } else { cjdltStr1[i3] = "" + cjdltInt04[i3]; } } for (i1 = 0; i1 < 2; i1++) { tempBallView = new OneBallView(convertView.getContext(), 1); tempBallView.initBall(BALL_WIDTH, BALL_WIDTH, cjdltStr1[i1], aBlueColorResId); holder.numbers.addView(tempBallView); } } else if (iGameType.equals("pl3")) { holder.date.setText(iDate); holder.date.setVisibility(TextView.VISIBLE); holder.issue.setText(iIssueNo); holder.issue.setVisibility(TextView.VISIBLE); int i1; int iShowNumber; OneBallView tempBallView; for (i1 = 0; i1 < 3; i1++) { iShowNumber = Integer.valueOf(iNumbers.substring(i1, i1 + 1)); tempBallView = new OneBallView(convertView.getContext(), 1); tempBallView.initBall(BALL_WIDTH, BALL_WIDTH, "" + iShowNumber, aRedColorResId); holder.numbers.addView(tempBallView); } } else if (iGameType.equals("pl5")) { holder.date.setText(iDate); holder.date.setVisibility(TextView.VISIBLE); holder.issue.setText(iIssueNo); holder.issue.setVisibility(TextView.VISIBLE); int i1; int iShowNumber; OneBallView tempBallView; for (i1 = 0; i1 < 5; i1++) { iShowNumber = Integer.valueOf(iNumbers.substring(i1, i1 + 1)); tempBallView = new OneBallView(convertView.getContext(), 1); tempBallView.initBall(BALL_WIDTH, BALL_WIDTH, "" + iShowNumber, aRedColorResId); holder.numbers.addView(tempBallView); } } else if (iGameType.equals("qxc")) { holder.date.setText(iDate); holder.date.setVisibility(TextView.VISIBLE); holder.issue.setText(iIssueNo); holder.issue.setVisibility(TextView.VISIBLE); int i1; int iShowNumber; OneBallView tempBallView; for (i1 = 0; i1 < 7; i1++) { iShowNumber = Integer.valueOf(iNumbers.substring(i1, i1 + 1)); tempBallView = new OneBallView(convertView.getContext(), 1); tempBallView.initBall(BALL_WIDTH, BALL_WIDTH, "" + iShowNumber, aRedColorResId); holder.numbers.addView(tempBallView); } } else if (iGameType.equals("ssc")) { holder.date.setText(iDate); holder.date.setVisibility(TextView.VISIBLE); holder.issue.setText(iIssueNo); holder.issue.setVisibility(TextView.VISIBLE); int i1; int iShowNumber; OneBallView tempBallView; for (i1 = 0; i1 < 5; i1++) { iShowNumber = Integer.valueOf(iNumbers.substring(i1, i1 + 1)); tempBallView = new OneBallView(convertView.getContext(), 1); tempBallView.initBall(BALL_WIDTH, BALL_WIDTH, "" + iShowNumber, aRedColorResId); holder.numbers.addView(tempBallView); } } else if (iGameType.equals("11-5")) { holder.date.setText(iDate); holder.date.setVisibility(TextView.VISIBLE); holder.issue.setText(iIssueNo); holder.issue.setVisibility(TextView.VISIBLE); int i1; int iShowNumber; OneBallView tempBallView; for (i1 = 0; i1 < 5; i1++) { iShowNumber = Integer.valueOf(iNumbers.substring(i1 * 2, i1 * 2 + 2)); String isNum = PublicMethod.getZhuMa(iShowNumber); tempBallView = new OneBallView(convertView.getContext(), 1); tempBallView.initBall(BALL_WIDTH, BALL_WIDTH, isNum, aRedColorResId); holder.numbers.addView(tempBallView); } } else if (iGameType.equals("11-ydj")) { holder.date.setText(iDate); holder.date.setVisibility(TextView.VISIBLE); holder.issue.setText(iIssueNo); holder.issue.setVisibility(TextView.VISIBLE); int i1; int iShowNumber; OneBallView tempBallView; for (i1 = 0; i1 < 5; i1++) { iShowNumber = Integer.valueOf(iNumbers.substring(i1 * 2, i1 * 2 + 2)); String isNum = PublicMethod.getZhuMa(iShowNumber); tempBallView = new OneBallView(convertView.getContext(), 1); tempBallView.initBall(BALL_WIDTH, BALL_WIDTH, isNum, aRedColorResId); holder.numbers.addView(tempBallView); } } else if (iGameType.equals("22-5")) { holder.date.setText(iDate); holder.date.setVisibility(TextView.VISIBLE); holder.issue.setText(iIssueNo); holder.issue.setVisibility(TextView.VISIBLE); int i1; int iShowNumber; OneBallView tempBallView; for (i1 = 0; i1 < 5; i1++) { iShowNumber = Integer.valueOf(iNumbers.substring(i1 * 2, i1 * 2 + 2)); String isNum = PublicMethod.getZhuMa(iShowNumber); tempBallView = new OneBallView(convertView.getContext(), 1); tempBallView.initBall(BALL_WIDTH, BALL_WIDTH, isNum, aRedColorResId); holder.numbers.addView(tempBallView); } } else if (iGameType.equals("sfc")) { holder.date.setText(iDate); holder.date.setVisibility(TextView.VISIBLE); holder.issue.setText(iIssueNo); holder.issue.setVisibility(TextView.VISIBLE); TextView tvFootball = new TextView(convertView.getContext()); // tvFootball.setTextColor( R.color.darkgreen); tvFootball.setTextSize(25); tvFootball.setGravity(Gravity.RIGHT); tvFootball.setText(iNumbers); holder.numbers.addView(tvFootball); } else if (iGameType.equals("rxj")) { holder.date.setText(iDate); holder.date.setVisibility(TextView.VISIBLE); holder.issue.setText(iIssueNo); holder.issue.setVisibility(TextView.VISIBLE); TextView tvFootball = new TextView(convertView.getContext()); // tvFootball.setTextColor( R.color.darkgreen); tvFootball.setTextSize(25); tvFootball.setGravity(Gravity.RIGHT); tvFootball.setText(iNumbers); holder.numbers.addView(tvFootball); } else if (iGameType.equals("lcb")) { holder.date.setText(iDate); holder.date.setVisibility(TextView.VISIBLE); holder.issue.setText(iIssueNo); holder.issue.setVisibility(TextView.VISIBLE); TextView tvFootball = new TextView(convertView.getContext()); tvFootball.setGravity(Gravity.RIGHT); // tvFootball.setTextColor( R.color.darkgreen); tvFootball.setTextSize(25); tvFootball.setText(iNumbers); holder.numbers.addView(tvFootball); } else if (iGameType.equals("jqc")) { holder.date.setText(iDate); holder.date.setVisibility(TextView.VISIBLE); holder.issue.setText(iIssueNo); holder.issue.setVisibility(TextView.VISIBLE); TextView tvFootball = new TextView(convertView.getContext()); // tvFootball.setTextColor( R.color.darkgreen); tvFootball.setTextSize(25); tvFootball.setGravity(Gravity.RIGHT); tvFootball.setText(iNumbers); holder.numbers.addView(tvFootball); } else if (iGameType.equals("gd-11-5")) { holder.date.setText(iDate); holder.date.setVisibility(TextView.VISIBLE); holder.issue.setText(iIssueNo); holder.issue.setVisibility(TextView.VISIBLE); int i1; int iShowNumber; OneBallView tempBallView; for (i1 = 0; i1 < 5; i1++) { iShowNumber = Integer.valueOf(iNumbers.substring(i1 * 2, i1 * 2 + 2)); String isNum = PublicMethod.getZhuMa(iShowNumber); tempBallView = new OneBallView(convertView.getContext(), 1); tempBallView.initBall(BALL_WIDTH, BALL_WIDTH, isNum, aRedColorResId); holder.numbers.addView(tempBallView); } } else if (iGameType.equals("gd-10")) { int deletW = 4; holder.name.setTextSize(PublicMethod.getPxInt(7, context)); holder.date.setText(iDate); holder.date.setVisibility(TextView.VISIBLE); holder.issue.setText(iIssueNo); holder.issue.setVisibility(TextView.VISIBLE); int i1; int iShowNumber; OneBallView tempBallView; for (i1 = 0; i1 < 8; i1++) { iShowNumber = Integer.valueOf(iNumbers.substring(i1 * 2, i1 * 2 + 2)); if (iShowNumber == 19 || iShowNumber == 20) { tempBallView = new OneBallView(convertView.getContext(), 1); tempBallView.initBall(BALL_WIDTH, BALL_WIDTH, "" + iShowNumber, aRedColorResId); holder.numbers.addView(tempBallView); } else { tempBallView = new OneBallView(convertView.getContext(), 1); tempBallView.initBall( BALL_WIDTH - deletW, BALL_WIDTH - deletW, "" + iShowNumber, aBlueColorResId); holder.numbers.addView(tempBallView); } } } else if (iGameType.equals("jcz")) { holder.rLayout.setVisibility(RelativeLayout.GONE); holder.lookBtn.setVisibility(Button.VISIBLE); holder.lookBtn.setBackgroundResource(R.drawable.join_info_btn_selecter); holder.lookBtn.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { isnoticefresh = false; // TODO Auto-generated method stub Intent intent = new Intent(context, NoticeJcActivity.class); context.startActivity(intent); } }); } else if (iGameType.equals("jcl")) { holder.rLayout.setVisibility(RelativeLayout.GONE); holder.lookBtn.setVisibility(Button.VISIBLE); holder.lookBtn.setBackgroundResource(R.drawable.join_info_btn_selecter); holder.lookBtn.setOnClickListener( new OnClickListener() { public void onClick(View v) { // TODO Auto-generated method stub isnoticefresh = false; Intent intent = new Intent(context, NoticeJclActivity.class); context.startActivity(intent); } }); } // convertView.setOnClickListener(new OnClickListener() { // // @Override // public void onClick(View v) { // // TODO Auto-generated method stub // NoticeActivityGroup.ISSUE = iIssue; // } // }); return convertView; }
/** List view preparation */ public View getView(int position, View convertView, ViewGroup parent) { final ViewHolder holder; final RowItem rowItem = (RowItem) getItem(position); convertView = null; if (convertView == null) { LayoutInflater mInflater = (LayoutInflater) context.getSystemService(Activity.LAYOUT_INFLATER_SERVICE); convertView = mInflater.inflate(R.layout.commodity_details_row, parent, false); holder = new ViewHolder(); holder.commodityName = (TextView) convertView.findViewById(R.id.commodityname); holder.varietyName = (TextView) convertView.findViewById(R.id.varietyname); holder.date = (TextView) convertView.findViewById(R.id.date); holder.price = (TextView) convertView.findViewById(R.id.price); holder.unit = (TextView) convertView.findViewById(R.id.unit); holder.id = (TextView) convertView.findViewById(R.id.id); holder.mainCategory = (TextView) convertView.findViewById(R.id.mainCategory); holder.unitTagVALue = (TextView) convertView.findViewById(R.id.unitTypeTagValue); holder.offer = (ImageView) convertView.findViewById(R.id.imageoffer); holder.priceHideOrShow = (ImageView) convertView.findViewById(R.id.imageHideShow); holder.commodityImage = (ImageView) convertView.findViewById(R.id.list_commodity_image); holder.discountPrice = (TextView) convertView.findViewById(R.id.discountPrice); holder.quantity = (TextView) convertView.findViewById(R.id.quantity); holder.discountInPercentage = (TextView) convertView.findViewById(R.id.discountInPercentage); typeface = Typeface.createFromAsset(context.getAssets(), "fonts/Sanchez-Regular_0.ttf"); holder.commodityName.setTypeface(typeface); holder.varietyName.setTypeface(typeface); holder.date.setTypeface(typeface); holder.price.setTypeface(typeface); holder.unit.setTypeface(typeface); holder.id.setTypeface(typeface); holder.discountPrice.setTypeface(typeface); holder.quantity.setTypeface(typeface); holder.discountInPercentage.setTypeface(typeface); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } /*try { if (Build.VERSION.SDK_INT >= 16) { userId.setBackground(customBg); password.setBackground(customBg); } else { userId.setBackgroundDrawable(customBg); password.setBackgroundDrawable(customBg); } } catch (Exception e) { Toast.makeText(getActivity(), "Something wrong..", Toast.LENGTH_LONG).show(); }*/ if (rowItem.getStatusPrice() != null && rowItem.getStatusPrice().equalsIgnoreCase("Hide")) { /* holder.priceHideOrShow.setBackground(context.getResources() .getDrawable(R.drawable.hide2));*/ if (Build.VERSION.SDK_INT >= 16) { holder.priceHideOrShow.setBackground(context.getResources().getDrawable(R.drawable.hide2)); } else { holder.priceHideOrShow.setBackgroundDrawable( context.getResources().getDrawable(R.drawable.hide2)); } } else { /*holder.priceHideOrShow.setBackground(context.getResources() .getDrawable(R.drawable.show2));*/ if (Build.VERSION.SDK_INT >= 16) { holder.priceHideOrShow.setBackground(context.getResources().getDrawable(R.drawable.show2)); } else { holder.priceHideOrShow.setBackgroundDrawable( context.getResources().getDrawable(R.drawable.show2)); } } holder.unitTagVALue.setText(rowItem.getUnitTag()); holder.commodityName.setText(rowItem.getCommodityName()); holder.varietyName.setText(rowItem.getVarietyName()); holder.date.setText(rowItem.getDate()); holder.mainCategory.setText(rowItem.getMainCategory()); holder.price.setText(rupeeSymbol + rowItem.getPrice()); holder.unit.setText(rowItem.getUnit()); holder.id.setText(rowItem.getId()); holder.discountPrice.setText(rupeeSymbol + rowItem.getDiscountPrice()); holder.discountInPercentage.setText(rowItem.getDiscountInPercentage() + " %"); if (!rowItem.getDiscountInPercentage().equalsIgnoreCase("No discount")) { holder.price.setPaintFlags(holder.price.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); holder.offer.setVisibility(View.VISIBLE); holder.discountInPercentage.setVisibility(View.VISIBLE); holder.price.setVisibility(View.VISIBLE); } else { holder.price.setPaintFlags(0); holder.offer.setVisibility(View.GONE); holder.price.setVisibility(View.GONE); holder.discountInPercentage.setVisibility(View.GONE); } holder.commodityImage.setTag(rowItem.getImageURL()); BitmapManager.INSTANCE.loadBitmap(rowItem.getImageURL(), holder.commodityImage, 200, 200); holder.priceHideOrShow.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { try { if (rowItem.getStatusPrice().equalsIgnoreCase("Hide")) { listener.DoTaskCompleted( rowItem.getId().toString(), CommodityDetailsActivity.VENDOR_ID, "Show"); } else { listener.DoTaskCompleted( rowItem.getId().toString(), CommodityDetailsActivity.VENDOR_ID, "Hide"); } } catch (Exception e) { e.printStackTrace(); } } }); holder.commodityImage.setOnClickListener( new OnClickListener() { public void onClick(View v) { if (holder.commodityImage != null) { BitmapDrawable drawable = (BitmapDrawable) holder.commodityImage.getDrawable(); Bitmap bitmap = drawable.getBitmap(); maximizeImage(bitmap); } } }); return convertView; }
@Override public View getView(int i, final View v, ViewGroup viewGroup) { View view = v; try { final ViewHolder holder; if (i < 0 || i >= list.size()) { return null; } if (view == null) { LayoutInflater inflater = ((Activity) context).getLayoutInflater(); view = inflater.inflate(R.layout.sms_item, viewGroup, false); holder = new ViewHolder(); holder.contactName = (TextView) view.findViewById(R.id.sender); holder.date = (TextView) view.findViewById(R.id.date); view.setTag(holder); } else { holder = (ViewHolder) view.getTag(); } // get the current sms conversation Conversation currentConv = list.get(i); Set<ListableMessage> messageSet = currentConv.getSmsList(); List<ListableMessage> messageList = new ArrayList<>(); messageList.addAll(messageSet); Collections.sort(messageList); Button tryButton = (Button) view.findViewById(R.id.imageButton); // Link an sms to the playbutton int counter = messageList.size() - 1; while (messageList.get(counter).isSent() && counter >= 1) { counter--; } if (!messageList.get(counter).isRead()) { tryButton.setBackgroundResource(R.drawable.new_message_1); } else { tryButton.setBackgroundResource(R.drawable.old_message_1); } view.findViewById(R.id.imageButton).setTag(messageList.get(counter)); String address = currentConv.hasLocalNumber() ? currentConv.getAddress() : currentConv.getFixedNumber(); // set the correct data of the element holder.contactName.setText(getContactByNbr(address)); holder.contactName.setPaintFlags( holder.contactName.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG); holder.contactName.setTag(i); Object[] messages = list.get(i).getSmsList().toArray(); holder.date.setText( DateDiffUtility.callDateToString( ((ListableMessage) messages[messages.length - 1]).getTimestamp().getTimeInMillis(), context)); } catch (Exception e) { } return view; }
@Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder = null; if (convertView == null) { convertView = LayoutInflater.from(context).inflate(R.layout.flight_order_list_item, null); holder = new ViewHolder(); holder.date = (TextView) convertView.findViewById(R.id.date); holder.year = (TextView) convertView.findViewById(R.id.year); holder.time = (TextView) convertView.findViewById(R.id.time); holder.citys = (TextView) convertView.findViewById(R.id.citys); holder.flight = (TextView) convertView.findViewById(R.id.airline); holder.orderNumber = (TextView) convertView.findViewById(R.id.order_number); holder.airPort = (TextView) convertView.findViewById(R.id.airports); holder.flightClass = (TextView) convertView.findViewById(R.id.class_price); holder.passengerList = (LinearLayout) convertView.findViewById(R.id.passenger_list); holder.detailLayout = convertView.findViewById(R.id.detail_layout); holder.cancelBtn = convertView.findViewById(R.id.btn_cancel); holder.contactName = (TextView) convertView.findViewById(R.id.contact_name); holder.contactMobile = (TextView) convertView.findViewById(R.id.mobile); holder.payBtn = convertView.findViewById(R.id.btn_pay); holder.topLayout = convertView.findViewById(R.id.top_layout); holder.arrow = (ImageView) convertView.findViewById(R.id.arrow); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } FlightOrderModel model = getItem(position); long time = Long.parseLong( model.createTime.substring( model.createTime.indexOf("(") + 1, model.createTime.lastIndexOf(")"))); cal.setTimeInMillis(time); holder.date.setText(DateUtil.formatMMdd(cal)); holder.year.setText(cal.get(Calendar.YEAR) + "\n" + DateUtil.getWeekfromCalendar(cal)); holder.time.getPaint().setFakeBoldText(true); holder.time.setText(DateUtil.formatHHmm(cal)); OrderFlightModel fm = model.flights.get(0); holder.citys.setText(fm.dCityName + " - " + fm.aCityName); holder.flight.setText(fm.airLineName + " " + fm.flight); holder.arrow.setImageResource(R.drawable.arrow_down); holder.detailLayout.setVisibility(View.GONE); holder.topLayout.setTag(holder.detailLayout); holder.topLayout.setOnClickListener(listener); String status = ""; switch (model.status) { case 1: status = "创建待支付"; break; case 2: status = "出票中"; break; case 3: status = "已出票"; break; case 4: status = "驳回"; break; case 5: status = "已取消"; break; case 9: status = "已退票"; break; case 10: status = "部分退票"; break; } holder.orderNumber.setText("订单号:" + model.id + " 订单状态:" + status); holder.airPort.setText(fm.dPortName + " - " + fm.aPortName); String fc = ""; if (fm.flightClass.equalsIgnoreCase("Y")) { fc = "经济舱"; } else if (fm.flightClass.equalsIgnoreCase("F")) { fc = "头等舱"; } else { fc = "商务舱"; } String s = fc + " ¥" + model.amount; SpannableString ss = new SpannableString(s); int start = s.indexOf("¥"); ss.setSpan( new TextAppearanceSpan(context, R.style.text_10_orange), start, start + 1, Spannable.SPAN_INCLUSIVE_EXCLUSIVE); ss.setSpan( new TextAppearanceSpan(context, R.style.text_16_orange), start + 1, ss.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE); holder.flightClass.setText(ss); holder.contactName.setText(model.contactName); holder.contactMobile.setText(model.contactMobile); holder.passengerList.removeAllViews(); for (OrderPassengerModel passenger : model.passengers) { View view = LayoutInflater.from(context).inflate(R.layout.order_person_item, null); TextView name = (TextView) view.findViewById(R.id.name); TextView title = (TextView) view.findViewById(R.id.type_title); TextView number = (TextView) view.findViewById(R.id.card_number); name.setText(passenger.passengerName); title.setText(passenger.cardTypeName + ":"); number.setText(passenger.cardNumber); holder.passengerList.addView(view, LinearLayout.LayoutParams.MATCH_PARENT, itemHeight); } if (model.status >= 2) { holder.cancelBtn.setVisibility(View.GONE); } else { holder.cancelBtn.setVisibility(View.VISIBLE); } if (model.status == 1) { holder.payBtn.setVisibility(View.VISIBLE); } else { holder.payBtn.setVisibility(View.GONE); } holder.cancelBtn.setTag(model); holder.cancelBtn.setOnClickListener(cancelListener); holder.payBtn.setTag(model); holder.payBtn.setOnClickListener(payListener); return convertView; }
// 设置主列表布局中的详细内容 @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder = null; String iGameType = (String) mList.get(position).get(mIndex[0]); final String iNumbers = (String) mList.get(position).get(mIndex[1]); String iDate = (String) mList.get(position).get(mIndex[2]); final String iIssueNo = (String) mList.get(position).get(mIndex[3]); if (convertView == null) { convertView = mInflater.inflate(R.layout.notice_prizes_single_specific_layout, null); holder = new ViewHolder(); holder.numbers = (LinearLayout) convertView.findViewById(R.id.notice_pirzes_single_specific_ball_linearlayout); holder.date = (TextView) convertView.findViewById(R.id.notice_prizes_single_specific_noticedDate_id); holder.issue = (TextView) convertView.findViewById(R.id.notice_prizes_single_specific_issue_id); holder.imgView = (ImageView) convertView.findViewById(R.id.notice_prizes_single_specific_img); if (isImg) { holder.imgView.setVisibility(ImageView.VISIBLE); } else { holder.imgView.setVisibility(ImageView.GONE); } convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } PrizeBallLinearLayout linear = new PrizeBallLinearLayout(context); linear.Lotname = iGameType; linear.Batchcode = iNumbers; linear.linear = holder.numbers; linear.removeAllBalls(); linear.initLinear(); holder.date.setText(iDate); holder.issue.setText("第" + iIssueNo + "期"); convertView.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub if (isImg) { switch (lotType) { case LISTSSQ: SsqDetailView ssqDetailView = new SsqDetailView( context, Constants.LOTNO_SSQ, iIssueNo, progress, new Handler(), true); break; case LIST3D: FC3DetailView fc3DetailView = new FC3DetailView( context, Constants.LOTNO_FC3D, iIssueNo, progress, new Handler(), true); break; case LISTQLC: QLCDetailView qlcDetailView = new QLCDetailView( context, Constants.LOTNO_QLC, iIssueNo, progress, new Handler(), true); break; case LISTDLT: DLTDetailView dltDetailView = new DLTDetailView( context, Constants.LOTNO_DLT, iIssueNo, progress, new Handler(), true); break; case LISTPL3: PL3DetailView pl3DetailView = new PL3DetailView( context, Constants.LOTNO_PL3, iIssueNo, progress, new Handler(), true); break; case LISTPL5: PL5DetailView pl5DetailView = new PL5DetailView( context, Constants.LOTNO_PL5, iIssueNo, progress, new Handler(), true); break; case LISTQXC: QXCDetailView qxcDetailView = new QXCDetailView( context, Constants.LOTNO_QXC, iIssueNo, progress, new Handler(), true); break; case LISTTWENTY: TwentyDetailView twentview = new TwentyDetailView( context, Constants.LOTNO_22_5, iIssueNo, progress, new Handler(), true); } } } }); return convertView; }