https://kotlinlang.org
Join Slack
Exposed supports Jsonb types with postgres database?
w

Wishnuprathikantam

over 4 years ago
Exposed supports Jsonb types with postgres database?
w
j
  • 2
  • 2
  • 1387
Using the new `BasicTextField2` API, when listening to its changes through its `textAsFlow()`, is th...
s

sindrenm

over 1 year ago
Using the new
BasicTextField2
API, when listening to its changes through its
textAsFlow()
, is there a way to know if a text was added programmatically through
edit {}
vs. manually from a user? I'm thinking something like this, but due to the asynchronous nature of it all, that doesn't quite cut it:
val textFieldState = TextFieldState("")
var isSettingProgrammatically = false

launch {
  textFieldState.textAsFlow()
    .dropWhile { isSettingProgrammatically }
    .collect { println("change: $it") }
}

launch {
  delay(2.seconds)

  isSettingProgrammatically = true
  textFieldState.edit { replace(0, length, "value" }
  isSettingProgrammatically = false
}
where the
"value"
from the second
launch
should not be printed from the text flow collection.
s
s
+2
  • 4
  • 45
  • 1384
When working with SQLDelight migrations, I have set up migration to execute using the following code...
h

Håkon Pettersen

about 2 years ago
When working with SQLDelight migrations, I have set up migration to execute using the following code:
Database.Schema.migrate(
    driver = driver,
    oldVersion = 0,
    newVersion = Database.Schema.version,
)
I assume that this won't work if the user is currently on version 2, and I am trying to migrate to version 3. I assume that I have to check which version of the database the user is currently on and only execute migration if it is lower than the latest version. If that's the case, how can I check the current database-verison that the user is on? (Also, If this is the wrong way to handle migrations, please elaborate).
h
m
+2
  • 4
  • 13
  • 1379
Does anyone know why the Kotlin compiler does not work with JDK 20, even with the Maven extension in...
g

Gavin Ray

over 2 years ago
Does anyone know why the Kotlin compiler does not work with JDK 20, even with the Maven extension instead of Gradle? 🤔
g
s
  • 2
  • 4
  • 1372
Hi :wave: I've been trying to add GoogleMaps to my KMP (Android/iOS) project and it's been a strugg...
m

Mantas Latkauskas

over 1 year ago
Hi 👋 I've been trying to add GoogleMaps to my KMP (Android/iOS) project and it's been a struggle. I have expected/actual implementations for the map. Android works fine, but I've been trying to add iOS Pod for three days with no success. I've somewhat been following this project https://github.com/realityexpander/FredsRoadtripStoryteller (I can build it fine). I've tried clear caches, pod deintegrate/install many times 😄 The error I'm getting is :
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors
ld: framework 'GoogleMaps' not found
I can build the iOS project until I add
pod("GoogleMaps") {
            version = "8.3.1"
            extraOpts += listOf("-compiler-option", "-fmodules")
}
in my build.gradle.kts (:composeApp) cocoapods {...} block to access
import cocoapods.GoogleMaps...
in my iosMain directory.
🧵 2
m
i
+4
  • 6
  • 15
  • 1371
How to get the screen size when in edge-to-edge mode? I just figured out that LocalContext.current.r...
t

Timo Drick

over 1 year ago
How to get the screen size when in edge-to-edge mode? I just figured out that LocalContext.current.resources.displayMetrics only returns widht and height excluding insets And also: LocalConfiguration.current.screenWidthDp do not include the insets.
t
a
+4
  • 6
  • 40
  • 1371
Is there an way to mock a function that receives a callback as parameter? For example, assuming that...
i

igorvd

about 6 years ago
Is there an way to mock a function that receives a callback as parameter? For example, assuming that I have an assync operation, and the way to get the result is using an interface as callback. I want to unit test this method, defining responses in this callback. The problem lies in the fact that the callback is declared as anonymous (I will put an example below). Is possible to mock this callback and define its responses using MockK? Here is an example:
class ViewModel {

	fun loadSomeStuff() {
		myObject.asyncOperation(object : Callback {
			//callback methods implementation
		})
	}
}
I know if I change the callback for a parameter in my class, it will be easily mocked. But, in my opinion it doesn't make sense, because it's related to the operation I need in the method. (This example is just for learning purposes, I was trying to teach a colleague about unit tests, and I got stocked in this scenario)
i
h
  • 2
  • 4
  • 1370
Is there any chart library available for compose multiplatform?
j

jamshedalamqaderi

almost 2 years ago
Is there any chart library available for compose multiplatform?
j
p
m
  • 3
  • 5
  • 1369
is there something like `clipToPadding = false` in Compose that avoids a LazyRow getting cut off by ...
f

Florian

almost 4 years ago
is there something like
clipToPadding = false
in Compose that avoids a LazyRow getting cut off by the container's padding?
f
s
c
  • 3
  • 5
  • 1367
My multiplatform backend project stopped compiling for the MacOS targets. Fails with ```e: Could not...
r

ribesg

over 2 years ago
My multiplatform backend project stopped compiling for the MacOS targets. Fails with
e: Could not find "org.jetbrains.kotlin.native.platform.CoreFoundationBase" in [/Users/ribesg/Projects/Inboxbooster-Mailer/HttpReceiver, /Users/ribesg/.konan/klib, /Users/ribesg/.konan/kotlin-native-prebuilt-macos-aarch64-1.7.22/klib/common, /Users/ribesg/.konan/kotlin-native-prebuilt-macos-aarch64-1.7.22/klib/platform/macos_arm64]
during
compileKotlinMacosArm64
and
compileKotlinMacosX64
. It worked before, it appeared when I added a dependency on
com.squareup.okio:okio:3.3.0
, but the problem is that I don't understand the error. It's open source so you can try for yourself here https://github.com/wizbii/Inboxbooster-Mailer/tree/feature/kotlin-receiver/HttpReceiver ✅ Was caused by Okio 3.3.0 being built for Kotlin 1.8 while I am using 1.7.22.
r
  • 1
  • 2
  • 1365
Previous192021Next

kotlinlang

A modern programming language that makes developers happier.

Powered by