Ejemplo n.º 1
0
  //	private void initIsSharetosinaweiboBtn(){
  //	  String token = shellRW.getStringValue("token");
  //	  if(token.equals("")){
  //		  is_sharetosinaweibo.setBackgroundResource(R.drawable.off);
  //	  }else{
  //		  is_sharetosinaweibo.setBackgroundResource(R.drawable.on);
  //	  }
  //	}
  private void cancleAutoLogin() {
    pBar = UserCenterDialog.onCreateDialog(this, "取消中……");
    pBar.show();
    handler.post(
        new Runnable() {

          @Override
          public void run() {
            String userno = shellRW.getStringValue("userno");
            // TODO Auto-generated method stub
            String cancleBack = CancleAutoLoginInterface.cancelAutoLogin(userno);
            try {
              JSONObject netBack = new JSONObject(cancleBack);
              String errorCode = netBack.getString("error_code");
              String massage = netBack.getString("message");
              if (errorCode.equals("0000")) {
                auto_login_set.setBackgroundResource(R.drawable.off);
                shellRW.putBooleanValue(ShellRWConstants.AUTO_LOGIN, false);
                pBar.dismiss();
              } else {
                auto_login_set.setBackgroundResource(R.drawable.on);
                shellRW.putBooleanValue(ShellRWConstants.AUTO_LOGIN, true);
                pBar.dismiss();
              }
              Toast.makeText(MoreActivity.this, massage, Toast.LENGTH_SHORT).show();
            } catch (JSONException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
            } catch (RuntimeException e) {
              // TODO: handle exception
              e.printStackTrace();
            }
          }
        });
  }
Ejemplo n.º 2
0
  /** 联网查询 */
  private void netting(final String orderBy, final String orderDi) {
    String str = "00";
    str =
        QueryJoinInfoInterface.queryLotJoinInfo(
            lotno,
            issue,
            orderBy,
            orderDir,
            "" + viewInfos[topIndex][lottypeIndex].newPage,
            JoinHallActivity.PAGENUM);
    handlerTwo.post(
        new Runnable() {
          @Override
          public void run() {
            progressbar.setVisibility(view.INVISIBLE);
            view.setEnabled(true);
          }
        });
    try {
      json = new JSONObject(str);
      String msg = json.getString("message");
      String error = json.getString("error_code");
      if (error.equals("0047") || error.equals("0407")) {
        handler.post(
            new Runnable() {

              @Override
              public void run() {
                // TODO Auto-generated method stub
                initList();
              }
            });
      }
      handler.handleMsg(error, msg);
    } catch (JSONException e) {
      e.printStackTrace();
    }
    if (viewInfos[topIndex][lottypeIndex].newPage == 0) {
      progressdialog.dismiss();
    }
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.alert_dialog_beijing_touzhu);

    reduceMutipleButton = (ImageButton) findViewById(R.id.buy_zixuan_img_subtract_beishu);
    reduceMutipleButton.setOnClickListener(new BeiJingSingleGameIndentOnClickListener());
    addMutipleButton = (ImageButton) findViewById(R.id.buy_zixuan_img_add_beishu);
    addMutipleButton.setOnClickListener(new BeiJingSingleGameIndentOnClickListener());
    mutipleSeekBar = (SeekBar) findViewById(R.id.buy_jc_zixuan_seek_beishu);
    mutipleSeekBar.setOnSeekBarChangeListener(new BeiJingSingleGameIndentOnSeekBarChangeListener());
    mutipleSeekBar.setProgress(1);
    mutipleEditText = (EditText) findViewById(R.id.buy_zixuan_text_beishu);
    /** add by pengcx 20130722 start */
    mutipleEditText.addTextChangedListener(
        new TextWatcher() {

          @Override
          public void afterTextChanged(Editable s) {
            if (s.length() > 1 && s.charAt(0) == '0') {
              Integer integer = Integer.valueOf(s.toString());
              mutipleEditText.setText(integer.toString());
            }
          }

          @Override
          public void beforeTextChanged(CharSequence s, int start, int count, int after) {
            // TODO Auto-generated method stub

          }

          @Override
          public void onTextChanged(CharSequence s, int start, int before, int count) {
            // TODO Auto-generated method stub

          }
        });
    /** add by pengcx 20130722 end */
    mutipleEditText.setText(String.valueOf(mutipleSeekBar.getProgress()));
    mutipleEditText.addTextChangedListener(
        new TextWatcher() {

          @Override
          public void onTextChanged(CharSequence s, int start, int before, int count) {}

          @Override
          public void beforeTextChanged(CharSequence s, int start, int count, int after) {}

          @Override
          public void afterTextChanged(Editable s) {
            String mutipleString = mutipleEditText.getText().toString();

            if (!mutipleString.equals("")) {
              mutipleSeekBar.setProgress(Integer.valueOf(mutipleString));
            }

            if (mutipleString.length() > 5) {
              mutipleEditText.setText("10000");
              ((EditText) mutipleEditText).setSelection(5);
            }

            setBettingInformationShow();
          }
        });

    freedomButton = (Button) findViewById(R.id.jc_alert_btn_ziyou);
    freedomButton.setBackgroundResource(R.drawable.jc_alert_right_radio_b);
    freedomButton.setOnClickListener(new BeiJingSingleGameIndentOnClickListener());
    bunchButton = (Button) findViewById(R.id.jc_alert_btn_duochuan);
    bunchButton.setBackgroundResource(R.drawable.jc_alert_left_radio);
    bunchButton.setOnClickListener(new BeiJingSingleGameIndentOnClickListener());
    bunchStyleLinearLayout = (LinearLayout) findViewById(R.id.alert_dialog_jc_layout_group);

    cooperationBuyButton = (Button) findViewById(R.id.alert_dialog_touzhu_button_cancel);
    cooperationBuyButton.setOnClickListener(new BeiJingSingleGameIndentOnClickListener());
    confirmBuyButton = (Button) findViewById(R.id.alert_dialog_touzhu_button_ok);
    confirmBuyButton.setOnClickListener(new BeiJingSingleGameIndentOnClickListener());

    selectedNum = getIntent().getIntExtra("selectedgamenum", 0);
    againstedString = getIntent().getStringExtra("selectedagainst");
    bettingInfoList = getIntent().getStringArrayListExtra("selectedeventclicknum");
    laterpartbettingcode = getIntent().getStringExtra("laterpartbettingcode");
    nowIssueString = getIntent().getStringExtra("nowIssueString");
    lotnoString = getIntent().getStringExtra("lotno");
    getIntent().getClass();

    radioGroupView = new RadioGroupView(this);
    bunchStyleLinearLayout.removeAllViews();
    addSelectDuoButtons();

    /** add by pengcx 20130703 start */
    lotoTypeTextView = (TextView) findViewById(R.id.alert_dialog_jc_lotnotype);
    gameNumTextView = (TextView) findViewById(R.id.alert_dialog_jc_gamenum);
    betNumTextView = (TextView) findViewById(R.id.alert_dialog_jc_betnum);
    moneyTextView = (TextView) findViewById(R.id.alert_dialog_jc_money);
    predictMoneyTextView = (TextView) findViewById(R.id.alert_dialog_jc_predictmoney);
    schemeTextView = (TextView) findViewById(R.id.alert_dialog_touzhu_alert_scheme);
    schemeTextView.setText(againstedString);
    schemeDetailTextView =
        (TextView) findViewById(R.id.alert_dialog_touzhu_alert_textview_schemedetail);
    upDownImageView = (ImageView) findViewById(R.id.alert_dialog_touzhu_updown);
    schemeRelativeLayout =
        (RelativeLayout) findViewById(R.id.alert_dialog_touzhu_linear_qihao_beishu);
    schemeDetailLinearLayout =
        (LinearLayout) findViewById(R.id.alert_dialog_touzhu_alert_schemedetail);
    schemeDetailTextView.setText(againstedString);
    schemeRelativeLayout.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            if (bettingInfoList.size() > 1) {
              int visibility = schemeDetailLinearLayout.getVisibility();
              if (visibility == View.VISIBLE) {
                schemeDetailLinearLayout.setVisibility(View.GONE);
                schemeTextView.setText(againstedString);
                upDownImageView.setImageResource(R.drawable.down_icon);
              } else {
                schemeDetailLinearLayout.setVisibility(View.VISIBLE);
                upDownImageView.setImageResource(R.drawable.up_icon);
                schemeTextView.setText("");
              }
            }
          }
        });
    lotoTypeTextView.setText(PublicMethod.toLotno(lotnoString));
    /** add by pengcx 20130703 end */
    setBettingInformationShow();

    handler.setBetAndGift(betAndGift);
  }