A customized view to enter a code normally utilized in authentication. Several types of OTPViews. Straightforward to make use of and configure your individual view and character of OTP utilizing all of the attributes.
Easy OTPView Field OTPView Underline OTPView We will handle our personal OTPCount We will handle the OTP character shade We will handle OTP character dimension We will handle the border shade of OTPView as properly We will enabled and disabled the visibility of OTP characters We will customise your OTP characters utilizing attributes If we entered the inaccurate 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
The best way to use the library?
Utilizing Compose Simply use the OtpView composable perform the place you want to show the view
otpText = otpValue,
onOtpTextChange = {
otpValue = it
},
kind = 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 perform 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,
kind: 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 shade. charSize Set customized character dimension. containerSize To alter the dimensions of otp character container. otpCount Set the customized vary of otp characters. password Present/conceal the otp characters. passwordChar Set the customized character for otp password. strokecolor Set the customized shade to container border. kind For personalisation we now have 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? ❤️
Assist it by becoming a member of stargazers for this repository.⭐
The best way to Contribute????
Whether or not you are serving to us repair bugs, enhance the docs, or a characteristic request, we might 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 underneath the Apache License, Model 2.0 (the “License”);
chances are you’ll not use this file besides in compliance with the License.
Chances are you’ll get hold of a duplicate of the License at
http://www.apache.org/licenses/LICENSE-2.0
Until required by relevant regulation or agreed to in writing, software program
distributed underneath 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 precise language governing permissions and
limitations underneath the License.