https://kotlinlang.org
Join Slack
I don't really understand how to read / write files in okio 3 multiplatform (specifically on ios). A...
m

Michal Klimczak

over 3 years ago
I don't really understand how to read / write files in okio 3 multiplatform (specifically on ios). All examples show how to do it using
FileSystem.SYSTEM
which is only available on `jvm` . It's like everything is there when you have
FileHandle
or
Sink
, but the first step is vague. Any hints?
m
m
s
  • 3
  • 18
  • 1143
If I convert a `Color` value to `Int` (using `toArgb()`) so I can save it in Datastore, how would I ...
n

Nat Strangerweather

about 3 years ago
If I convert a
Color
value to
Int
(using
toArgb()
) so I can save it in Datastore, how would I then convert the
Int
back to Jetpack Compose
Color
?
n
s
+2
  • 4
  • 7
  • 1141
how can I use kotlin-reflect to get all subclasses of an abstract base class? the base class is NOT ...
p

Peter Ertl

over 4 years ago
how can I use kotlin-reflect to get all subclasses of an abstract base class? the base class is NOT sealed
p
m
t
  • 3
  • 34
  • 1139
I'm trying to map enum to int values: ```@Serializable enum class ItemType { @SerialName("0") Ze...
p

Philip Dukhov

about 3 years ago
I'm trying to map enum to int values:
@Serializable
enum class ItemType {
    @SerialName("0") Zero,
    @SerialName("1") First,
}
But it fails with the following exception:
JsonDecodingException: Unexpected JSON token at offset 194: Expected quotation mark '"', but had '1' instead
    JSON input: ....."type":1,.....
It doesn't seem to work because
SerialName
is expecting a string and json has an int. I can think of two ways to solve this: 1. Enabling lenient mode - I don't like this solution as it also removes restrictions from other fields, which I prefer to keep 2. Implementing a custom serializer - seems like too much of boilerplate code for such a simple task Am I missing something?
p
a
  • 2
  • 7
  • 1129
How can I call child composable function in parent composable function?
c

chanjungskim

over 2 years ago
How can I call child composable function in parent composable function?
c
p
  • 2
  • 10
  • 1125
Is there a notion of priority with coroutines? I'd like to do some job in background but I'd like it...
d

dekans

about 7 years ago
Is there a notion of priority with coroutines? I'd like to do some job in background but I'd like it to be executed ASAP, before other queued & less important jobs
d
p
+3
  • 5
  • 31
  • 1125
Hello, I get this error. What is the reason? " error: @Binds methods' parameter type must be assign...
h

Hovhannes

almost 4 years ago
Hello, I get this error. What is the reason? " error: @Binds methods' parameter type must be assignable to the return type public abstract com.example.data.network.AuthApi " in AppModule
@Module
@InstallIn(SingletonComponent::class)
abstract class AppModule {


    companion object {
        @Singleton
        @Provides
        fun provideRemoteDataSource(): RemoteDataSource {
            return RemoteDataSource()
        }



        @Singleton
        @Provides
        fun provideUserApi(
            remoteDataSource: RemoteDataSource,
      
        ): UserApi {
            return remoteDataSource.buildTokenApi()
        }

        @Provides
        fun provideAuthRepository(authApi: AuthApi): AuthRepository {
            return AuthRepository(authApi)
        }


        @Provides
        fun provideUserRepository(userApi: UserApi): UserRepository {
            return UserRepository(userApi)
        }
    }



        @Binds
        @Singleton
        abstract fun bindsRemoteDataSource(authRepository: AuthRepository): AuthApi
}
class AuthRepository @Inject constructor(private val api: AuthApi) : BaseRepository(api) {....}
h
a
  • 2
  • 8
  • 1124
What is this error mean? ```Unresolved reference: implementation``` My build.gradle.kts file <https:...
m

MisileLab

almost 4 years ago
What is this error mean?
Unresolved reference: implementation
My build.gradle.kts file https://pastebin.com/EAcCPBff
m
r
n
  • 3
  • 6
  • 1118
I'm trying to use kapt in my project and it is working well when I compile manually using maven. How...
d

David Kubecka

over 2 years ago
I'm trying to use kapt in my project and it is working well when I compile manually using maven. However, the Intellij IDEA integrated builder has trouble when compiling the generated sources. I've filed a bug to IDEA directly as I think the issue might be there (there's a simple reproducer project if anyone would be glad to look at it). To understand the issue more, I would like to know the reasoning behind and perhaps more details of this Maven/Kotlin guide that I followed. I noticed that when I don't "disable" the
maven-compiler-plugin
I get the same error during manual maven compilation ("package does not exist") as I get in IDEA when the pom is set up correctly. Can anyone shed more light into this issue?
d
a
  • 2
  • 17
  • 1113
Hi all. How to convert iOS UIImage to Compose ImageBitmap in Compose Multiplatform? Can anyone help ...
j

Javokhir Savriev

about 2 years ago
Hi all. How to convert iOS UIImage to Compose ImageBitmap in Compose Multiplatform? Can anyone help me?
j
d
  • 2
  • 4
  • 1112
Previous293031Next

kotlinlang

A modern programming language that makes developers happier.

Powered by