@Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub index = position; final JcInfo info = (JcInfo) mList.get(position); convertView = mInflater.inflate(R.layout.notice_jc_listview_item, null); final ViewHolder holder = new ViewHolder(); holder.time = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_time); holder.team = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_team); holder.home = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_team_name1); holder.away = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_team_name2); holder.letPoint = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_vs); holder.timeEnd = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_time_end); holder.teamId = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_id); holder.result = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_jieguo); holder.score = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_score); convertView.setTag(holder); holder.time.append(info.getTime()); holder.team.append(info.getTeam()); holder.home.append(info.getHome()); holder.away.append(info.getAway()); holder.letPoint.setText(info.getLetPoint()); holder.letPoint.setTextColor(Color.BLUE); holder.timeEnd.append(info.getTimeEnd()); holder.teamId.append(info.getWeek() + info.getTeamId()); holder.result.append(info.getResult()); holder.score.append(info.getScore()); return convertView; }
@Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub View vi = convertView; ViewHolder holder; if (convertView == null) { /** **** Inflate tabitem.xml file for each row ( Defined below ) ****** */ vi = inflater.inflate(R.layout.list_row, parent, false); /** **** View Holder Object to contain tabitem.xml file elements ***** */ // Log.i(Constant.TAG, _name.get(position) + String.valueOf(_name.get(position))); holder = new ViewHolder(); holder.name = (TextView) vi.findViewById(R.id.txt_highscore_name); holder.name.setText(_name.get(position)); holder.score = (TextView) vi.findViewById(R.id.txt_highscore_score); holder.score.setText(String.valueOf(_score.get(position))); // /** ********** Set holder with LayoutInflater *********** */ vi.setTag(holder); } else holder = (ViewHolder) vi.getTag(); /** ********** Set Model values in Holder elements ********** */ return vi; }
@Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub ViewHolder holder = null; if (convertView == null) { convertView = LayoutInflater.from(c).inflate(R.layout.item_layout_gallery, null); holder = new ViewHolder(); holder.firstTitle = (TextView) convertView.findViewById(R.id.first_title); holder.secondTitle = (TextView) convertView.findViewById(R.id.second_title); holder.content = (TextView) convertView.findViewById(R.id.content); holder.score = (TextView) convertView.findViewById(R.id.score); holder.image = (ImageView) convertView.findViewById(R.id.image); holder.definition = (ImageView) convertView.findViewById(R.id.definition); holder.layout = (LinearLayout) convertView.findViewById(R.id.bottom_frame); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } holder.firstTitle.setVisibility(View.GONE); holder.layout.setVisibility(View.GONE); holder.definition.setVisibility(View.GONE); holder.image.setImageResource(data[position]); convertView.setPadding( UtilTools.getStandardValue(c, 15), UtilTools.getStandardValue(c, 10), UtilTools.getStandardValue(c, 15), UtilTools.getStandardValue(c, 10)); convertView.setLayoutParams(layoutParam); return convertView; }
@Override public View getView(int position, View convertView, ViewGroup parent) { index = position; final JsonBeanInfo info = (JsonBeanInfo) mList.get(position); convertView = mInflater.inflate(R.layout.notice_beijing_single_listview_item, null); final ViewHolder holder = new ViewHolder(); holder.teamId = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_team_id); holder.team = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_team); holder.home = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_team_name1); holder.away = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_team_name2); holder.letPoint = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_vs); holder.result = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_jieguo); holder.score = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_score); holder.sp = (TextView) convertView.findViewById(R.id.notice_beijing_single_item_odds); convertView.setTag(holder); holder.sp.setVisibility(View.GONE); holder.team.append(info.getTeam()); holder.teamId.append(info.getTeamId()); holder.result.append(info.getResult()); String score = info.getGuestScore() + ":" + info.getHomeScore(); holder.score.append(score); holder.home.append(info.getAway() + "(客)"); holder.away.append(info.getHome() + "(主)"); if (Constants.LOTNO_JCLQ_RF.equals(playMethodType)) { if (!"".equals(info.getLetPoint())) { holder.letPoint.setText(info.getLetPoint()); holder.letPoint.setTextColor(Color.BLUE); } } else if (Constants.LOTNO_JCLQ_DXF.equals(playMethodType)) { if (!"".equals(info.getBasePoint())) { holder.letPoint.setText(info.getBasePoint()); holder.letPoint.setTextColor(Color.BLUE); } } convertView.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { trunExplain(getEvent(Constants.JCBASKET, info)); } }); return convertView; }
@Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub index = position; final JcInfo info = (JcInfo) mList.get(position); convertView = mInflater.inflate(R.layout.notice_jc_listview_item, null); final ViewHolder holder = new ViewHolder(); holder.time = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_time); holder.team = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_team); holder.home = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_team_name1); holder.away = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_team_name2); holder.letPoint = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_vs); holder.timeEnd = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_time_end); holder.teamId = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_id); holder.result = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_jieguo); holder.score = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_score); convertView.setTag(holder); holder.time.append(info.getTime()); holder.team.append(info.getTeam()); holder.home.append(info.getAway()); holder.away.append(info.getHome()); holder.letPoint.setText(info.getLetPoint()); holder.letPoint.setTextColor(Color.BLUE); holder.timeEnd.append(info.getTimeEnd()); holder.teamId.append(info.getWeek() + info.getTeamId()); holder.result.append("主" + info.getResult()); try { String scores[] = info.getScore().split("\\:"); holder.score.append(scores[1] + ":" + scores[0]); } catch (Exception e) { // TODO: handle exception } // convertView.setOnClickListener(new OnClickListener() { // // @Override // public void onClick(View v) { // // TODO Auto-generated method stub // trunExplain(getEvent(Constants.JCBASKET, info)); // } // }); return convertView; }