Example #1
0
  @Override
  public void refreshView() {
    bitmapUtils = new BitmapUtils(UIUtils.getContext());
    AppInfo data = getData();

    // 顶部的绿色的按钮
    for (int i = 0; i < 4; i++) {
      if (i < data.getSafeUrlList().size()) {
        imageView[i].setVisibility(View.VISIBLE);
        bitmapUtils.display(
            imageView[i], HttpHelper.URL + "image?name=" + data.getSafeUrlList().get(i));
      } else {
        imageView[i].setVisibility(View.GONE);
      }
    }

    for (int i = 0; i < 4; i++) {
      if (i < data.getSafeDesList().size()) {
        linearLayouts[i].setVisibility(View.VISIBLE);
        bitmapUtils.display(
            imageIcon[i], HttpHelper.URL + "image?name=" + data.getSafeDesUrlList().get(i));
        textViews[i].setText(data.getSafeDesList().get(i));
      } else {
        linearLayouts[i].setVisibility(View.GONE);
      }
    }
  }
Example #2
0
  @Override
  public View initView() {
    View view = UIUtils.inflate(R.layout.layout_detail_appsafe);

    root_ll = (LinearLayout) view.findViewById(R.id.root_ll);

    ll_footer = (LinearLayout) view.findViewById(R.id.ll_footer);

    layoutParams = ll_footer.getLayoutParams();
    layoutParams.height = 0;
    ll_footer.setLayoutParams(layoutParams);

    arrow = (ImageView) view.findViewById(R.id.arrow);

    imageView = new ImageView[4];
    imageView[0] = (ImageView) view.findViewById(R.id.safeimage1);
    imageView[1] = (ImageView) view.findViewById(R.id.safeimage2);
    imageView[2] = (ImageView) view.findViewById(R.id.safeimage3);
    imageView[3] = (ImageView) view.findViewById(R.id.safeimage4);

    linearLayouts = new LinearLayout[4];
    linearLayouts[0] = (LinearLayout) view.findViewById(R.id.ll1);
    linearLayouts[1] = (LinearLayout) view.findViewById(R.id.ll2);
    linearLayouts[2] = (LinearLayout) view.findViewById(R.id.ll3);
    linearLayouts[3] = (LinearLayout) view.findViewById(R.id.ll4);

    imageIcon = new ImageView[4];
    imageIcon[0] = (ImageView) view.findViewById(R.id.image1);
    imageIcon[1] = (ImageView) view.findViewById(R.id.image2);
    imageIcon[2] = (ImageView) view.findViewById(R.id.image3);
    imageIcon[3] = (ImageView) view.findViewById(R.id.image4);

    textViews = new TextView[4];
    textViews[0] = (TextView) view.findViewById(R.id.tv1);
    textViews[1] = (TextView) view.findViewById(R.id.tv2);
    textViews[2] = (TextView) view.findViewById(R.id.tv3);
    textViews[3] = (TextView) view.findViewById(R.id.tv4);

    root_ll.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            expend();
          }
        });

    return view;
  }