shiburagi/BlockEditText

[Question] Is there is a way to get input only when the blockField is filled with number of blocks?

DasserBasyouni opened this issue ยท 5 comments

In more explanation, I'm wondering about if there is a listener that listens to inputs only when it fills the whole field, so if bet_numberOfBlock="6" then it will only be notified when 6 strings/ints and in the field.

thank you for your great work

amexEditText.setTextChangedListener(TextWatcher watcher)

I think you can use above method. And below the example.

amexEditText.setTextChangedListener(new TextWatcher() {
    @Override
    public void beforeTextChanged(CharSequence s, int start, int count, int after) {

    }

    @Override
    public void onTextChanged(CharSequence s, int start, int before, int count) {
       
    }

    @Override
    public void afterTextChanged(Editable s) {
        if(amexEditText.getText().length()==6){
            // do something here
        }
    }
});

thank you, I didn't find it when I was searching in the library

you're welcome

btw, i already publish new version, implementation 'com.infideap.blockedittext:block-edittext:0.0.7'

fix some issue with text listener, and u can find the example here,

https://github.com/shiburagi/BlockEditText/blob/master/app/src/main/java/com/infideap/blockedittext/MainActivity.java

thank you so much