JcMinarro / RoundKornerLayouts

Round Korner Layouts is an Android library create to build a layout with the round corners

Home Page:https://jcminarro.github.io/RoundKornerLayouts/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lateinit property has not been initialized kotlin

aboulfotoh opened this issue · comments

I'm using your library in my project but I'm writing my code in Java not Kotlin and I'm using Butterknife for binding views when I'm trying to deal with your view in my code I'm getting this error

kotlin.UninitializedPropertyAccessException: lateinit property rectF has not been initialized

so I can't use setCornerRadius() method because rectF hasn't been initialized yet how can I use it??

Hello @aboulfotoh The problem is that the view has not been measured yet and the rectF used to delimit the boundary of the view hasn't been initialized.
I will try to fix it this weekend

all what you have to do is put the below line in your class CanvasRounder
private var rectF: RectF = android.graphics.RectF(0f, 0f, 0f, 0f)

and it will work fine

Sound great, Give me a moment and I will fix it