PinLockView icon indicating copy to clipboard operation
PinLockView copied to clipboard

Delete button not clickable when visible

Open CallumCoombes opened this issue 6 years ago • 4 comments

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?

CallumCoombes avatar Jul 12 '18 19:07 CallumCoombes

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.

CallumCoombes avatar Jul 12 '18 19:07 CallumCoombes

Realised this is a duplicate of this issue

CallumCoombes avatar Jul 12 '18 19:07 CallumCoombes

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.

raptus93 avatar Aug 16 '18 12:08 raptus93

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.

Did you fix the bug finally ?

Ium-Lab avatar May 27 '19 06:05 Ium-Lab