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

android-otpview-pinview

> 安全
Open source

A custom view to enter otp of different sizes used usually in cases of authentication.

726 stars0 likes0 views
WebsiteGitHub

About

A custom view to enter otp of different sizes used usually in cases of authentication.

Compose OtpView/PinView

A custom control to enter a code usually in cases of authentication.

        

Supporting Compose OtpView/PinView

Compose PinView/OtpView is an independent project with ongoing development and support made possible thanks to your donations.

  • Become a backer

How to integrate into your app?

Integrating the project is simple. All you need to do is follow the below steps

Step 1. Add the JitPack repository to your build file. Add it in your root build.gradle at the end of repositories:

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

Step 2. Add the dependency for Compose

java
dependencies {
        implementation 'com.github.mukeshsolanki.android-otpview-pinview:otpview-compose:3.1.0'
}

for View system

java
dependencies {
        implementation 'com.github.mukeshsolanki.android-otpview-pinview:otpview:3.1.0'
}

How to use the library?

Okay seems like you integrated the library in your project but how do you use it? Well its really easy.

  • Using Compose Just use the OtpView composable where you need to display the view like.
kotlin
var otpValue by remember { mutableStateOf("") }
OtpView(
    otpText = otpValue,
    onOtpTextChange = {
        otpValue = it
        Log.d("Actual Value", otpValue)
    },
    type = OTP_VIEW_TYPE_BORDER,
    password = true,
    containerSize = 48.dp,
    passwordChar = "•",
    keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
    charColor = Color.White
)
  • Using Older View System (aka XML) Add the view in your xml file like
xml

Next in your code assign otp_view to a variable like

kotlin
val otpView = findViewById(R.id.otp_view)

implement OnOtpCompletionListener

kotlin
otpView.setOtpCompletionListener {
    Log.d("Actual Value", it)
}

That's pretty much it and your all wrapped up.

Author

Maintained by Mukesh Solanki

Contribution

  • Bug reports and pull requests are welcome.

License

…

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Javaandroidandroid-libraryandroid-pinviewauthentication

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category安全
PricingOpen source

> Related tools

O
OWASP ZAP
开源 Web 应用安全扫描器
O
owasp-wstg-tracker
Simple web app to track OWASP WSTG security testing progress
H
homebridge-mi-gateway-security
XiaoMi Gateway Security plugin for HomeBridge.