PinLockView icon indicating copy to clipboard operation
PinLockView copied to clipboard

Delete button turns white after first touch

Open DFreds opened this issue 8 years ago • 4 comments

Hello,

I noticed an issue where the back button changes to white when I tap it. This is problematic because I'd like to have a white background. I'm attaching three screenshots that show the keypad before I enter anything, after I've entered three numbers, and after I've pressed the delete button one time. I turned the background color blue to show what I mean.

Before screen shot 2017-07-18 at 3 23 18 pm

During screen shot 2017-07-18 at 3 23 32 pm

After deleting one screen shot 2017-07-18 at 3 23 42 pm

Any ideas? Thanks!

DFreds avatar Jul 18 '17 19:07 DFreds

Edit..

Using drawable state

https://stackoverflow.com/questions/22044788/button-change-background-color-on-click

jimmyleonardo avatar Aug 02 '17 10:08 jimmyleonardo

  1. Create ic_delete.xml in drawable. <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="55dp" android:height="45dp" android:viewportWidth="55.0" android:viewportHeight="45.0"> <path android:pathData="M53.42,2L18.27,2C16.67,2 15.29,2.68 14.38,4.05L2,22.5L14.38,40.95C15.29,42.09 16.67,43 18.27,43L53.42,43L53.42,2Z" android:strokeColor="#000000" android:fillColor="#00000000" android:strokeWidth="3"/> <path android:pathData="M37.95,16L25,28.5" android:strokeLineCap="square" android:strokeColor="#000000" android:fillColor="#00000000" android:strokeWidth="3"/> <path android:pathData="M37.5,28.95L25,16" android:strokeLineCap="square" android:strokeColor="#000000" android:fillColor="#00000000" android:strokeWidth="3"/> </vector>

  2. Set keypadDeleteButtonDrawable to PinLockView app:keypadDeleteButtonDrawable="@drawable/ic_delete"

chetan-yg avatar Aug 30 '17 07:08 chetan-yg

I think this issue needs to be looked for @aritraroy

pfieffer avatar Mar 13 '18 07:03 pfieffer

I think this problem is because the library was meant to be used for the pin lock view with any background other than the white color. Anyhow, a quick fix to this problem is mPinLockView.setDeleteButtonDrawable(getResources().getDrawable(R.drawable.ic_backspace_pin)); //delete button drawable Be sure to import a backspace icon which has the color you want for the backspace button.

pfieffer avatar Mar 16 '18 06:03 pfieffer