Skip to content

Commit 9a63ebe

Browse files
committed
Fix attrs
1 parent 6128d80 commit 9a63ebe

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

otp_code_view/src/main/java/com/otp/otp_code_view/OtpCodeView.kt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

otp_code_view/src/main/res/values/atttrs.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3-
<attr name="VerifyCodeViewStyle" format="reference" />
4-
<declare-styleable name="VerifyCodeView">
3+
<attr name="OtpCodeViewStyle" format="reference" />
4+
<declare-styleable name="OtpCodeView">
55
<attr name="code_radius" format="dimension" />
66
<attr name="code_length" format="integer" />
77
<attr name="code_color" format="color" />

0 commit comments

Comments
 (0)