Esempio n. 1
0
 @Override
 public View getView(final int position, View convertView, ViewGroup parent) {
   // TODO Auto-generated method stub
   ExplainInfo info = mList.get(position);
   ViewHolder holder = null;
   if (convertView == null) {
     convertView = mInflater.inflate(R.layout.jc_score_list_item, null);
     holder = new ViewHolder();
     holder.companyName =
         (TextView) convertView.findViewById(R.id.jc_europe_list_item_text_company);
     holder.firstGoal =
         (TextView) convertView.findViewById(R.id.jc_europe_list_item_text_center_leve);
     holder.firstUpodds =
         (TextView) convertView.findViewById(R.id.jc_europe_list_item_text_center_win);
     holder.firstDownodds =
         (TextView) convertView.findViewById(R.id.jc_europe_list_item_text_center_fail);
     holder.upOdds =
         (TextView) convertView.findViewById(R.id.jc_europe_list_item_text_right_win);
     holder.goal = (TextView) convertView.findViewById(R.id.jc_europe_list_item_text_right_leve);
     holder.downOdds =
         (TextView) convertView.findViewById(R.id.jc_europe_list_item_text_right_fail);
     convertView.setTag(holder);
   } else {
     holder = (ViewHolder) convertView.getTag();
   }
   holder.companyName.setText(info.getCompanyName());
   holder.firstUpodds.setText(info.getFirstUpodds());
   holder.firstDownodds.setText(info.getFirstDownodds());
   holder.firstGoal.setText(info.getFirstGoal());
   holder.upOdds.setText(info.getUpOdds());
   holder.downOdds.setText(info.getDownOdds());
   holder.goal.setText(info.getGoal());
   return convertView;
 }
Esempio n. 2
0
 protected List getScoreInfo(JSONArray jsonArray) {
   listInfo = new ArrayList<ExplainInfo>();
   for (int i = 0; i < jsonArray.length(); i++) {
     ExplainInfo info = new ExplainInfo();
     try {
       JSONObject json = jsonArray.getJSONObject(i);
       info.setCompanyName(json.getString("companyName"));
       info.setFirstDownodds(json.getString("firstDownodds"));
       info.setFirstGoal(json.getString("firstGoal"));
       info.setFirstUpodds(json.getString("firstUpodds"));
       info.setGoal(json.getString("goal"));
       info.setUpOdds(json.getString("upOdds"));
       info.setDownOdds(json.getString("downOdds"));
     } catch (JSONException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
     }
     listInfo.add(info);
   }
   return listInfo;
 }