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
android
  • p

    Paul Woitaschek

    05/02/2019, 2:19 PM
    I want to create a small task (60 minutes) to evaluate a candidate's code skills. How would you design such a test?
    w
    d
    • 3
    • 5
  • t

    tevjef

    05/02/2019, 3:42 PM
    With the changes made to kapt in 1.3.31, kotlin does some aggressive caching to decrease incremental built times. Unfortunately, some annotation processors and kapt don’t work well together and the cache is not properly invalidated in some conditions. - Deleted classes with
    @Inject
    may still have code generated for them. - Moved classes with
    @Inject
    may still have code generated in the old location. This behavior is enabled by default in Kotlin 1.3.31. Is there something I need to configure kapt to ensure the cache is properly invalidated? This is causing some issues for my team, especially when we switch between branches. Thank you! I’ve beed getting sub 1 min incrementally builds for the first time in months.
    g
    • 2
    • 3
  • i

    iex

    05/02/2019, 11:54 PM
    this isn't working
    -assumenosideeffects class mypackage.Log {
        public static void v(...);
        public static void d(...);
        public static void i(...);
    }
    and can't apparently get kotlin syntax working
    k
    a
    • 3
    • 4
  • s

    Schadenfreude

    05/03/2019, 8:57 AM
    Hey all! I have this drawable:
    <layer-list xmlns:android="<http://schemas.android.com/apk/res/android>">
        <item>
            <shape android:shape="oval">
                <solid android:color="@color/black"/>
            </shape>
        </item>
        <item
                android:drawable="@drawable/btn_pen"
                android:bottom="20dp"
                android:left="20dp"
                android:right="20dp"
                android:top="20dp"/>
    </layer-list>
    And I want to programatically change the color of the oval shape, is there any way to do that (so far I’ve not found anything useful via Google searches)?
    :stackoverflow: 3
    :google: 3
    l
    • 2
    • 2
  • s

    Shan

    05/03/2019, 8:03 PM
    Does anyone know of any books that are for experienced Kotlin developers who are learning Android? Like, not learning Kotlin through Android, but the other way around? Or does that not exist? Looking for any other resources to flesh out my Android knowledge as well, if anyone has any to share 🙂
    f
    j
    +7
    • 10
    • 19
  • m

    Marc Knaup

    05/04/2019, 2:53 PM
    Hey guys, did anyone have that one before? Google doesn't yield any useful result. I can't get the initial Gradle sync working.
    New Gradle Sync is not supported due to containing Kotlin modules using an unsupported plugin version
    https://scans.gradle.com/s/x2sugy65vmttq#failure Gradle 5.1.1/5.3.1/5.4.1, Kotlin 1.3.21/1.3.31, Kotlin IDEA Plugin 1.3.31, Android Studio 3.4 I've tried different Gradle and Kotlin versions and different ways of loading Kotlin/Android gradle plugins without success. EDIT: wow, Android Studio 3.5 Canary: New Gradle Sync is not supported due to containing buildSrc module
    d
    l
    • 3
    • 4
  • d

    dewildte

    05/04/2019, 6:34 PM
    I am thinking about turning
    View
    clicks into
    Flow<T>
    , has anyone done this? What approach did you take? If you think it's a bad idea, why?
    l
    p
    d
    • 4
    • 40
  • b

    basher

    05/05/2019, 3:59 PM
    Is anyone aware of an open source project of a class that wraps a java.sql.Connection and implements SupportSqliteDatabase (or related AndroidX interfaces)?
    c
    • 2
    • 3
  • s

    Slackbot

    05/06/2019, 8:15 AM
    This message was deleted.
    k
    d
    t
    • 4
    • 9
  • d

    Daniel

    05/06/2019, 9:47 AM
    Hello everyone, I'm looking for a beginner-friendly resource to learn coroutines with
    t
    s
    • 3
    • 4
  • c

    carlos cdmp

    05/06/2019, 9:59 AM
    Is it worth implementing Parcelable in Kotlin Enums? As far as I know in Java enums is more efficient implementing parcelable, but I don’t know how the serialization for kotlin enums works under the hood
    l
    • 2
    • 1
  • j

    jw

    05/06/2019, 2:00 PM
    Doesn't seem related to Kotlin
    😞 1
    ☝️ 2
    o
    e
    +2
    • 5
    • 8
  • n

    nickk

    05/06/2019, 2:27 PM
    It turns out that
    Double.toString()
    uses some default (?) locale , while
    String.format("%.1f")
    uses the locale selected by the user. So, I end up with two different decimal separators in the same message (both ‘,’ and ‘.’) Is this expected behavior?
    m
    • 2
    • 3
  • d

    Damien O'Reilly

    05/06/2019, 7:27 PM
    I have been googling around but don't seem to be able to get this working, I am writing a unit test for my ViewModel, and am trying to set a MutableLiveData<String> var in my ViewModel, via the test, however the value is never actually set, and the logic I want to test depends on this value not been null. In my test I am using:
    @get:Rule
        var rule = InstantTaskExecutorRule()
    Any idea what else I may be missing?
    p
    • 2
    • 2
  • a

    ahegazy

    05/07/2019, 11:33 AM
    Is there a way to write snake case view ids in XML and use camel case variable names for the view in Kotlin while using Kotlin Android extensions plugin? I don’t won’t to break conventions and use camel case as view ids in XML, but it seems that there is no other way
    d
    g
    l
    • 4
    • 10
  • t

    themishkun

    05/08/2019, 12:46 AM
    Anyone tried to tackle the Compose thing? It seems that studio build with preinstalled kotlin plugin is stored on the private server maintained by the Compose team
    i
    t
    • 3
    • 5
  • j

    Jan Stoltman

    05/08/2019, 8:40 AM
    Hey guys, can
    Parcelable
    be used with
    sealed class
    when some of its children are
    object
    ?
    b
    • 2
    • 2
  • a

    Andy Victors

    05/08/2019, 8:58 AM
    Anyone is using
    <https://github.com/florent37/Multiplatform-Preferences>
    ? Gradle imports this dependency successfully and the symbol is recognized but I get the compile error
    Unresolved reference: Preferences
    when trying to use it
    d
    • 2
    • 7
  • a

    Andy Victors

    05/08/2019, 9:47 AM
    Additionally, I expect
    android.xxx.
    symbols will be visible in the
    androidMain
    code but compiler does not find them in my case. How is it supposed to implement
    actual
    methods if I need android namespace methods?
    l
    • 2
    • 5
  • k

    kevin.cianfarini

    05/08/2019, 2:20 PM
    can anyone point me in the right direction?
    r
    • 2
    • 1
  • b

    burak.eregar

    05/08/2019, 2:58 PM
    https://medium.com/@burakeregar/jetpack-compose-android-apps-without-xml-534d74448778 I wrote an article about Jetpack Compose which announced yesterday at Google I/O. Any feedback would greatly appreciated!
    👍 4
    p
    r
    +7
    • 10
    • 37
  • j

    Jacob Applin

    05/08/2019, 8:27 PM
    A small sample of using it
    Column(
    					Weighted(
    						Column(
    							Gravity(Center),
    							ImageWizard(
    								ImageProperty(R.drawable.anonymous),
    								TextProperty(R.string.anonymous),
    								TextProperty(R.string.anonymous),
    								anonymousVisibility
    							),
    							ImageWizard(
    								anonymousImage,
    								TextProperty(R.string.anonymous),
    								TextProperty(R.string.anonymous)
    							)
    						)
    					),
    					Button(
    						Primary,
    						TextProperty(R.string.anonymous),
    						Clicks { anonymousClicks.onNext(Unit) },
    						Margins(top = Material, bottom = MaterialSmall, left = Material, right = Material)
    					),
    					Button(
    						Secondary,
    						TextProperty(R.string.anonymous),
    						Clicks { anonymousClicks.onNext(Unit) },
    						Margins(bottom = Material, left = Material, right = Material)
    					)
    				)
    r
    t
    • 3
    • 2
  • j

    Jacob Applin

    05/08/2019, 8:29 PM
    This is just a wrapper around existing Android views though
    i
    p
    • 3
    • 2
  • s

    sirrah

    05/09/2019, 9:05 AM
    Apologies for taking us away from the declarative UI goodness but I'd appreciate some help with an issue with Kotlin lambdas and ProGuard. When any lambda code is run at runtime I receive an exception stating that the
    invoke
    method of that lambda is abstract.
    • 1
    • 2
  • n

    Nav Singh

    05/09/2019, 1:21 PM
    Any help appreciated..thanks
    p
    t
    • 3
    • 10
  • i

    Ive Vasiljevic

    05/09/2019, 3:03 PM
    How to make an extension function for showing Toast inside of both Activity and fragment. My take on this:
    -.kt
    t
    s
    • 3
    • 4
  • s

    scottiedog45

    05/09/2019, 4:05 PM
    Beginning android dev questions: I’m looking to implement infinite scroll functionality. I was thinking of just adding a scroll listener to check the last visible item, and then fetching more data from the network if needed. Google searches have revealed that another option would be an architecture that includes the pagination library, with view models, and a repo? I guess it seems like a bit overkill so I was curious if other (more experienced) devs think it’s worth it to use the jetpack components for this.
    :google: 2
    :stackoverflow: 2
    l
    • 2
    • 1
  • r

    rook

    05/09/2019, 6:47 PM
    I’m really confused by this stacktrace that I’m seeing:
    0 java.lang.NullPointerException: throw with null exception
    1 at com.domain.app.data.models.ReverseGeocodeData$ReverseGeocodeMeta.getAddress$app_releaseFlavor(Unknown Source:3)
    2 at com.domain.app.data.models.ReverseGeocodeData.getAddress(SourceFile:23)
    3 at com.domain.app.main.home.map.MapPresenter$geocodeCoordinateAddress$1.invokeSuspend(SourceFile:1050)
    I’m confused by the function signature
    com.domain.app.data.models.ReverseGeocodeData$ReverseGeocodeMeta.getAddress$app_releaseFlavor
    . What causes the
    $app_releaseFlavor
    to be appended to the name? I’m not really sure how to debug this, because the call chain appears to expect null and transform it at all the correct points.
    -.kt
    r
    • 2
    • 3
  • i

    Ive Vasiljevic

    05/10/2019, 6:15 PM
    How to handle Login request with coroutines and retrofit. I have a problem where I make async request and await in my repo and in viewmodel I call that suspend function with coroutine scope and launch builder, but in my view (fragment) the next line is "evaluatestatuscode" so that function is called without waiting for request to finish. Do I need another Coroutine in my view too? My question is how can I get to request status code. So when I get 200 I transfer to next screen and when I get 401 I display a message.
    r
    g
    • 3
    • 8
  • i

    itnoles

    05/11/2019, 5:41 AM
    I would love to try out Jetpack Compose if I don’t have to download 3 Gigs for it
    p
    c
    • 3
    • 2
Powered by Linen
Title
i

itnoles

05/11/2019, 5:41 AM
I would love to try out Jetpack Compose if I don’t have to download 3 Gigs for it
p

Paul Woitaschek

05/11/2019, 6:06 AM
Then wait for it to evolve, it's really really early in the dev cycle
☝️ 1
c

Cody Engel

05/13/2019, 12:28 AM
Wait it's seriously 3 gigs?
View count: 1