robin
01/23/2019, 8:40 AMfun main(){val f="""fun main(){val f="%s"%s"%s";System.out.printf(f,'"',f,'"')}""";System.out.printf(f,'"',f,'"')}
Dalinar
01/23/2019, 9:05 AM::
prefix do in ::x.isInitialized
?diesieben07
01/23/2019, 9:05 AMKProperty
for x
.diesieben07
01/23/2019, 9:06 AMdomfox
11/18/2019, 12:20 PMkotlin-stdlib
from the mapdb
dependency, as this depends on 1.2.x which confuses things. Paying attention to compiler warnings pays off!Ashutosh Panda
11/19/2019, 4:48 PMerror: a type annotation is required on a value parameter
fun roll(number,operation:(Int)->Int):Int
^
Ashutosh Panda
11/19/2019, 4:49 PMAshutosh Panda
11/19/2019, 4:49 PMevan
11/19/2019, 9:02 PMBen Piatt
11/19/2019, 9:23 PMSamuel Michael
11/20/2019, 3:22 AMnwh
11/20/2019, 3:22 AMPablichjenkov
11/20/2019, 5:32 PMclass CustomLayout : RelativeLayout {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
private var mGlucoseState = GlucoseState.NONE
...
override fun onCreateDrawableState(extraSpace: Int): IntArray {
val drawableState = super.onCreateDrawableState(extraSpace + 7)
when (mGlucoseState) { // Crashing because mGlucoseState is null
GlucoseState.LOW -> View.mergeDrawableStates(
drawableState,
STATE_GLUCOSE_LOW
)
GlucoseState.DANGER_LOW -> View.mergeDrawableStates(
drawableState,
STATE_GLUCOSE_WARN_LOW
)
...
else -> View.mergeDrawableStates(
drawableState,
STATE_GLUCOSE_NONE
)
}
return drawableState
}
...
}
Pablichjenkov
11/20/2019, 5:34 PMonCreateDrawableState()
is called internally from the constructor and the process crashes with mGlucoseState
null. How is that possible?Marko Mitic
11/20/2019, 5:36 PMPablichjenkov
11/20/2019, 5:46 PMShawn
11/20/2019, 5:51 PMthis
is being sort of leaked by the superclass constructor calling onCreateDrawableState()
Marko Mitic
11/20/2019, 5:51 PMPablichjenkov
11/20/2019, 5:58 PMnullable?
but I think is a good catch up that should have IDE warning the least.
Thank u guys.user
11/21/2019, 1:25 PMHullaballoonatic
11/21/2019, 6:03 PMa.zip(b).toMap()
I accomplished this in my particular use-case involving enums, but that's because I have access to the ordinal
MyEnumClass.values().associate { it to myList[it.ordinal] }
John
11/21/2019, 10:11 PMMichał Kalinowski
11/21/2019, 11:44 PMuser
11/22/2019, 10:01 AMhttps://pbs.twimg.com/media/EJ-AbczUUAIM_Of.png▾
Yekta
11/22/2019, 12:10 PMreturn if (arrayList!![position] is Array<Line>)
RowType.LINE.ordinal
else
0
Android Studio gives me error: Cannot check for instance of erased type: Array<Line>Yekta
11/22/2019, 12:11 PM