https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
squarelibraries
  • l

    leodeleon

    02/16/2020, 9:06 AM
    @Zach Klippenstein (he/him) [MOD] I've been testing the workflow samples and I can't wrap my head around one thing. I see that the screen types can be used as the rendering of a workflow, and that the lib provides (and we can create) different types of screens to be interpreted differently by the api (e.g.
    BackstackScreen
    ) Is there a way to abstract this concept when modelling the renderings. When do I know I can/need to create a different screen rendering type, and how should I go about it in a way that exposes itself to Android later? Examples are
    PanelContainerScreen
    and
    ScrimContainerScreen
    . https://github.com/square/workflow/tree/4172907790c30385c8b57b5f3009351ff4d50cc8/kotlin/samples/containers/common/src/main/java/com/squareup/sample/container/panel In other words, how should one model rendering types and how to make sense of it in the context of a workflow?
    z
    • 2
    • 1
  • d

    dave08

    03/02/2020, 2:25 PM
    Oh... the subheader is missing in the json... I assumed that by giving a default value it would use that when it's missing. I guess not... is this by design?
    v
    z
    • 3
    • 6
  • m

    myanmarking

    03/04/2020, 1:50 PM
    ok. I'v tried that and apparently it works as planned. Gona be tracking that issue. Thanks!
    l
    • 2
    • 2
  • v

    vinay

    03/04/2020, 8:56 PM
    How do you expose activity/view lifecycles to square/workflow? I was thinking of passing it in as a prop, or did I miss some out of the box way of doing this? (Couldn't find an example in the samples) @Zach Klippenstein (he/him) [MOD] @Ray Ryan
    r
    z
    • 3
    • 32
  • c

    Colton Idle

    03/05/2020, 4:26 PM
    Dagger noob question. I find myself always hitting a case where I see a provides method written by a teammate and I try to find where it's actually being provided. Is there a way to easily find where that's being used? I always find myself wanting something like the Otto IntelliJ Plugin, but for Dagger.
    z
    t
    j
    • 4
    • 16
  • d

    Dariusz Kuc

    03/08/2020, 4:06 AM
    [kotlinpoet] hello, anyone knows whether it is possible to generate enum value with annotation using kotlinpoet?
    ✅ 1
    • 1
    • 3
  • j

    jw

    03/10/2020, 2:42 AM
    and if you've defined the endpoint as
    suspend fun(): BodyType
    you may also get HttpException
    b
    • 2
    • 1
  • c

    coletz

    03/13/2020, 5:12 PM
    Hi everyone, I am having an issue with sqldelight (mpp). On android everything works fine, on iOS I have this error:
    near "transaction": syntax error in "CREATE TABLE IF NOT EXISTS transaction (
        id TEXT PRIMARY KEY NOT NULL,
        organizationId TEXT NOT NULL,
        origin_wallet_id TEXT,
        destination_wallet_id TEXT NOT NULL,
        amount INTEGER NOT NULL,
        currency_date TEXT NOT NULL,
        acknowledge_date TEXT,
        acknowledge_message TEXT,
        user_message TEXT,
        competence_id TEXT
    )"
    attempted to run migration and failed. closing connection.
    is there something wrong in the query? maybe something not supported on iOS? Everything seems fine to me...
    j
    • 2
    • 5
  • d

    Dariusz Kuc

    03/16/2020, 7:44 PM
    [kotlinpoet] hello! I’m trying to annotate my class with nested interface but I’m having trouble with it -> trying to create following Jackson annotations
    @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "__typename")
    @JsonSubTypes(value = [
        Type(value = Car::class, name = "Car"),
        Type(value = Plane::class, name = "Plane")])
    interface Vehicle {
    e
    • 2
    • 9
  • l

    louiscad

    03/18/2020, 9:43 AM
    Hi, is there a way to encrypt a SqlDelight database? I'm looking for Android support mainly although I'm also interested in support on Kotlin/Native.
    m
    j
    • 3
    • 6
  • l

    locke

    03/18/2020, 10:48 PM
    Does anyone in here have a decent resource to figure out how to model master/detail flows in Workflow? I haven't found anything in the Github/Readme/Resources section, and figure it's slightly too complex for someone to explain over Slack.
    r
    z
    • 3
    • 6
  • z

    Zach Klippenstein (he/him) [MOD]

    03/20/2020, 6:14 PM
    Retrofit question: Why is there
    Call<T>.await()
    and
    Call<T?>.await()
    for converted responses, but for
    Response
    there’s only
    Call<T>.awaitResponse()
    ? I don’t see any reason it couldn’t be implemented, was it just left out unintentionally? Or for that matter, does
    T
    even need to have a non-nullable upper bound for
    awaitResponse
    ?
    j
    • 2
    • 2
  • b

    Brendan Weinstein

    03/21/2020, 4:02 AM
    Using retrofit and a converter as below, does deserialization happen on a background thread by default? I am trying to figure out if specifying Dispatchers.IO is an unnecessary context switch.
    interface Service { 
      @GET("/food")
      suspend fun getFood(): Food
    }
    
    val food = withContext(<http://Dispatchers.IO|Dispatchers.IO>) { service.getFood() }
    
    OR 
    
    val food = service.getFood()
    j
    • 2
    • 1
  • v

    vinay

    03/23/2020, 3:44 PM
    Can you set transition animations on
    WorkflowLayout
    or do you combine layout runners when you need to do transitions between them?
    r
    s
    • 3
    • 11
  • t

    Tolriq

    03/30/2020, 6:53 AM
    Is there something going on with Moshi? I was waiting for some Zac merges to finally be able to use incremental and he closed everything 😞
    z
    • 2
    • 2
  • g

    grahamborland

    04/01/2020, 8:53 AM
    Anyone got examples of using Workflow to render and trigger actions from an Android action bar menu item? Feels like I want my
    LayoutRunner
    to be an inner class of the Activity so it can access
    invalidateOptionsMenu()
    and
    onOptionsItemSelected()
    but in looking through the samples I didn’t see anything like this. Any pointers? If my
    Rendering
    includes fields to be rendered in a normal view and fields to toggle an action bar menu item, how should I approach that?
    z
    • 2
    • 3
  • d

    Dominaezzz

    04/04/2020, 7:29 PM
    How do I get kotlinpoet to use
    trimIndent()
    instead of
    trimMargin()
    for multiline strings?
    // language=json
    val json = """
        |{
        |    "type": "m.key.verification.start",
        |    "content": {
        |        "from_device": "BobDevice1",
        |        "transaction_id": "S0meUniqueAndOpaqueString",
        |        "method": "m.sas.v1"
        |    }
        |}
        """.trimMargin()
    The margins here break the language injection feature.
    z
    • 2
    • 3
  • m

    manueldidonna

    04/07/2020, 1:14 AM
    I'm using sqldelight on Android. I have exported the db. How can I import it and restart the app? Can someone help me? I found nothing useful on stackoverflow, but maybe I'm looking for the wrong thing
    y
    • 2
    • 1
  • j

    jw

    04/10/2020, 2:24 PM
    Registering a JsonAdapter directly should only be used for the most trivial adapters. Otherwise you probably want to prefer using `@ToJson`/`@FromJson` or
    JsonAdapter.Factory
    s
    • 2
    • 4
  • b

    Brendan Weinstein

    04/10/2020, 3:50 PM
    Scratching my head on this one. I am able to build fine from the command line, but intellij is giving this "duplicate content roots" error message related to sqldelight codegen
    [/Users/mountainhare/basebeta/basebeta-monorepo/common/build/generated/sqldelight/code/KExitDatabase] of module [basebeta-monorepo.common.iosMain] was removed from modules [basebeta-monorepo.common.iosArm32Main, basebeta-monorepo.common.iosArm64Main, basebeta-monorepo.common.iosX64Main, basebeta-monorepo.common.jvmMain, basebeta-monorepo.common.commonMain, basebeta-monorepo.common.mobileMain]
    • 1
    • 1
  • c

    coletz

    04/11/2020, 12:45 PM
    Hi guys, question on sqldelight. Is it possible to automatically drop db if migrations are required? Would be very useful for development (I was used to do it on realm and I've seen something similar exists on Room - fallbackToDestructiveMigration)
    🇳🇴 1
    y
    • 2
    • 1
  • d

    Dominaezzz

    04/20/2020, 7:18 PM
    Does SQDelight do syntax highlighting and auto-complete itself or does it delegated to the IDE?
    e
    s
    • 3
    • 9
  • d

    danny

    04/21/2020, 5:10 PM
    Careful upgrading to the latest OpenJDK release if you’re using OkHttp 3. The methods that the JDK 9 platform detection used now exist in 8 and cause runtime failures Actually, it looks like OkHttp 3.x works fine, it’s our Java 8 SslSocket wrapper that was causing the call to fall through and break. OkHttp 4 will need work to support ALPN on OpenJDK 8u252 and later though
    • 1
    • 1
  • j

    jw

    04/22/2020, 3:56 AM
    Can you file an issue? Versioned support for sqlite is slowly materializing. It just requires a bit of work.
    e
    • 2
    • 2
  • a

    alec

    04/22/2020, 1:09 PM
    also prs welcome!!!!! upsert came as an external contribution so im now convinced the sql psi codebase isnt impossible to contribute to
    e
    • 2
    • 1
  • b

    basher

    04/22/2020, 3:49 PM
    any recommendations for resources to read/learn about PSI?
    a
    • 2
    • 2
  • b

    basher

    04/22/2020, 3:52 PM
    also sort of related, i'd like to learn more about tools that can be used to parse kotlin code independent of platform (i.e. doesn't rely on Kotlin being built for JVM), if anyone has recommendations there as well
    d
    • 2
    • 2
  • j

    jw

    04/24/2020, 4:36 PM
    generally we want to make it slightly inconvenient to do this to discourage people doing something like
    OkHttpClient().use { makeOneHttpRequest(it) }
    p
    • 2
    • 2
  • c

    Colton Idle

    04/29/2020, 9:09 AM
    @dave08 IIRC from Jesse I heard that Authenticator is basically a subset of an interceptor and so you're better off just using an interceptor instead of the authenticator apis since they are limiting. If any of the JW are around I'm sure they can give a better answer. 😄
    d
    j
    • 3
    • 5
  • s

    saket

    04/29/2020, 10:36 PM
    you’ll need to manually link sqlite3 with your project
    k
    • 2
    • 3
Powered by Linen
Title
s

saket

04/29/2020, 10:36 PM
you’ll need to manually link sqlite3 with your project
k

Kris Wong

04/29/2020, 10:48 PM
thank you. would be nice to mention that on the multiplatform or iOS pages on the website
s

saket

04/29/2020, 10:50 PM
Yes, that’s the plan. We’re working on improved docs for multiplatform usage.
you can follow the sample app in the meantime
🍻 1
View count: 1