Giter Club home page Giter Club logo

pinpad's Introduction

PinPad

PinPad view for android. Alt text Alt text

Highly customizable PinPad view for android applications:

  • Contains completely finished Pin Pad UI for your application
  • Supports fingerprint authentication
  • KeyboardView and PinCodeField can be used alone to build your own unique interface
  • Different styles for keyboard directly from the box
  • No encryption/decryption logic, no secure storage - ONLY UI

    PinPadView Usage:


    1) Define your PinPadView in layout:

    <com.grishko188.pinlibrary.PinPadView
        android:id="@+id/pin_pad"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
    


    2) Initialize singleton configuration

            Configuration.withContext(this)
                    .mode(PinPadView.PinPadUsageMode.ENTER)
                    ...
                    .build(mPinPad);
    

    or create new instance as shown below:

     Configuration.ConfigurationBuilder builder = new Configuration.ConfigurationBuilder(this);
     
            builder.mode(PinPadView.PinPadUsageMode.SETUP);
            builder.setSetupPinCodeListener(new OnSetupPinCodeListener() {
                @Override
                public void onSuccess(String pinCode) {
                    
                }
    
                @Override
                public void onFail() {
    
                }
            });
            ...
            builder.build(mPinPad);
    


    3) Enable fingerprint

            Configuration.withContext(this)
                    .mode(PinPadView.PinPadUsageMode.ENTER)
                    .useFingerprint(true)
                    .withCryptoObject(new FingerprintManagerCompat.CryptoObject(mCipher))
                    ...
                    .build(mPimPad);
    


    4) Start / stop listening fingerprint

        @Override
        protected void onResume() {
            super.onResume();
            mPinPad.startFingerprintScanner(); 
        }
    
        @Override
        protected void onPause() {
            super.onPause();
            mPinPad.stopFingerprintScanner();
        }
    


    For more information look into sample project.

    PinPadView Customization:


    1) UI with xml attributes:

    <attr name="ppv_color" format="color" />
    <attr name="ppv_buttons_text_size" format="dimension|reference" />
    <attr name="ppv_keyboard_form_style">
         <enum name="round" value="0" />
         <enum name="square" value="1" />
         <enum name="square_no_borders" value="2" />
         <enum name="round_no_borders" value="3" />
    </attr>
    <attr name="ppv_empty_char_style">
        <enum name="stroke" value="1" />
        <enum name="fill" value="0" />
    </attr>
    <attr name="ppv_max_len" format="integer|reference" />
    <attr name="ppv_size" format="dimension|reference" />
    <attr name="ppv_letter_spacing" format="dimension|reference" />
    <attr name="ppv_fill_color" format="color" />
    <attr name="ppv_max_try" format="integer" />
    <attr name="ppv_keyboard_width" format="dimension|reference" />
    


    2) UI from Java code:

     public void setColor(int color) 
     public void setKeyboardTextSize(int keyboardTextSize)
     public void setMaxLength(int maxLength)
     public void setSize(float size)
     public void setMaxTryCount(int maxTryCount)
     public void setEmptyCharFillColor(int fillColor)
     public void setLetterSpacing(int letterSpacing)
     public void setKeyboardWidth(int keyboardWidth) 
    


    For some devices icons auto tinting not working properly
    In this case just override library colors

        <color name="pinlibrary_default">#5b5b5b</color>
        <color name="pinlibrary_white_transparent">#88FFFFFF</color>
        <color name="pinlibrary_pinbutton_border">#FFFFFF</color>
        <color name="pinlibrary_round_mask_border">#FFFFFF</color>
        <color name="pinlibrary_round_mask_fill">#FFFFFF</color>
    
  • 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.