https://kotlinlang.org
Join Slack
Hi everyone, i am building a kotlin multiplatform library, i am at a point where i need to use di to...
s

Simon Buechner

almost 2 years ago
Hi everyone, i am building a kotlin multiplatform library, i am at a point where i need to use di to keep the tests maintainable. I already read about koin but it seems it is not designed for using it only in the shared module. Is there a good way to do di in the shared module, like injecting object classes as singleton to other classes that use this singleton? Or are there any guides that describe how to use koin only in shared, without initializing it in the app itself?
s
p
+2
  • 4
  • 10
  • 350
Trying to setup koin annotations in a multi module KMP project, but facing some difficulty. Does any...
c

Ciaran Sloan

about 2 years ago
Trying to setup koin annotations in a multi module KMP project, but facing some difficulty. Does anyone know of any sample projects around that demonstrate the implementation?
c
j
+2
  • 4
  • 28
  • 350
Hi I wanted to use Kotlin for backend services. There are bunch of frameworks for server side. Most ...
n

Navkrishna

almost 3 years ago
Hi I wanted to use Kotlin for backend services. There are bunch of frameworks for server side. Most famous ones are Springboot, spring and Ktor. My server would be mostly IO bound. Also, another concern is currently my org uses REST but we might switch to GRPC later. I want something which might require minimal effort If I change the transport layer.
n
r
+7
  • 9
  • 19
  • 350
Just made `koinNavGraphViewModel()` function to scope a ViewModel to a given Nav Graph
a

arnaud.giuliani

about 4 years ago
Just made
koinNavGraphViewModel()
function to scope a ViewModel to a given Nav Graph
a
n
  • 2
  • 31
  • 350
What's the best way to know the scroll direction of a LazyColumn? I'm currently using a LazyListSta...
d

Dylan

over 4 years ago
What's the best way to know the scroll direction of a LazyColumn? I'm currently using a LazyListState, and by keeping a reference of the last value of
firstVisibleItemScrollOffset
from LazyListState, I can compare it to the current value so if
lastOffset
is lower than
firstVisibleItemScrollOffset
, that means the user is scrolling down, however if
lastOffset
is higher than
firstVisibleItemScrollOffset
, that means the user is scrolling up. At least that's the result I was hoping for but unfortunately
firstVisibleItemScrollOffset
is often equal to
lastOffset
. So what is the best way to know the scroll direction of a LazyColumn? 🤔 (What I would like to achieve is similar to what we used to do with the XML Toolbar View using app:layout_scrollFlags)
d
j
+2
  • 4
  • 4
  • 350
Anyone experienced with http4k? I'm trying to add routes with documentation but for somereason the r...
r

roby

over 2 years ago
Anyone experienced with http4k? I'm trying to add routes with documentation but for somereason the routes are not getting registered?
kt
    val contract = contract {
        renderer = OpenApi3(ApiInfo("Tasks API", "v0.1.0"), Argo)
        descriptionPath = "/docs"

        routes += UserRouter(userService).routes // these dont work
        routes += "/ping" bindContract Method.GET to { _ -> Response(Status.OK).body("pong") } // this works
    }

    val handler = routes("/api" bind contract)
    handler.asServer(Jetty(port)).start() ..

//....

class UserRouter(private val services: UserService) {

    val routes: List<ContractRoute> = listOf(
                "/users/{id}" meta {
            summary = "Get user details"
            returning(
                Status.BAD_REQUEST to "Invalid id",
                Status.NOT_FOUND to "User not found"
            )
        } bindContract GET to ::getUser,
r
a
  • 2
  • 18
  • 349
Is there a `BiMap` (bidirectional hashmap)?
l

Lukasz Kalnik

almost 3 years ago
Is there a
BiMap
(bidirectional hashmap)?
l
h
  • 2
  • 2
  • 349
Is there a way to properly clip an `AnimatedVisibility` ? Clipping passed to the `AnimatedVisibility...
t

Tolriq

about 3 years ago
Is there a way to properly clip an
AnimatedVisibility
? Clipping passed to the
AnimatedVisibility
modifier is not working and the animation runs with a square
.clip(CircleShape)
t
o
d
  • 3
  • 9
  • 349
I want to utilize `Activity#addOnNewIntentListener()` within Compose. It works fine in general. Howe...
j

jannis

over 3 years ago
I want to utilize
Activity#addOnNewIntentListener()
within Compose. It works fine in general. However it's registered too later after a process death occurred. Code in 🧵
j
a
  • 2
  • 2
  • 349
What is best practice in terms of multiple classes in a single file? For example if I have an interf...
h

hates

almost 7 years ago
What is best practice in terms of multiple classes in a single file? For example if I have an interface and a (currently) single implementation, I like the idea of keeping them together in a single file, but then sometimes feel I should do how I would in Java and split it into two.
h
e
  • 2
  • 2
  • 349
Previous197198199Next

kotlinlang

A modern programming language that makes developers happier.

Powered by