@@ -37,44 +37,44 @@ class OtpCodeView @JvmOverloads constructor(
3737 addView(binding.root)
3838 val attributes = context.obtainStyledAttributes(
3939 attrs,
40- R .styleable.VerifyCodeView ,
40+ R .styleable.OtpCodeView ,
4141 defStyleAttr,
4242 defStyleAttr
4343 )
4444 codeLength = attributes.getInteger(
45- R .styleable.VerifyCodeView_code_length ,
45+ R .styleable.OtpCodeView_code_length ,
4646 6
4747 )
4848 codeStrokeWidth = attributes.getDimension(
49- R .styleable.VerifyCodeView_code_stroke_width ,
49+ R .styleable.OtpCodeView_code_stroke_width ,
5050 1 * ratioDpToPixels
5151 )
5252 codeRadius = attributes.getDimension(
53- R .styleable.VerifyCodeView_code_radius ,
53+ R .styleable.OtpCodeView_code_radius ,
5454 12 * ratioDpToPixels
5555 )
5656 codeColor = attributes.getColor(
57- R .styleable.VerifyCodeView_code_color ,
57+ R .styleable.OtpCodeView_code_color ,
5858 ContextCompat .getColor(context, R .color.color_f2f2f2)
5959 )
6060 codeBGColor = attributes.getColor(
61- R .styleable.VerifyCodeView_code_background_color ,
61+ R .styleable.OtpCodeView_code_background_color ,
6262 ContextCompat .getColor(context, R .color.color_0af1f6f9)
6363 )
6464 codeStrokeColor = attributes.getColor(
65- R .styleable.VerifyCodeView_code_background_color ,
65+ R .styleable.OtpCodeView_code_stroke_color ,
6666 ContextCompat .getColor(context, R .color.color_b3fec70a)
6767 )
6868 codeStrokeErrorColor = attributes.getColor(
69- R .styleable.VerifyCodeView_code_background_color ,
69+ R .styleable.OtpCodeView_code_stroke_error_color ,
7070 ContextCompat .getColor(context, R .color.color_ef4d42)
7171 )
7272 codeErrorColor = attributes.getColor(
73- R .styleable.VerifyCodeView_code_error_color ,
73+ R .styleable.OtpCodeView_code_error_color ,
7474 ContextCompat .getColor(context, R .color.color_ef4d42)
7575 )
7676 codeDoneStrokeColor = attributes.getColor(
77- R .styleable.VerifyCodeView_code_done_stroke_color ,
77+ R .styleable.OtpCodeView_code_done_stroke_color ,
7878 ContextCompat .getColor(context, R .color.color_fec70a)
7979 )
8080 attributes.recycle()
@@ -134,7 +134,7 @@ class OtpCodeView @JvmOverloads constructor(
134134 private fun getDrawable (strokeColor : Int , hasStroke : Boolean ): GradientDrawable {
135135 val drawable = GradientDrawable ()
136136 drawable.setColor(codeBGColor)
137- drawable.cornerRadius = codeRadius.toFloat()
137+ drawable.cornerRadius = codeRadius
138138 if (hasStroke) drawable.setStroke(codeStrokeWidth.toInt(), strokeColor)
139139 return drawable
140140 }
0 commit comments