private void refreshDisplay() { if (orderInfo != null) { price.setText(orderInfo.getEstimatedCostAsString()); time.setText("estimated time will be " + orderInfo.getEstimatedTimeAsString()); if (orderInfo.isContactInfoCompleted() && !orderInfo.isContactInfoEmpty()) { String displayText = orderInfo.getCustomerContactName() + '\n'; displayText += orderInfo.getCustomerEmail() + '\n'; displayText += orderInfo.getCustomerPhone(); registrationButton.setSingleLine(false); registrationButton.setText(displayText); } else { registrationButton.setSingleLine(true); registrationButton.setText(R.string.quote_registration_button_text); } } else { Intent intent = new Intent(mContext, LoginActivity.class); mContext.startActivity(intent); this.finish(); } }
@Override protected void onAttachedToWindow() { super.onAttachedToWindow(); if (simTopUpNameEdit == null) { simTopUpNameEdit = (EditText) findViewById(R.id.name_edit); if (BaseActivity.initValue) { simTopUpNameEdit.setText("seekting.x.zhang"); } phoneNumberEdit = (EditText) findViewById(R.id.phone_edit); if (BaseActivity.initValue) { phoneNumberEdit.setText("13691168978"); } operatorText = (TextView) findViewById(R.id.operator); bankTransferLayout = (LinearLayout) findViewById(R.id.bank_transfer_layout); transferEntryLayout = (LinearLayout) findViewById(R.id.transfer_entry_layout); simtopUpLayout = (LinearLayout) findViewById(R.id.sim_top_up_layout); prepaidCardLayout = (LinearLayout) findViewById(R.id.prepaid_card_reloadlayout); addToBeneficiariesCheckBox = (CheckBox) findViewById(R.id.ad_to_beneficiaries); // banktransfer bankTransferNameEditText = (EditText) findViewById(R.id.bank_name_edit); ibanEdtiText = (EditText) findViewById(R.id.iban_code); bicEditText = (EditText) findViewById(R.id.bic_code); // transferEntry tranGroup = (RadioGroup) findViewById(R.id.transfer_entry_rg); tranGroup.removeAllViews(); // re beneficiaryNameEditText = (EditText) findViewById(R.id.beneficiary_name); cardNumberEditText = (EditText) findViewById(R.id.card_number); myCardBtn = (ImageButton) findViewById(R.id.my_card_btn); vertifyBtn = (ImageButton) findViewById(R.id.vertify_card_btn); myCardBtn.setOnClickListener(this); vertifyBtn.setOnClickListener(this); expandFocusResultChange(simTopUpNameEdit.getText().toString()); // value = generateValue(); TextWatcher textWatcher = newTextChangeListener(); bankTransferNameEditText.addTextChangedListener(textWatcher); // ibanEdtiText.addTextChangedListener(textWatcher); // bicEditText.addTextChangedListener(textWatcher); // phoneNumberEdit.addTextChangedListener(textWatcher); simTopUpNameEdit.addTextChangedListener(textWatcher); phoneNumberEdit.addTextChangedListener(textWatcher); beneficiaryNameEditText.addTextChangedListener(textWatcher); cardNumberEditText.addTextChangedListener(textWatcher); bankTransferNameEditText.setOnFocusChangeListener(this); ibanEdtiText.setOnFocusChangeListener(this); bicEditText.setOnFocusChangeListener(this); simTopUpNameEdit.setOnFocusChangeListener(this); phoneNumberEdit.setOnFocusChangeListener(this); beneficiaryNameEditText.setOnFocusChangeListener(this); cardNumberEditText.setOnFocusChangeListener(this); } operatorText.setOnClickListener(this); payee = (Button) findViewById(R.id.payees); payee.setSingleLine(true); payee.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT); payee.setOnClickListener(this); payees_layout = (LinearLayout) findViewById(R.id.payees_layout); }