A customized view to enter a code often utilized in authentication. Various kinds of OTPViews. Simple to make use of and configure your personal view and character of OTP utilizing all of the attributes.
Easy OTPView Field OTPView Underline OTPView We are able to handle our personal OTPCount We are able to handle the OTP character colour We are able to handle OTP character dimension We are able to handle the border colour of OTPView as properly We are able to enabled and disabled the visibility of OTP characters We are able to customise your OTP characters utilizing attributes If we entered the wrong size of OTP then button won’t be clickable Easy OTPView with dot character Field OTPView with dot character Underline OTPView with dot character Easy OTPView with star character Field OTPView with star character Underline OTPView with star character
Tips on how to use the library?
Utilizing Compose Simply use the OtpView composable operate the place it is advisable show the view
otpText = otpValue,
onOtpTextChange = {
otpValue = it
},
sort = OTP_VIEW_TYPE_NONE,
password = true,
containerSize = 48.dp,
passwordChar = “•“,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Quantity),
charColor = Colour.White
)
Subsequent in your code create OtpView composable operate like beneath:
modifier: Modifier = Modifier,
otpText: String = “”,
charColor: Colour = Colour.Black,
charBackground: Colour = Colour.Clear,
charSize: TextUnit = 16.sp,
strokeColor: Colour = Colour.Black,
containerSize: Dp = charSize.worth.dp * 2,
otpCount: Int = 4,
sort: Int = OTP_VIEW_TYPE_UNDERLINE,
enabled: Boolean = true,
password: Boolean = false,
passwordChar: String = “”,
keyboardOptions: KeyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Quantity),
onOtpTextChange: (String) -> Unit
)
All Attributes
Attribute Description charColor To alter otp character colour. charSize Set customized character dimension. containerSize To alter the scale of otp character container. otpCount Set the customized vary of otp characters. password Present/cover the otp characters. passwordChar Set the customized character for otp password. strokecolor Set the customized colour to container border. sort For personalisation we’ve created three sorts: 1. OTP_VIEW_TYPE_NONE 2. OTP_VIEW_TYPE_UNDERLINE 3. OTP_VIEW_TYPE_BOX keyboardOptions Set the customized keyboard which you want.
Official Documentations
Discover this samples helpful? ❤️
Help it by becoming a member of stargazers for this repository.⭐
Tips on how to Contribute????
Whether or not you are serving to us repair bugs, enhance the docs, or a characteristic request, we would like to have you ever! ???? Try our Contributing Information for concepts on contributing.
Bugs and Suggestions
For bugs, characteristic requests, and dialogue please use GitHub Points.
Superior Cellular Libraries
License
Licensed below the Apache License, Model 2.0 (the “License”);
you might not use this file besides in compliance with the License.
You could receive a replica of the License at
http://www.apache.org/licenses/LICENSE-2.0
Except required by relevant legislation or agreed to in writing, software program
distributed below the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, both categorical or implied.
See the License for the particular language governing permissions and
limitations below the License.