Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

PinView

> 编程语言
Open source

A PIN view library for Android. Use to enter PIN/OTP/password etc.

658 stars0 likes0 views
WebsiteGitHub

About

A PIN view library for Android. Use to enter PIN/OTP/password etc.

PinView

Provides a widget for enter PIN/OTP/password etc on Android 4.1+ (API 16).

Dependency

JCenter(Deprecated)

repositories {
    maven {
        jcenter()
    }
}

dependencies {
   implementation 'com.chaos.view:pinview:1.4.4'
}

MavenCentral

repositories {
    maven {
        mavenCentral()
    }
}

dependencies {
   implementation 'io.github.chaosleung:pinview:1.4.4'
}

Note that MavenCentral uses io.github.chaosleung as the group id

Usage

PinView inherits from EditText, which means you can use all the APIs from EditText.

Step 1:

Add PinView in your layout.

XML

Java

…

Step 2:

Specifies pinViewStyle in your theme,

or use the PinWidget.PinView style.

Step 3 (Optional):

To highlight current item, use 'selected' state, in other words,

add android:state_selected="true" to app:lineColor


    
    
    
    

or add android:cursorVisible="true".

Attributes

  • itemCount, the length of your pin code.
  • itemWidth, the width of each item.
  • itemHeight, the height of each item.
  • itemSpacing, the spacing between two items.
  • lineWidth, the line (border) width.
  • lineColor, the line (border) colors.
  • viewType, the view type of PinView, currently this will be one of rectangle, line or none.
  • cursorVisible, show cursor or not.
  • cursorColor, the cursor color.
  • cursorWidth, the width of cursor.
  • itemBackground, the item background.
  • hideLineWhenFilled, specifies whether the line (border) should be hidden or visible when text entered.

Thanks

  • Inspired by PasswordInput in EthanCo

License

Copyright 2017-2018 Chaos Leong

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Javaandroid-librarybox-edittextbox-inputedittext

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言