// 自动计算金额 @OnTextChanged( value = {R.id.product_number, R.id.product_price}, callback = OnTextChanged.Callback.TEXT_CHANGED) void onProductTextChanged(CharSequence text) { ToastUtils.toast("onTextChanged"); if (!text.toString().equals("")) { String number = productNumber.getText().toString(); String price = productPriceText.getText().toString(); String total = cacleTotal(number, price); if (total != null) { ToastUtils.toast(total); productTotal.setText(total); } } else { productTotal.setText(""); } }
/** 添加清单 */ @OnClick(R.id.product_add_btn) public void onAddAccountSale() { int radioButtonId = accountTypeRadioGroup.getCheckedRadioButtonId(); switch (radioButtonId) { case R.id.accountTypeRadioSale: currentRadioSelectValue = AccountTypeEnum.SALE; break; default: currentRadioSelectValue = AccountTypeEnum.PURCHASE; break; } checkForm(); ToastUtils.toast(String.valueOf(currentRadioSelectValue)); }