If you use the background for edittext or texteditlayout, then switching the visibility of the password is hidden under the background. Therefore, remove the background or create your own style and make it the theme for the text of editing in XML format.
<style name="EditText_theme" parent=""> <item name="passwordToggleTintMode">src_over</item> </style>
If the problem persists or the background is not saved, change the theme of the application itself, as the primary colors are defined there.
Here is another workaround that didn't work for me. This is what I got from Google Android Docs,
<style name="EditText_theme" parent=""> <item name="passwordToggleTint">@color/white</item> </style>
Nihal source share