https://kotlinlang.org
Join Slack
I need to get context in view model , I am trying to get using localcontext but it is keep giving er...
j

Jitendra

over 3 years ago
I need to get context in view model , I am trying to get using localcontext but it is keep giving error @composable invocation can only happen from the context of composable function, what is the best way to get context/activity instance in viewsmodel
j
f
+2
  • 4
  • 3
  • 5020
What is the better way to mock date using mockk?
r

Recca Chao

about 4 years ago
What is the better way to mock date using mockk?
r
e
+2
  • 4
  • 18
  • 4846
I need to render Markdown in Compose (on Android). Does anyone have any recommendation for a library...
m

Marcin Wisniowski

over 2 years ago
I need to render Markdown in Compose (on Android). Does anyone have any recommendation for a library or solution? I'm currently considering this library: https://github.com/jeziellago/compose-markdown Or using this JetBrains library for parsing the Markdown: https://github.com/JetBrains/markdown and writing the Compose code myself to render the parsed text. Does anyone have any insight?
m
o
+4
  • 6
  • 14
  • 4632
How can I remove this padding from the Outlined Text Field that is reserved to the label if I dont w...
a

André Thiele

over 4 years ago
How can I remove this padding from the Outlined Text Field that is reserved to the label if I dont want to show a label? Or should I wrap it and clip its contents?
a
c
n
  • 3
  • 13
  • 4563
hello guys, is anyone having this Issue? ```java.lang.IllegalAccessError: class org.jetbrains.kotlin...
m

magnumrocha

about 4 years ago
hello guys, is anyone having this Issue?
java.lang.IllegalAccessError: class org.jetbrains.kotlin.kapt3.base.KaptContext (in unnamed module @0x50148e28) cannot access class com.sun.tools.javac.util.Context (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.util to unnamed module @0x50148e28
I am having this after update gradle to version 7.2…
youtrack 1
m
z
p
  • 3
  • 18
  • 4532
I want to achieve a “dynamic” height LazyVerticalGrid meaning the height of one item in the row dete...
i

iroyo

about 3 years ago
I want to achieve a “dynamic” height LazyVerticalGrid meaning the height of one item in the row determines the height of the rest to avoid the effect of the image. The only “clean” way is to ditch the Grid and make a LazyColumn with a Row as each item?!! I know the other option would be to hard code the same height for every item in the grid, but that would produce (maybe) an unwanted space between rows. The code to produce the example is simple but it’s added in the thread
❤️ 1
i
r
  • 2
  • 10
  • 4266
Is anyone here familiar with the Open Telemetry Kotlin implementation: <https://github.com/open-tele...
j

james

over 3 years ago
Is anyone here familiar with the Open Telemetry Kotlin implementation: https://github.com/open-telemetry/opentelemetry-java/tree/main/extensions/kotlin. I'm trying to find the bit that allows the Span to propogate context across coroutines from a non-suspendable function:
runBlocking {
        val error = IllegalAccessException("Bad things are happening!")
        val message = "Isn't it a nice day"
        Span.current()?.let { span ->
            val attributes = Attributes.builder().apply {
                message?.let { put("error_message", it) }
            }
                .build()

            span.setStatus(StatusCode.ERROR)
            span.recordException(throwable, attributes)
        }
        
        launch { 
            // This will cause the spans to get linked together and then sync metadata from the above. 
            @WithSpan
            suspendFunction()
        }
    }
The reason i'm asking is that i'm trying to understand some strange behavior in our system where the context doesn't always propagate from a parent to child correctly.
j
e
+2
  • 4
  • 10
  • 4211
When is the `init { }` block in a ViewModel called? The init block for Screen A's ViewModel doesn't ...
v

v79

about 3 years ago
When is the
init { }
block in a ViewModel called? The init block for Screen A's ViewModel doesn't seem to be triggered when swiping back from Screen B, for instance.
v
y
+3
  • 5
  • 26
  • 4182
Hi! How can I detect if Composable element is visible on the screen or vice versa, without too much ...
v

Valentin Gusselnikov

over 3 years ago
Hi! How can I detect if Composable element is visible on the screen or vice versa, without too much calculations? I want to hide the top
Image
if the
Button
(which is placed at the end) is not visible and user have to scroll for it. Root Composable is
ConstraintLayout
🙏 1
v
  • 1
  • 1
  • 4151
What's the correct way of rendering html string in compose? Something very similar to `HtmlCompat.fr...
r

ritesh

about 4 years ago
What's the correct way of rendering html string in compose? Something very similar to
HtmlCompat.fromHtml()
in textView.
👀 1
r
s
z
  • 3
  • 9
  • 4118
Previous123Next

kotlinlang

A modern programming language that makes developers happier.

Powered by