コード例 #1
0
 @Override
 public void refresh() {
   super.refresh();
   ProjectTable baseItem = (ProjectTable) getData();
   String img = baseItem.getData("img");
   String title = baseItem.getData("title");
   String total_money_support = baseItem.getData("supported");
   String total_date = baseItem.getData("total_date");
   String percent = baseItem.getData("percent");
   ImageLoaderUtils.getInstance(getContext())
       .DisplayImage(img, (ImageView) findViewById(R.id.v3home_sesion2_item_img), null);
   setText(title, R.id.v3home_sesion2_item_img_txt);
 }
コード例 #2
0
  @Override
  public void refresh() {
    super.refresh();

    try {
      if ((ProjectManagerFragment.typeProject).equalsIgnoreCase("2")) {
        setText(
            ((BaseItem) getData()).getString("supported"),
            R.id.homeitem_txtname_1); // total_money_support
        setText(((BaseItem) getData()).getString("percent"), R.id.homeitem_txtname_2);
        setText(((BaseItem) getData()).getString("total_date"), R.id.homeitem_txtname_3);
        ImageLoaderUtils.getInstance(context)
            .DisplayImage(
                ((BaseItem) getData()).getString("img"),
                (ImageView) findViewById(R.id.homeitem_img));
        if (((BaseItem) getData()).getString("title").equalsIgnoreCase("null")) {
          setText("", R.id.project_postlist_title);
        } else {
          setText(((BaseItem) getData()).getString("title"), R.id.project_postlist_title);
        }
        setText(((BaseItem) getData()).getString("status"), R.id.project_postlist_status);
        setText(
            getResources().getString(R.string.project_post_date_modified)
                + ((BaseItem) getData()).getString("modified"),
            R.id.project_postlist_time_modified);
        setText(
            getResources().getString(R.string.project_post_date_created)
                + ((BaseItem) getData()).getString("created"),
            R.id.project_postlist_time_created);
        if (((BaseItem) getData()).getString("desc").equalsIgnoreCase("null")) {
          setText("", R.id.project_postlist_desc);
        } else {
          String desc_value = ((BaseItem) getData()).getString("desc");
          //	   			String d= Html.fromHtml(abc);
          //	   			setText("",
          //		   				R.id.project_postlist_desc);
          TextView desc = (TextView) findViewById(R.id.project_postlist_desc);
          desc.setText(Html.fromHtml(desc_value));
        }
        if ((((BaseItem) getData()).getString("public_flg")).equalsIgnoreCase("1")) {
          ((TextView) findViewById(R.id.project_postlist_status)).setTextColor(Color.RED);
        } else {
          ((TextView) findViewById(R.id.project_postlist_status)).setTextColor(Color.BLACK);
        }

        String public_flg = ((BaseItem) getData()).getString("public_flg");
        String total_date = ((BaseItem) getData()).getString("total_date");
        this.findViewById(R.id.pm_button_video).setVisibility(View.GONE);
        this.findViewById(R.id.pm_button_preview).setVisibility(View.GONE);
        this.findViewById(R.id.pm_button_support).setVisibility(View.GONE);
        this.findViewById(R.id.pm_button_delivery).setVisibility(View.GONE);
        this.findViewById(R.id.pm_button_delete).setVisibility(View.GONE);
        if (public_flg.equalsIgnoreCase("1")) {
          this.findViewById(R.id.pm_button_support).setVisibility(View.VISIBLE);
          this.findViewById(R.id.pm_button_delivery).setVisibility(View.VISIBLE);
        } else {
          if (total_date.equalsIgnoreCase(
              getResources().getString(R.string.project_post_date_end))) {
            //						this.findViewById(R.id.pm_button_video).setVisibility(View.VISIBLE);
            this.findViewById(R.id.pm_button_preview).setVisibility(View.VISIBLE);
            this.findViewById(R.id.pm_button_delivery).setVisibility(View.VISIBLE);
            this.findViewById(R.id.pm_button_delete).setVisibility(View.VISIBLE);
          } else {
            //						this.findViewById(R.id.pm_button_video).setVisibility(View.VISIBLE);
            this.findViewById(R.id.pm_button_preview).setVisibility(View.VISIBLE);
            this.findViewById(R.id.pm_button_delivery).setVisibility(View.VISIBLE);
          }
        }
        header.startAnimation(fadeOut);
      } else {
        ImageLoaderUtils.getInstance(context)
            .DisplayImage(
                ((BaseItem) getData()).getString("img"),
                (ImageView) findViewById(R.id.homeitem_img));
        if (((BaseItem) getData()).getString("title").equalsIgnoreCase("null")) {
          setText("", R.id.homeitem_txtname);
        } else {
          setText(((BaseItem) getData()).getString("title"), R.id.homeitem_txtname);
        }
        //			setText(((BaseItem) getData()).getString("title"),
        //					R.id.homeitem_txtname);
        int post = Integer.parseInt(((BaseItem) getData()).getString("key_value"));
        if (post % 2 == 0) {
          header.startAnimation(fadeOut);
        } else {
          header.startAnimation(fadeOut2);
        }
      }

    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }