private void handleJsonList(ViewHolder holder, int position) { ThreadPageInfo entry = getEntry(position); // this.topicListInfo.getArticleEntryList().get(position); if (entry == null) { return; } Resources res = inflater.getContext().getResources(); ThemeManager theme = ThemeManager.getInstance(); boolean night = false; int nightLinkColor = res.getColor(R.color.night_link_color); if (theme.getMode() == ThemeManager.MODE_NIGHT) night = true; holder.author.setText(entry.getAuthor()); if (night) holder.author.setTextColor(nightLinkColor); String lastPoster = entry.getLastposter_org(); if (StringUtil.isEmpty(lastPoster)) lastPoster = entry.getLastposter(); holder.lastReply.setText(lastPoster); holder.num.setText("" + entry.getReplies()); if (night) { holder.lastReply.setTextColor(nightLinkColor); holder.num.setTextColor(nightLinkColor); } holder.title.setTextColor(res.getColor(theme.getForegroundColor())); float size = PhoneConfiguration.getInstance().getTextSize(); String titile = entry.getContent(); if (StringUtil.isEmpty(titile)) { titile = entry.getSubject(); holder.title.setText(StringUtil.unEscapeHtml(titile)); } else { holder.title.setText(StringUtil.removeBrTag(StringUtil.unEscapeHtml(titile))); } holder.title.setTextSize(size); final TextPaint tp = holder.title.getPaint(); tp.setFakeBoldText(false); if (!StringUtil.isEmpty(entry.getTitlefont())) { final String font = entry.getTitlefont(); if (font.equals("~1~~") || font.equals("~~~1")) { tp.setFakeBoldText(true); } else if (font.startsWith("green")) { holder.title.setTextColor(res.getColor(R.color.title_green)); } else if (font.startsWith("blue")) { holder.title.setTextColor(res.getColor(R.color.title_blue)); } else if (font.startsWith("red")) { holder.title.setTextColor(res.getColor(R.color.title_red)); } else if (font.startsWith("orange")) { holder.title.setTextColor(res.getColor(R.color.title_orange)); } } }
public Object getItem(int arg0) { ThreadPageInfo entry = getEntry(arg0); if (entry == null || entry.getTid() == 0) { return null; } String ret = "tid=" + entry.getTid(); if (entry.getPid() != 0) { return ret + "&pid=" + entry.getPid(); } return ret; }