JcMinarro / RoundKornerLayouts

Round Korner Layouts is an Android library create to build a layout with the round corners
https://jcminarro.github.io/RoundKornerLayouts/
Apache License 2.0
202 stars 37 forks source link

lateinit property has not been initialized kotlin #5

Closed aboulfotoh closed 6 years ago

aboulfotoh commented 7 years ago

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??

JcMinarro commented 6 years ago

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

aboulfotoh commented 6 years ago

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

JcMinarro commented 6 years ago

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