Ejemplo n.º 1
0
 /** 再次启动提示框 */
 public void initAlerDialog() {
   touzhuCheck.setChecked(true);
   clearProgress();
   stateCheck();
   issueText.setText(PublicMethod.toIssue(betAndGift.getLotno()) + "期");
   textTitle.setText("注码:" + "共有" + addView.getSize() + "笔投注");
   addView.getCodeList().get(addView.getSize() - 1).setTextCodeColor(textZhuma);
   isCodeText(codeInfo);
   alertText.setText(getTouzhuAlertJixuan());
   touZhuDialog.show();
 }
Ejemplo n.º 2
0
  public void init() {
    beishulayLayout = (LinearLayout) findViewById(R.id.beishulayout);
    if (betAndGift.isZhui()) {
      initZhuiJia();
    }
    zhushu = (TextView) findViewById(R.id.alert_dialog_touzhu_textview_zhushu);
    jine = (TextView) findViewById(R.id.alert_dialog_touzhu_textview_jine);
    caizhong = (TextView) findViewById(R.id.alert_dialog_touzhu_textview_caizhong);
    caizhong.setText(PublicMethod.toLotno(betAndGift.getLotno()));
    issueText = (TextView) findViewById(R.id.alert_dialog_touzhu_textview_qihao);
    textZhuma = (TextView) findViewById(R.id.alert_dialog_touzhu_text_zhuma);
    textTitle = (TextView) findViewById(R.id.alert_dialog_touzhu_text_zhuma_title);
    if (Constants.type.equals("hight") || Constants.type.equals("zc")) {
      issueText.setText("第" + betAndGift.getBatchcode() + "期");
    } else {
      getNetIssue();
    }
    getTouzhuAlert();
    if (Constants.type.equals("zc")) {
      textTitle.setText("注码:共有1笔投注");
      textZhuma.setText(betAndGift.getBet_code());
      initImageView();
      //			beishulayLayout.setVisibility(View.GONE);
      codeInfo = (Button) findViewById(R.id.alert_dialog_touzhu_btn_look_code);
      codeInfo.setVisibility(View.GONE);
    } else {
      beishulayLayout.setVisibility(View.VISIBLE);
      initImageView();
      CodeInfo code = addview.getCodeList().get(addview.getSize() - 1);
      code.setTextCodeColor(textZhuma, code.getLotoNo(), code.getTouZhuType());
      textTitle.setText("注码:" + "共有" + addview.getSize() + "笔投注");
      codeInfo = (Button) findViewById(R.id.alert_dialog_touzhu_btn_look_code);
      isCodeText(codeInfo);
      codeInfo.setOnClickListener(
          new OnClickListener() {
            @Override
            public void onClick(View v) {
              // TODO Auto-generated method stub
              addview.createCodeInfoDialog(context);
              addview.showDialog();
            }
          });
    }
    Button cancel = (Button) findViewById(R.id.alert_dialog_touzhu_button_cancel);
    Button ok = (Button) findViewById(R.id.alert_dialog_touzhu_button_ok);
    cancel.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            // TODO Auto-generated method stub
            alertExit(getString(R.string.buy_alert_exit_detail));
          }
        });
    ok.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            RWSharedPreferences pre = new RWSharedPreferences(JoinStartActivity.this, "addInfo");
            sessionId = pre.getStringValue("sessionid");
            phonenum = pre.getStringValue("phonenum");
            userno = pre.getStringValue("userno");
            if (userno.equals("")) {
              toLogin = true;
              Intent intentSession = new Intent(JoinStartActivity.this, UserLogin.class);
              startActivityForResult(intentSession, 0);
            } else {
              isJoin();
            }
          }
        });
    titleText = (TextView) findViewById(R.id.layout_join_text_title);
    renText = (TextView) findViewById(R.id.layout_join_text_rengou);
    baoText = (TextView) findViewById(R.id.layout_join_text_baodi);
    buyEdit = (EditText) findViewById(R.id.layout_join_edit_rengou);
    minEdit = (EditText) findViewById(R.id.layout_join_edit_gendan);
    safeEdit = (EditText) findViewById(R.id.layout_join_edit_baodi);
    descriptionEdit = (EditText) findViewById(R.id.layout_join_edit_description);
    buyEdit.setText("1");
    safeEdit.setText("1");
    minEdit.setText("1");
    deductSpinner = (Spinner) findViewById(R.id.layout_join_start_spinner);
    deductSpinner.setSelection(9);
    // 初始化spinner
    deductSpinner.setOnItemSelectedListener(
        new OnItemSelectedListener() {
          @Override
          public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
            commisionRation = (String) deductSpinner.getSelectedItem();
          }

          @Override
          public void onNothingSelected(AdapterView<?> arg0) {}
        });
    // 赋值
    renText.setText(
        "占总额" + progress(isNull(buyEdit.getText().toString()), "" + allAtm) + "%"); // 总金额
    baoText.setText(
        "占总额" + progress(isNull(safeEdit.getText().toString()), "" + allAtm) + "%"); // 总金额
    onEditTextClik();
  }
Ejemplo n.º 3
0
  /** 第一次启动投注提示框 */
  public void initTouZhuDialog() {
    LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
    View v = inflater.inflate(R.layout.alert_dialog_touzhu_new, null);
    touZhuDialog = new AlertDialog.Builder(this).setTitle("您选择的是").create();
    touZhuDialog.show();
    initImageView(v);
    if (betAndGift.isZhui()) {
      initZhuiJia(v);
    }
    issueText = (TextView) v.findViewById(R.id.alert_dialog_touzhu_textview_qihao);
    alertText = (TextView) v.findViewById(R.id.alert_dialog_touzhu_text_one);
    textZhuma = (TextView) v.findViewById(R.id.alert_dialog_touzhu_text_zhuma);
    addView.getCodeList().get(addView.getSize() - 1).setTextCodeColor(textZhuma);
    textTitle = (TextView) v.findViewById(R.id.alert_dialog_touzhu_text_zhuma_title);
    textTitle.setText("注码:" + "共有" + addView.getSize() + "笔投注");
    issueText.setText(PublicMethod.toIssue(betAndGift.getLotno()) + "期");
    alertText.setText(getTouzhuAlertJixuan());
    Button cancel = (Button) v.findViewById(R.id.alert_dialog_touzhu_button_cancel);
    Button ok = (Button) v.findViewById(R.id.alert_dialog_touzhu_button_ok);
    codeInfo = (Button) v.findViewById(R.id.alert_dialog_touzhu_btn_look_code);
    isCodeText(codeInfo);
    codeInfo.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            // TODO Auto-generated method stub
            addView.createCodeInfoDialog();
            addView.showDialog();
          }
        });
    cancel.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            // TODO Auto-generated method stub
            touZhuDialog.cancel();
            toLogin = false;
            clearProgress();
          }
        });
    ok.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            toLogin = false;
            initBet();
            touZhuDialog.cancel();
            // TODO Auto-generated method stub
            if (isGift) {
              String code = addView.getsharezhuma();
              toActivity(code);
            } else if (isJoin) {
              toJoinActivity();
            } else if (isTouzhu) {
              touZhuNet();
            }
            clearProgress();
          }
        });
    CheckBox checkPrize = (CheckBox) v.findViewById(R.id.alert_dialog_touzhu_check_prize);
    checkPrize.setChecked(true);
    checkPrize.setButtonDrawable(R.drawable.check_on_off);
    checkPrize.setOnCheckedChangeListener(
        new OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            // TODO Auto-generated method stub
            if (isChecked) {
              betAndGift.setPrizeend("1");
            } else {
              betAndGift.setPrizeend("0");
            }
          }
        });
    check = (RadioButton) v.findViewById(R.id.alert_dialog_touzhu_check);
    joinCheck = (RadioButton) v.findViewById(R.id.alert_dialog_join_check);
    touzhuCheck = (RadioButton) v.findViewById(R.id.alert_dialog_touzhu1_check);
    touzhuCheck.setChecked(true);
    textAlert = (TextView) v.findViewById(R.id.alert_dialog_touzhu_text_alert);
    check.setPadding(50, 0, 0, 0);
    check.setButtonDrawable(R.drawable.check_select);
    // 实现记住密码 和 复选框的状态
    check.setOnCheckedChangeListener(
        new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            isGift = isChecked;
          }
        });
    joinCheck.setPadding(50, 0, 0, 0);
    joinCheck.setButtonDrawable(R.drawable.check_select);
    // 实现记住密码 和 复选框的状态
    joinCheck.setOnCheckedChangeListener(
        new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            isJoin = isChecked;
          }
        });
    touzhuCheck.setPadding(50, 0, 0, 0);
    touzhuCheck.setButtonDrawable(R.drawable.check_select);
    // 实现记住密码 和 复选框的状态
    touzhuCheck.setOnCheckedChangeListener(
        new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            isTouzhu = isChecked;
          }
        });
    stateCheck();
    touZhuDialog.setCancelable(false);
    touZhuDialog.getWindow().setContentView(v);
  }