本文整理汇总了Java中com.rey.material.widget.Button.setBackgroundColor方法的典型用法代码示例。如果您正苦于以下问题:Java Button.setBackgroundColor方法的具体用法?Java Button.setBackgroundColor怎么用?Java Button.setBackgroundColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.rey.material.widget.Button
的用法示例。
在下文中一共展示了Button.setBackgroundColor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addSecurityQuestion
import com.rey.material.widget.Button; //导入方法依赖的package包/类
private void addSecurityQuestion(SecurityQuestionModel securityQuestion) {
_logger.Debug("addSecurityQuestion");
final EditText questionEditText = new EditText(_context);
final EditText answerEditText = new EditText(_context);
final ArrayList<EditText> editPair = new ArrayList<>();
editPair.add(questionEditText);
editPair.add(answerEditText);
final Button removeSecurityQuestions = new Button(_context);
removeSecurityQuestions.setBackgroundColor(COLOR_BLACK_MAX_ALPHA);
removeSecurityQuestions.setText("X");
removeSecurityQuestions.setGravity(Gravity.END);
removeSecurityQuestions.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
_securityQuestionEditTextList.remove(editPair);
_securityButtonList.remove(removeSecurityQuestions);
_linearLayoutSecurityQuestions.removeView(questionEditText);
_linearLayoutSecurityQuestions.removeView(answerEditText);
_linearLayoutSecurityQuestions.removeView(removeSecurityQuestions);
}
});
_linearLayoutSecurityQuestions.addView(removeSecurityQuestions);
_linearLayoutSecurityQuestions.addView(questionEditText);
_linearLayoutSecurityQuestions.addView(answerEditText);
_securityQuestionEditTextList.add(editPair);
_securityButtonList.add(removeSecurityQuestions);
if (securityQuestion != null) {
questionEditText.setText(securityQuestion.GetQuestion());
answerEditText.setText(securityQuestion.GetAnswer());
}
}
示例2: handleConfirmButtonText
import com.rey.material.widget.Button; //导入方法依赖的package包/类
private void handleConfirmButtonText(Button confirmarButton) {
if (PedidoAbertoManager.getInstance().hasConta())
{
confirmarButton.setText("Pagar a Conta");
confirmarButton.setBackgroundColor(getResources().getColor(android.R.color.holo_red_light));
}
else{
confirmarButton.setText("Confirmar");
confirmarButton.setBackground(getResources().getDrawable(R.drawable.bg_bt_raise_color));
}
}