Skip to content

Commit a7d30b1

Browse files
committed
corrected view
1 parent 07a0608 commit a7d30b1

File tree

1 file changed

+9
-8
lines changed
  • squareloaderspack/src/main/java/com/agrawalsuneet/squareloaderspack/basicviews

1 file changed

+9
-8
lines changed

squareloaderspack/src/main/java/com/agrawalsuneet/squareloaderspack/basicviews/LShapeView.kt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ import com.agrawalsuneet.squareloaderspack.R
99

1010
class LShapeView : View, LoaderContract {
1111

12-
1312
var baseRectWidth: Int = 400
1413
var baseRectHeight: Int = 100
1514

1615
var verticalRectWidth: Int = 100
1716
var verticalRectHeight: Int = 400
1817

19-
2018
private var rectColor: Int = resources.getColor(android.R.color.darker_gray)
2119
private lateinit var rectPaint: Paint
2220

23-
constructor(context: Context) : super(context)
21+
constructor(context: Context) : super(context){
22+
initValues()
23+
}
2424

2525
constructor(context: Context, baseRectWidth: Int, baseRectHeight: Int,
2626
verticalRectWidth: Int, verticalRectHeight: Int, color: Int) : super(context) {
@@ -32,12 +32,14 @@ class LShapeView : View, LoaderContract {
3232
initValues()
3333
}
3434

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()
3738
}
3839

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()
4143
}
4244

4345
override fun initAttributes(attrs: AttributeSet) {
@@ -56,7 +58,6 @@ class LShapeView : View, LoaderContract {
5658
this.rectColor = typedArray.getColor(R.styleable.LShapeView_lShapeColor,
5759
resources.getColor(android.R.color.darker_gray))
5860
typedArray.recycle()
59-
initValues()
6061
}
6162

6263
private fun initValues() {

0 commit comments

Comments
 (0)