CGreenP / Contacts-Manager

A lightweight Android contacts manager app using Room DB and MVVM architecture. Stores names, phone numbers, and email addresses locally.
0 stars 0 forks source link

After swiping left to delete a particular contact, UI glitches to make some other contact invisible. #1

Closed CGreenP closed 3 weeks ago

CGreenP commented 3 weeks ago

After swiping left to delete a particular contact, after deletion, certain other contact fades out and becomes not visible as well, when I try to tap and swap left that particular invisible contact it appears again.

CGreenP commented 3 weeks ago

It seems like the issue is caused by the itemView.setAlpha() call inside onChildDraw(). When an item is swiped to delete, its alpha is permanently set, affecting its visibility even after it's removed from the RecyclerView. To fix this, need to reset the alpha value of the itemView when the swipe is completed or canceled. Can be done by overriding the clearView() method of the ItemTouchHelper.SimpleCallback.