Pinview
Pinview copied to clipboard
Delete/BackSpace Key is not working in some keyboards!
The problem is that on several keyboards onKey() method is not getting called for key event KEYCODE_DEL on pressing Backspace/Delete. This seems to be a serious bug since user can't type a new pin if he has entered a wrong one.
Hi @imidhuntv Yes this is a known issue. Also mentioned in the documentation. Note : This library cannot be assured to work on 3rd party keyboards (especially when the cursor is off). It works as expected on google keyboards. We will be adding a work-around in the future releases.
So this works on all google keyboards and 3rd party keyboards which are built on top of it (like swift). We cannot assure other 3rd party libraries because we are not sure how they are handling events. We are going to fix this soon (we are caught up with work so its delayed a bit )and this issue is open for everyone. Anyone who thinks has a valid solution for this can do a pull request or suggest possible solutions. Sorry for the inconvenience caused. Team GoodieBag.
This method can be used to solve this problem. https://blog.csdn.net/yanghuiyu38/article/details/53638601
This code update might work: (to PinView.onKey) //Takes it back one tile editTextList.get(currentTag - 1).setEnabled(true); editTextList.get(currentTag - 1).requestFocus();
Was there ever any solution created for this? Or good workaround?
Hi @imidhuntv Yes this is a known issue. Also mentioned in the documentation. Note : This library cannot be assured to work on 3rd party keyboards (especially when the cursor is off). It works as expected on google keyboards. We will be adding a work-around in the future releases.
So this works on all google keyboards and 3rd party keyboards which are built on top of it (like swift). We cannot assure other 3rd party libraries because we are not sure how they are handling events. We are going to fix this soon (we are caught up with work so its delayed a bit )and this issue is open for everyone. Anyone who thinks has a valid solution for this can do a pull request or suggest possible solutions. Sorry for the inconvenience caused. Team GoodieBag.
pinview.setPinViewEventListener(new Pinview.PinViewEventListener() {
@Override
public void onDataEntered(Pinview pinview, boolean fromUser) {
}
// Can You Add This
@Override
public void onDelete(Pinview pinview) {
// Handle backspace key press
String currentPin = pinview.getValue();
if (!TextUtils.isEmpty(currentPin)) {
// Remove the last character from the PIN
pinview.setValue(currentPin.substring(0, currentPin.length() - 1));
}
}
});