mukeshsolanki / android-otpview-pinview

A custom view to enter otp of different sizes used usually in cases of authentication.
MIT License
699 stars 207 forks source link

setItemBackgroundResources not changed programmatically #144

Closed HeshamMorsy closed 2 years ago

HeshamMorsy commented 2 years ago

I want to change item background when the OTP is not correct.

When I change it, I debugged the behavior and I think the problem is the following condition :

if (resId != 0 && itemBackgroundResource != resId) { return }

This is the whole function :

fun setItemBackgroundResources(@DrawableRes resId: Int) { if (resId != 0 && itemBackgroundResource != resId) { return } itemBackground = ResourcesCompat.getDrawable(resources, resId, context.theme) setItemBackground(itemBackground) itemBackgroundResource = resId }

This function is going to return when I pass any drawable resource.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This has been closed with no activity