@@ -9,18 +9,18 @@ import com.agrawalsuneet.squareloaderspack.R
9
9
10
10
class LShapeView : View , LoaderContract {
11
11
12
-
13
12
var baseRectWidth: Int = 400
14
13
var baseRectHeight: Int = 100
15
14
16
15
var verticalRectWidth: Int = 100
17
16
var verticalRectHeight: Int = 400
18
17
19
-
20
18
private var rectColor: Int = resources.getColor(android.R .color.darker_gray)
21
19
private lateinit var rectPaint: Paint
22
20
23
- constructor (context: Context ) : super (context)
21
+ constructor (context: Context ) : super (context){
22
+ initValues()
23
+ }
24
24
25
25
constructor (context: Context , baseRectWidth: Int , baseRectHeight: Int ,
26
26
verticalRectWidth: Int , verticalRectHeight: Int , color: Int ) : super (context) {
@@ -32,12 +32,14 @@ class LShapeView : View, LoaderContract {
32
32
initValues()
33
33
}
34
34
35
- constructor (context: Context , attrs: AttributeSet ? ) : super (context, attrs) {
36
- initAttributes(attrs!! )
35
+ constructor (context: Context , attrs: AttributeSet ) : super (context, attrs) {
36
+ initAttributes(attrs)
37
+ initValues()
37
38
}
38
39
39
- constructor (context: Context , attrs: AttributeSet ? , defStyleAttr: Int ) : super (context, attrs, defStyleAttr) {
40
- initAttributes(attrs!! )
40
+ constructor (context: Context , attrs: AttributeSet , defStyleAttr: Int ) : super (context, attrs, defStyleAttr) {
41
+ initAttributes(attrs)
42
+ initValues()
41
43
}
42
44
43
45
override fun initAttributes (attrs : AttributeSet ) {
@@ -56,7 +58,6 @@ class LShapeView : View, LoaderContract {
56
58
this .rectColor = typedArray.getColor(R .styleable.LShapeView_lShapeColor ,
57
59
resources.getColor(android.R .color.darker_gray))
58
60
typedArray.recycle()
59
- initValues()
60
61
}
61
62
62
63
private fun initValues () {
0 commit comments