Skip to content
A Material Android password view that toggles password visibility via an eye icon.
Branch: development
Clone or download
Latest commit 52d0b82 May 27, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
library Update config to 1.0 Aug 14, 2016
passwordviewsample Clean up demo project for Day/Night mode Aug 14, 2016
.gitignore Initial commit Mar 16, 2016 Create Jul 21, 2016 Update May 27, 2017
build.gradle Update config to 1.0 Aug 14, 2016 Initial commit Mar 16, 2016
gradlew Initial commit Mar 16, 2016
gradlew.bat Initial commit Mar 16, 2016
settings.gradle Initial commit Mar 16, 2016

8/17/2016: As of about an hour ago, this library is deprecated!

Support for password visibility is now included in the Design Support Library in TextInputLayout. 🎉

PasswordView [deprecated]

👀 "All eyes, yeah I see 'em" — Yo Gotti, Down in the DM

compile 'com.xwray:passwordview:1.0'

Drop-in Android password view for the new material design spec

  android:hint="@string/password_hint" />

Toggle password visibility

Touch the "eye" icon to toggle between traditional and visible password states.

Custom typeface support

In the spec, the password field is pictured in Roboto. I really liked how this looked, so, I made PasswordView support custom typefaces! If you set one, it will stay. If you don't, the default is still monospace — no worries.


Optional strikethrough

By default, PasswordView adheres exactly to the spec, using 54% / 38% opacity for the visibility icon (or 50% / 100% for light on dark themes). The visibility icon is drawn using textColorPrimary and its opacity values (dark or light) are determined dynamically.

If you find opacity too subtle (insert eye roll 👀), you can use the visibility icon with a strikethrough instead. (idea credit, @thekeeperofpie)

app:useStrikeThrough="true" / passwordView.setUseStrikethrough(true)

You can’t perform that action at this time.