Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maksim88/PasswordEditText
A custom EditText with a switchable icon which shows or hides the password
https://github.com/maksim88/PasswordEditText
android android-library material password
Last synced: about 6 hours ago
JSON representation
A custom EditText with a switchable icon which shows or hides the password
- Host: GitHub
- URL: https://github.com/maksim88/PasswordEditText
- Owner: maksim88
- License: mit
- Created: 2016-01-16T12:20:39.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-31T16:07:46.000Z (over 7 years ago)
- Last Synced: 2023-10-19T22:48:22.309Z (about 1 year ago)
- Topics: android, android-library, material, password
- Language: Java
- Homepage: http://maksim88.github.io/PasswordEditText/
- Size: 6.64 MB
- Stars: 431
- Watchers: 13
- Forks: 75
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-android-ui - https://github.com/maksim88/PasswordEditText
- awesome-android-ui - https://github.com/maksim88/PasswordEditText
README
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Password%20EditText-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/3048)
[ ![Download](https://api.bintray.com/packages/maksim88/PasswordEditText/PasswordEditText/images/download.svg) ](https://bintray.com/maksim88/PasswordEditText/PasswordEditText/_latestVersion)
[![](https://jitpack.io/v/maksim88/PasswordEditText.svg)](https://jitpack.io/#maksim88/PasswordEditText)Deprecated
===========
This library is deprecated now as there is an official way to use the password toggle with the `TextInputLayout` (inside the support library starting with version `24.2.0`).
```
```
You can also wrap `PasswordEditText` inside a `TextInputLayout` to get a material design moving label on top:
```xml
```
Note: be sure to include the design library to use `TextInputLayout`. (for more details see `sample`)You can also use `TextInputLayout` to achieve an even prettier `setError()` dialog using `setErrorEnabled(true)` on the outer `TextInputLayout`
and then calling `setError()` on it. This underlines the text and shows an error message underneath the text.Customize
--------You can add your own custom icons which are shown on the right side of the `EditText`.
Do this by first adding the custom namespace to your root layout, e.g.:
```xml```
After that you can add the icons with the attributes `app:pet_iconShow` and `app:pet_iconHide`:
```xml
```
You can also set toggle the monospace Font inside the `PasswordEditTexts` with `app:pet_nonMonospaceFont`:
```xml
```
Another customization is to just toggle the visibility of the password when the icon is hovered with `app:pet_hoverShowsPw`:
```xml
```
If you do not like the alpha, that is set to all the icons, you can disable it using `app:pet_disableIconAlpha`
NOTE: alpha values are taken from the material design guidelines (https://www.google.com/design/spec/components/text-fields.html#text-fields-password-input)
```xml
```
For a working example of the different customizations check out the `activity_main.xml` inside the `sample` project.
Download
--------The library is available from `jcenter()`, so all you need to do is include it in your apps `build.gradle`:
```groovy
dependencies {
compile 'com.maksim88:PasswordEditText:v0.9'
}
```Alternatively you can use `jitpack.io`:
More info here: https://jitpack.io/#maksim88/PasswordEditTextQuestions?
--------
If you have any questions feel free to open a github issue with a 'question' labelLicense
--------
Licensed under the MIT license. See [LICENSE](LICENSE.md).