Remove style in order to make the buttons to have the correct color.

This commit is contained in:
jacques 2024-04-21 12:13:49 +02:00
parent dd50af72c6
commit a214d3ac1b

View file

@ -354,7 +354,7 @@ public class DrugListActivity extends AppCompatActivity {
final EditText editText= dialog.findViewById(R.id.editcip13); final EditText editText= dialog.findViewById(R.id.editcip13);
String cip13 = String.valueOf(editText.getText()); String cip13 = String.valueOf(editText.getText());
// TODO change the color of ok button when the number of character is correct. // TODO change the background color of ok button when the number of character is correct.
ok.setText(R.string.button_ok); ok.setText(R.string.button_ok);
cancel.setText(R.string.button_cancel); cancel.setText(R.string.button_cancel);
@ -373,7 +373,10 @@ public class DrugListActivity extends AppCompatActivity {
//alert.getButton(alert.BUTTON_POSITIVE).setEnabled(s.length() == 8); //alert.getButton(alert.BUTTON_POSITIVE).setEnabled(s.length() == 8);
if (s.length() == 8) { if (s.length() == 8) {
ok.setEnabled(true); ok.setEnabled(true);
ok.setBackground(ContextCompat.getDrawable(editText.getContext(), R.drawable.shadow_bg)); ok.setBackground(ContextCompat.getDrawable(editText.getContext(), R.drawable.rounded_btn));
} else {
ok.setEnabled(false);
ok.setBackground(ContextCompat.getDrawable(editText.getContext(), R.drawable.rounded_btn_disabled));
} }
} }
}); });