PinLockView
PinLockView copied to clipboard
Delete button not clickable when visible
I have encountered a strange bug. In one of my activities the keypad delete button cannot be used even though it is set to true in the XML and is visible. This only occurs in one activity, all other activities function correctly.
This is my xml for the layout (identical to one that works in another activity):
<com.andrognito.pinlockview.PinLockView
android:id="@+id/activeTaskViewPinLockView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="48dp"
app:keypadButtonSize="72dp"
app:keypadShowDeleteButton="true"
app:keypadTextColor="@color/white"
app:keypadTextSize="18dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
in onCreate I set it up:
pinLockView.attachIndicatorDots(pinLockIndicatorDots);
pinLockView.resetPinLockView();
pinLockListener = new PinLockListener() {
@Override
public void onComplete(String pin) {
//do stuff
}
@Override
public void onEmpty() {
}
@Override
public void onPinChange(int pinLength, String intermediatePin) {
}
};
pinLockView.setPinLockListener(pinLockListener);
This code is identical to that of a working activity. So I am stumped as to what is causing it.
Any ideas?
After further testing, it only happens when I call resetPinLockView
when there is no code entered.
If I call resetPinLockView
with >0 characters entered, the delete button functions. However, as soon as I call resetPinLockView
with 0 characters entered, the delete button no longer works.
Realised this is a duplicate of this issue
I just found this out: When you set the color of the buttons by calling
pinLockView.setTextColor(myColor)
and then call
pinLockView.resetPinLockView()
(independent of the number of characters, even > 0), then the delete button doesn't work as well. I fixed this by not setting the color in code, lawl.
After further testing, it only happens when I call
resetPinLockView
when there is no code entered.If I call
resetPinLockView
with >0 characters entered, the delete button functions. However, as soon as I callresetPinLockView
with 0 characters entered, the delete button no longer works.
Did you fix the bug finally ?