A simple library that provides an easy to use OTP component.
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.ibraheemalazzawi:android-compose-otp:v1.0.0.alpha02'
}
OtpComponent(
onOtpComplete = { otp ->
//The otp is complete and returned
},
onEnableButtonStateChanged = { state ->
//To attach the otp component with a button, you can use this status to
//enable or disable the button
}
)
OtpComponent(
onOtpComplete = { otp ->
//The otp is complete and returned
},
onEnableButtonStateChanged = { state ->
//To attach the otp component with a button, you can use this status to
//enable or disable the button
},
keyStyle = KeyStyle(
height = 30.dp,
textColor = Primary,
keyFontSize = 20.sp
),
inputStyle = InputStyle(
gradientEnabledColor = listOf(Primary, PrimaryDark),
gradientDisabledColor = listOf(Accent, AccentLight),
inputFontSize = 20.sp
)
)