코트린의 제너릭에 대해 공부하고 있는데... 도저히 in, out 키워드가 이해가 되지 않는다!!!! in T, out T 키워드가 보이실텐데요. 자바에서의 ? super T, ? extends T는 코틀린에서 각각 in T, out T로 사용된다고 보면 됩니다. in T타입인 파라메터는 값을 쓸수 있는 반면 out T는 쓸수는 없고 읽을수만 있습니다. (https://softwaree.tistory.com/47) 라는데... 아니 이론은 알겠는데 ㅜㅜㅜㅜㅜ 도저히 저 속이 이해가 안된다.. 대체 왜... 어떤 원리로.... 언젠간 알게 되겠지 ㅠ
Jetpack Compose에서 ConstraintLayout을 사용할 때 .constrainAs(events) { top.linkTo(parent.top) bottom.linkTo(bottomBar.top) height = Dimension.fillToConstraints } 위 코드처럼 height에 제약을 줬다면 height = Dimension.fillToConstraints 이런식으로 또 높이 설정을 해줘야 정상작동 한다. width도 마찬가지.
https://developer.android.com/jetpack/compose/layouts/constraintlayout ConstraintLayout in Compose | Jetpack Compose | Android Developers ConstraintLayout can help place composables relative to others on the screen, and is an alternative to using multiple nested Row, Column, Box and custom layout elements. ConstraintLayout is useful when implementing larger layouts with more complicated alig dev..
코루틴을 공부하다가 의문점이 생겼다. https://medium.com/harrythegreat/kotlin-retrofit%EC%97%90-flow%EC%99%80-callbackflow-%EC%A0%81%EC%9A%A9%ED%95%98%EA%B8%B0-f7797db754c6 [Kotlin] Retrofit에 Flow와 CallbackFlow 적용하기 본 예제는 Okhttp와 Retrofit에 대한 튜토리얼 내용은 설명하지 않습니다. medium.com 해리님의 코드를 보면 이렇게 짜여져 있고, awaitClose()가 close가 호출될때까지 기다린다고 돼있다. if (response.isSuccessful) { response.body()!!.let { offer(it) } } 하지만 이 코드가 실..
.pointerInput(Unit) { detectDragGestures { change, dragAmount -> change.consumeAllChanges() val (x, y) = dragAmount when { x > 0 -> { /* right */ println("right") } x { /* left */ println("left") } } when { y > 0 -> { /* down */ bottomSheetVisible.value = false println("down") } y { /* up */ println("up") } } } } 다음과 같은 코드를 Modifier에 등록해주면 된다. https://stackoverflow.com/a/66998079/1..