https://kotlinlang.org
Join Slack
Hi, while trying to deserialize an array of data, I got an error when trying to deserialize an empty...
a

Ayfri

about 3 years ago
Hi, while trying to deserialize an array of data, I got an error when trying to deserialize an empty JSON array that was sent with
prettyPrint
, so
[

]
I get an error
io.ktor.serialization.JsonConvertException: Illegal input
, which doesn't occur when using only
kotlinx.serialization
a
a
  • 2
  • 2
  • 654
Is creating multiple Retrofit service instances okay? One per module; lets say 20 overall; given the...
u

ursus

over 5 years ago
Is creating multiple Retrofit service instances okay? One per module; lets say 20 overall; given the okhttp instance is shared? Or should I rather strive for a single big retrofit instance and have it extend some partial interfaces, so it then can get injected behind it?
u
s
o
  • 3
  • 5
  • 653
Does anyone know how to inject environment variables into a desktop application during build time? w...
b

Brian Estrada

over 1 year ago
Does anyone know how to inject environment variables into a desktop application during build time? we have some secrets we don't want to include in the GitHub repo because it's open source but we want them available in our binaries... does anyone have a good solution for this? 👀
👍 1
b
c
+5
  • 7
  • 18
  • 652
How can I disable clipping with `AnimatedVisibility`? A recent update to compose seems to have enabl...
r

rob42

over 1 year ago
How can I disable clipping with
AnimatedVisibility
? A recent update to compose seems to have enabled clipping each item that appears by default, which has caused a UI regression in my app. Docs suggest adding
.using(SizeTransform(clip = false))
to the transitionSpec, but AnimatedVisibility doesn't take a transitionSpec, and my animations are actually applied by a series of
Modifier.animateEnterExit(...)
on each item.
r
d
b
  • 3
  • 11
  • 651
What does this mean? ```TRACE i.k.s.p.c.ContentNegotiation - Skipping because the type is ignored.``...
c

CLOVIS

almost 3 years ago
What does this mean?
TRACE i.k.s.p.c.ContentNegotiation - Skipping because the type is ignored.
I'm using
testApplication
with just the
ContentNegotiation
plugin using KotlinX.Serialization The test fails with
400 Bad Request with no provided body
, and Ktor seems to log that it decided to ignore the body for some reason?
c
e
  • 2
  • 26
  • 651
In general should we prefer using simple try-catch pattern instead of `runCatching` in cases where w...
g

George

about 3 years ago
In general should we prefer using simple try-catch pattern instead of
runCatching
in cases where we care about only one type of exception or is this too much neatpicking? For example:
val result = runCatching { transaction() }
return result.getOrElse {
    if (it is IllegalArgumentException) return null else throw it
}
vs
return try {
    transaction()
} catch (e: IllegalArgumentException) {
    null
}
Thanks in advance for any answers !
g
p
+2
  • 4
  • 12
  • 651
I'm trying to create a `SnapLayoutInfoProvider` for a `ScrollState` (used by a `Pager` composable, w...
s

ste

about 3 years ago
I'm trying to create a
SnapLayoutInfoProvider
for a
ScrollState
(used by a
Pager
composable, where all the items have
fillMaxSize
), but I don't really get what
calculateSnappingOffsetBounds
is expected to return. I don't understand the doc either. I mean, shouldn't an offset be enough (i.e. the new `ScrollState`'s
value
)?
device-2022-10-20-175944.mp4
✅ 1
s
j
l
  • 3
  • 4
  • 649
Hello, I am using the In-App Update feature in Android (Immediate Update). We already have a method ...
s

Satyam G

over 3 years ago
Hello, I am using the In-App Update feature in Android (Immediate Update). We already have a method of
appUpdateManager.startUpdateFlowForResult(
    info,
    AppUpdateType.IMMEDIATE,
    parentActivity,
    MY_REQUEST_CODE
)
Which triggers the Immediate flow. If you observe here we are passing here the MY_REQUEST_CODE while triggering Update. Once the update is Finished, Cancel we get the callback in OnActivityResult based on that we can take decisions. But we already know onActivityResult is deprecated now and it is recommended to use the Activity Result Api which has a code like
var resultLauncher =
    registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
        if (result.resultCode == Activity.RESULT_OK) {
            // There are no request codes
            val data: Intent? = result.data
            inAppUpdate?.let {
                inAppUpdate?.onActivityResult(result.resultCode, data)
            }
        } else if (result.resultCode == AppCompatActivity.RESULT_CANCELED) {
            finish()
        }
    }
But How to get the request code in this case ??? Can anyone help here ?
😶 2
👋 1
s
l
+2
  • 4
  • 5
  • 648
anyone is using kover + sonarqube?
j

Javier

about 4 years ago
anyone is using kover + sonarqube?
j
m
m
  • 3
  • 2
  • 648
how can I get a reference to a view in jetpack compose?
m

mgrazianodecastro

about 3 years ago
how can I get a reference to a view in jetpack compose?
m
a
v
  • 3
  • 5
  • 647
Previous919293Next

kotlinlang

A modern programming language that makes developers happier.

Powered by