Coder Social home page Coder Social logo

heimdall-2's Introduction

Heimdall

A collection of useful views/widgets that guard your app.

Features

Currently contains:

  • PasswordValidationView - A simple view which provides password criteria matching via Regex for your password fields.

Demo Screen Capture

Installation

Step 1. Add the JitPack repository to your build file

allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}

Step 2. Add the dependency

dependencies {
  implementation 'com.github.prolificinteractive:heimdall:${version}'
}

Usage

Step 1. Place the PasswordValidationView below your password EditText field in your layout.

Step 2. Make sure to set add app:pvv_editTextId="@id/your_password_field_id" to the PasswordValidationView attributes.

Step 3. Call PasswordValidationView.setupValidation(Callback callback, ValidationCheck... fields) and pass in the required callback and your validation checks (Regex).

Example:

  <android.support.design.widget.TextInputLayout
        android:id="@+id/password_til"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="8dp"
        >
      <EditText
          android:id="@+id/password_text"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:hint="@string/hint_password"
          android:inputType="textPassword"
          />
    </android.support.design.widget.TextInputLayout>
    <com.prolificinteractive.heimdall.PasswordValidationView
        android:id="@+id/password_validation_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="8dp"
        android:visibility="gone"
        app:pvv_editTextId="@id/password_text"
        app:pvv_headerText="@string/password_must_include"
        app:pvv_headerTextAppearance="@style/CustomHeaderTextAppearance"
        app:pvv_itemDrawableMatch="@drawable/ic_check_black_24dp"
        app:pvv_itemDrawableNoMatch="@drawable/ic_close_black_24dp"
        app:pvv_itemTextAppearance="@style/CustomItemTextAppearance"
        app:pvv_headerTextVisiblity="visible"
        app:pvv_noOfColumns="2"
        >
    </com.prolificinteractive.heimdall.PasswordValidationView>

Customization

Currently supported XML attributes:

  • pvv_editTextId Your password field's view id.
  • pvv_headerText Set the text for the header text (above the validation checks grid).
  • pvv_headerTextAppearance Set the header's appearance.
  • pvv_itemDrawableMatch Set the icon when the entered text matches the validation check.
  • pvv_itemDrawableNoMatch Set the icon when the entered text does NOT match the validation check (Default state).
  • pvv_itemTextAppearance Set items text appearance (You can set your selected/unselected state here).
  • pvv_headerTextVisiblity Set the visiblity of the header (visible, invisible, gone)
  • pvv_noOfColumns Set the number of columns used to display the items (min 1, max 5)

Make sure to check sample for a more concrete example.

Contributing

Would you like to contribute? Fork us and send a pull request! Be sure to checkout our issues first.

License

prolific

Copyright (c) 2018 Prolific Interactive

The Heimdall library is Copyright (c) 2018 Prolific Interactive. It may be redistributed under the terms specified in the LICENSE file.

Heimdall (name and character) is a copyright of Marvel.

heimdall-2's People

Contributors

jogan avatar zach-cs 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.