コード例 #1
0
 @OnClick(R.id.item_suit_rush_buy_btn)
 public void itemClick(View view) {
   if (NetworkUtil.hasConnection(getActivity())) {
     Intent intent = new Intent(getActivity(), SuitDetailActivity.class);
     intent.putExtra("suitId", suitID);
     intent.putExtra("detailId", suit.getWeddingDressSuitId());
     intent.putExtra("url", suit.getImageUrl());
     animStart(intent);
   } else {
     handler.sendEmptyMessageDelayed(10, 100);
     handler.sendEmptyMessageDelayed(11, 4000);
   }
 }
コード例 #2
0
  @Override
  public void initialize() {

    /// 无网络提示///
    View view =
        LayoutInflater.from(getActivity()).inflate(R.layout.dialog_not_network_layout, null);
    ViewHolder holder = new ViewHolder(view);
    networkDialog =
        new MTDialog.Builder(getActivity())
            .setContentHolder(holder)
            .setCancelable(false)
            .setGravity(MTDialog.Gravity.BOTTOM)
            .setOnClickListener(SuitFlipFragment.this)
            .create();

    suit = (WeddingSuit) getArguments().getSerializable("suit");
    suitID = (String) getArguments().getSerializable("suitId");
    moneyTxt.setText("¥ " + suit.getPrice());
    orderTxt.setText("定金 ¥" + suit.getDepositRate());
    suitNameTxt.setText(suit.getProductName());

    String str = "";
    if (suit.getIsOptionalStylist() == 1) {
      str = "可自选造型师";
    }

    if (suit.getIsOptionalCameraman() == 1) {
      if (TextUtils.isEmpty(str)) {
        str = "可自选摄影师";
      } else {
        str += "/摄影师";
      }
    }
    if (TextUtils.isEmpty(str)) {
      photographerStylistTxt.setText("(不可自选摄影师/造型师)");
    } else {
      photographerStylistTxt.setText("(" + str + ")");
    }
    if (!TextUtils.isEmpty(suit.getImageUrl()))
      Picasso.with(getActivity())
          .load(
              suit.getImageUrl()
                  + "@"
                  + DimenUtil.screenWidth
                  + "w_"
                  + (DimenUtil.screenWidth * 2)
                  + "h_60Q")
          .into(contentImg);
  }