GithubHelp home page GithubHelp logo

jaym0826 / passwordview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lisawray/passwordview

0.0 2.0 0.0 3.5 MB

A Material Android password view that toggles password visibility via an eye icon.

License: The Unlicense

Java 100.00%

passwordview's Introduction

##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

<com.xwray.passwordview.PasswordView
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  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.

passwordView.setTypeface(roboto);

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)

passwordview's People

Watchers

James Cloos avatar Richard Ma avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.