Exemplo n.º 1
0
  @Override
  public void initView() {
    tongbaoCount.setType(Type.All);
    tongbaoCount.setSummaryImg(R.drawable.tongbao_detail);
    Spanny count =
        new Spanny(
            "2",
            new ForegroundColorSpan(getResources().getColor(R.color.txt_red)),
            new AbsoluteSizeSpan(DensityUtils.sp2px(this, 24)));
    tongbaoCount.setSummaryText(count);
    tongbaoCount.setDetailText("查看铜板详情");
    tongbaoCount.setDetailImg(R.mipmap.icon_triangle_arrow);

    tongbaoTeleCharge.setType(Type.SummaryImgSummaryTxt_DetailImg);
    tongbaoTeleCharge.setSummaryImg(R.drawable.tongbao_tele_charge);
    Spanny charge =
        new Spanny(
                "兑换话费\n",
                new ForegroundColorSpan(getResources().getColor(R.color.txt_red)),
                new AbsoluteSizeSpan(DensityUtils.sp2px(this, 16)))
            .append(
                "2000铜板起兑",
                new ForegroundColorSpan(getResources().getColor(R.color.txt_gray)),
                new AbsoluteSizeSpan(DensityUtils.sp2px(this, 12)));
    tongbaoTeleCharge.setSummaryText(charge);
    tongbaoTeleCharge.setDetailImg(R.mipmap.icon_triangle_arrow);

    tongbaoJifen.setType(Type.SummaryImgSummaryTxt_DetailImg);
    tongbaoJifen.setSummaryImg(R.drawable.tongbao_jifen);
    Spanny jifen =
        new Spanny(
                "兑换集分宝\n",
                new ForegroundColorSpan(getResources().getColor(R.color.txt_red)),
                new AbsoluteSizeSpan(DensityUtils.sp2px(this, 16)))
            .append(
                "1铜板起兑",
                new ForegroundColorSpan(getResources().getColor(R.color.txt_gray)),
                new AbsoluteSizeSpan(DensityUtils.sp2px(this, 12)));
    tongbaoJifen.setSummaryText(jifen);
    tongbaoJifen.setDetailImg(R.mipmap.icon_triangle_arrow);

    tongbaoStore.setType(Type.SummaryImgSummaryTxt_DetailImg);
    tongbaoStore.setSummaryImg(R.drawable.tongbao_store);
    Spanny store =
        new Spanny(
                "铜板商城\n",
                new ForegroundColorSpan(getResources().getColor(R.color.txt_red)),
                new AbsoluteSizeSpan(DensityUtils.sp2px(this, 16)))
            .append(
                "试运行",
                new ForegroundColorSpan(getResources().getColor(R.color.txt_gray)),
                new AbsoluteSizeSpan(DensityUtils.sp2px(this, 12)));
    tongbaoStore.setSummaryText(store);
    tongbaoStore.setDetailImg(R.mipmap.icon_triangle_arrow);
  }
Exemplo n.º 2
0
 private void setCommonItem(CommonItem commonItem, String summaryTxt, String detailTxt) {
   commonItem.setType(Type.SummaryTxt_DetailTxtDetailImg);
   commonItem.setSummaryText(summaryTxt);
   commonItem.setDetailText(detailTxt);
   commonItem.setDetailImg(R.mipmap.icon_triangle_arrow);
 }