From a214d3ac1b5884941434ee02ef064a3f5529b13c Mon Sep 17 00:00:00 2001 From: jacques Date: Sun, 21 Apr 2024 12:13:49 +0200 Subject: [PATCH] Remove style in order to make the buttons to have the correct color. --- .../main/java/net/foucry/pilldroid/DrugListActivity.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/foucry/pilldroid/DrugListActivity.java b/app/src/main/java/net/foucry/pilldroid/DrugListActivity.java index 57cfe8b..d262b8b 100644 --- a/app/src/main/java/net/foucry/pilldroid/DrugListActivity.java +++ b/app/src/main/java/net/foucry/pilldroid/DrugListActivity.java @@ -354,7 +354,7 @@ public class DrugListActivity extends AppCompatActivity { final EditText editText= dialog.findViewById(R.id.editcip13); 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); cancel.setText(R.string.button_cancel); @@ -373,7 +373,10 @@ public class DrugListActivity extends AppCompatActivity { //alert.getButton(alert.BUTTON_POSITIVE).setEnabled(s.length() == 8); if (s.length() == 8) { 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)); } } });