mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-09 23:41:08 +01:00
Add new gray drawable for disabled button
Use the round_btn_disable drawable to show that de number of digit are not set.
This commit is contained in:
parent
f9b06100d4
commit
2890afea19
2 changed files with 15 additions and 1 deletions
|
@ -347,6 +347,7 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
Button ok = (Button) dialog.findViewById(R.id.agreed);
|
||||
Button cancel = (Button) 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() {
|
||||
|
|
9
app/src/main/res/drawable/rounded_btn_disabled.xml
Normal file
9
app/src/main/res/drawable/rounded_btn_disabled.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/grey" />
|
||||
<corners android:bottomRightRadius="24dp"
|
||||
android:bottomLeftRadius="24dp"
|
||||
android:topRightRadius="24dp"
|
||||
android:topLeftRadius="24dp"/>
|
||||
</shape>
|
Loading…
Reference in a new issue