I use RemoteInput in my Android N notifications.
I want to set a min and max text length limit for the input.
Google Hangouts got this (i.e. the send button enables when the user entered at least 1 character). Anyone know how this can be done? I've tried to check the Android docs but no luck.
button.setClickable(false);
button.setEnabled(false);
editText = (EditText)findViewById(R.id.editText);
editText.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
button.setClickable(true);
button.setTextColor(getResources().getColor(R.color.colorPrimary));
// TODO Auto-generated method stub
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
// TODO Auto-generated method stub
}
@Override
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
}
});
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With