diff --git a/app/src/main/java/net/foucry/pilldroid/DrugListActivity.java b/app/src/main/java/net/foucry/pilldroid/DrugListActivity.java index a7feaf3..35127f4 100644 --- a/app/src/main/java/net/foucry/pilldroid/DrugListActivity.java +++ b/app/src/main/java/net/foucry/pilldroid/DrugListActivity.java @@ -347,6 +347,7 @@ public class DrugListActivity extends AppCompatActivity { Button ok = dialog.findViewById(R.id.agreed); Button cancel = dialog.findViewById(R.id.notagreed); ok.setEnabled(false); + ok.setBackground(getDrawable(R.drawable.rounded_btn_disabled)); //TextView title = (TextView ) dialog.findViewById(R.id.title); final EditText editText=(EditText)dialog.findViewById(R.id.editcip13); String cip13 = String.valueOf(editText.getText()); @@ -362,12 +363,16 @@ public class DrugListActivity extends AppCompatActivity { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { + } @Override public void afterTextChanged(Editable s) { //alert.getButton(alert.BUTTON_POSITIVE).setEnabled(s.length() == 8); - ok.setEnabled(s.length() == 8); + if (s.length() == 8) { + ok.setEnabled(true); + ok.setBackground(getDrawable(R.drawable.rounded_btn)); + } } }); ok.setOnClickListener(new View.OnClickListener() { diff --git a/app/src/main/res/drawable/rounded_btn_disabled.xml b/app/src/main/res/drawable/rounded_btn_disabled.xml new file mode 100644 index 0000000..89933d4 --- /dev/null +++ b/app/src/main/res/drawable/rounded_btn_disabled.xml @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file