Open Louroj opened 8 years ago
Same here
If this is of any help. setOnPinEnteredListener doesn't seem to exists in the library so what i used was textchanged here is an example that works
pinEntryView.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@Override
public void afterTextChanged(Editable s) {
if(s.length() == 4){
InputMethodManager imm = (InputMethodManager)
getActivity().getSystemService(getActivity().INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(
pinEntryView.getWindowToken(), 0);
}
}
});
You need to download library sources: https://github.com/Philio/PinEntryView/tree/master/pinentry and include 'pinentry' project into application's build.gradle as a dependency:
dependencies { .... compile project(':pinentry') }
setOnPinEnteredListener is here on line 284: https://github.com/Philio/PinEntryView/blob/master/pinentry/src/main/java/me/philio/pinentry/PinEntryView.java
UPDATE1: You can also include a git repo dependency with this guy: https://github.com/bat-cha/gradle-plugin-git-dependencies
UPDATE2: My favorite way now: https://jitpack.io/#Philio/PinEntryView/master
Thanks @volax works like charm.
I'm currently trying to put a setOnPinEnteredListener on my app so it calls a webservice to validate the password but unfortunately it is not recognized.
here is what I have:
Any help on what I might be doing wrong?
here is a image to see what my problem is:
https://gyazo.com/8396ff4586e70d2822510b22565ca8a2