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

    pawel.rybicki

    05/02/2017, 1:38 PM
    whats the downside of using
    lazy
    delegate?
    :stackoverflow: 6
    w
    m
    4 replies · 3 participants
  • l

    louiscad

    05/02/2017, 3:28 PM
    Hi, is anyone here contributing to any open source Android project that uses Kotlin?
    m
    m
    +3
    7 replies · 6 participants
  • y

    yan

    05/02/2017, 7:01 PM
    @hendrik Here’s the list of characters allowed in dalvik identifiers: https://source.android.com/devices/tech/dalvik/dex-format.html#string-syntax
    h
    4 replies · 2 participants
  • j

    jw

    05/02/2017, 9:03 PM
    Try
    continue@for
    a
    w
    2 replies · 3 participants
  • t

    trevjones

    05/02/2017, 11:50 PM
    the first one is valid in my project it seems
    🤔 1
    a
    6 replies · 2 participants
  • j

    johnl

    05/03/2017, 12:22 AM
    Is there something I can use thats kotlin friendly on android and isnt a pain
    d
    1 reply · 2 participants
  • a

    adinugroho

    05/03/2017, 7:14 AM
    Another thing that’s annoying when using kotlin 1.1.2 or 1.1.2-2 is compilation error, even though there’s no error. The only solution is to clean and recompile. When using kotlin 1.1.1 this thing never happens.
    👍 1
    z
    1 reply · 2 participants
  • v

    vyacheslav.gerasimov

    05/03/2017, 7:56 AM
    Unfortunately couldn’t reproduce it in sample project. Does it happen when you run gradlew build from console? If it does, could you run it with
    --debug --stacktrace
    and give me output? @adinugroho @zkvarz
    z
    2 replies · 2 participants
  • d

    Daniel

    05/03/2017, 12:26 PM
    These kind of things shouln't go overboard, but extensions are such a good way to make the android api a bit more readable (especially the 'old' classes like many things in android.graphics)
    k
    9 replies · 2 participants
  • k

    kirillrakhman

    05/03/2017, 2:15 PM
    @audhil this code
    public class DataClass {
    
        private final String a;
        private final int b;
    
        public DataClass(final String a, final int b) {
            this.a = a;
            this.b = b;
        }
    
        public String getA() {
            return a;
        }
    
        public int getB() {
            return b;
        }
    
        @Override
        public boolean equals(final Object o) {
            if (this == o)
                return true;
            if (o == null || getClass() != o.getClass())
                return false;
    
            DataClass dataClass = (DataClass) o;
    
            if (b != dataClass.b)
                return false;
            return a != null ? a.equals(dataClass.a) : dataClass.a == null;
        }
    
        @Override
        public int hashCode() {
            int result = a != null ? a.hashCode() : 0;
            result = 31 * result + b;
            return result;
        }
    }
    is converted to
    class DataClass(val a: String?, val b: Int) {
    
        override fun equals(o: Any?): Boolean {
            if (this === o)
                return true
            if (o == null || javaClass != o.javaClass)
                return false
    
            val dataClass = o as DataClass?
    
            if (b != dataClass!!.b)
                return false
            return if (a != null) a == dataClass.a else dataClass.a == null
        }
    
        override fun hashCode(): Int {
            var result = a?.hashCode() ?: 0
            result = 31 * result + b
            return result
        }
    }
    you just have to add the
    data
    modifier and remove
    equals
    and
    hashCode
    yourself
    👍 1
    a
    f
    5 replies · 3 participants
  • d

    Daniel

    05/03/2017, 5:36 PM
    Currently evaluating if i should replace handler + runable with coroutines. Has someone experience with that? Especially how to unit test this. The use case is 'do something after x milliseconds'
    k
    3 replies · 2 participants
  • a

    aphex

    05/03/2017, 9:29 PM
    It doesn’t even exist yet and AS is warning me I’m outdated
    👍 3
    a
    1 reply · 2 participants
  • p

    Paul Woitaschek

    05/04/2017, 9:34 AM
    There is no -3 available
    😞 2
    l
    1 reply · 2 participants
  • l

    louiscad

    05/04/2017, 2:17 PM
    Assuming you want to create a new list
    👍 1
    m
    3 replies · 2 participants
  • m

    mg6maciej

    05/04/2017, 2:20 PM
    This thing will create a new list and not modify you
    list
    .
    a
    1 reply · 2 participants
  • v

    vyacheslav.gerasimov

    05/05/2017, 3:40 PM
    @wasyl I think it’s a bug, сould you create issue about it with detailed info? kotl.in/issue
    w
    1 reply · 2 participants
  • a

    aphex

    05/06/2017, 12:22 AM
    Whoa, apparently you can’t have multiple annotations in Kotlin without using @field: ❌
    @Inject @MainThreadScheduler lateinit var scheduler : Scheduler
    ✅
    @field:Inject @field:MainThreadScheduler lateinit var scheduler : Scheduler
    g
    1 reply · 2 participants
  • k

    koufa

    05/06/2017, 10:27 AM
    Is there anything else I am missing?
    :stackoverflow: 1
    c
    5 replies · 2 participants
  • k

    kirillrakhman

    05/08/2017, 12:22 PM
    I'm seeing a lot of Lint warnings in my project when running Analyze -> Inspect Code but none of them are reported in the editor. some of them also apply to the whole file instead of a single expression. @vyacheslav.gerasimov any idea?
    v
    1 reply · 2 participants
  • n

    nebojsa.vuksic

    05/08/2017, 2:29 PM
    Hi everyone, I get Lint
    "IllegalIdentifier"
    warning when I use spaces in function naming. Is there any way to fix this without suppressing this warning ? Thanks in advance.
    k
    l
    4 replies · 3 participants
  • d

    david.bilik

    05/09/2017, 10:51 AM
    Hi, do you know if I can use delegated properties for things like properties in adapter? I am always writing code like this
    var products: List<Product> = listOf()
            set(value) {
                field = value
                notifyDatasetChanged()
            }
    and I think that I can use delegated properties with some syntax like
    var products: List<ApiProduct> by adapterProperty(initialValue = listOf())
    but I dont have such experience with them
    u
    2 replies · 2 participants
  • m

    michaelsims

    05/09/2017, 1:57 PM
    😞 FWIW I just tested this in a project I have handy and it did work for me.
    s
    4 replies · 2 participants
  • a

    andre.figas

    05/09/2017, 2:40 PM
    i think this lib have a clean code: https://github.com/metalabdesign/AsyncAwait async { // Show progress await { } }.onError { // Handle exception }.finally { // Hide progress }
    👍 1
    m
    3 replies · 2 participants
  • p

    Paul Woitaschek

    05/09/2017, 8:33 PM
    I always have one devices called “Batmobile” which does completely impossible things 😄
    a
    1 reply · 2 participants
  • d

    Daniel

    05/09/2017, 11:30 PM
    Just wanted to share a little extension function I found useful:
    fun ViewGroup.addHiddenView(view: View) {
        view.visibility = GONE
    
        addView(view)
    }
    👍 1
    l
    1 reply · 2 participants
  • m

    marcinmoskala

    05/10/2017, 9:16 AM
    Pretty new concept to use property delegation to make MVP implementation much easier. I would love to have some feedback 🙂
    l
    r
    +5
    13 replies · 8 participants
  • p

    Paul Woitaschek

    05/10/2017, 2:02 PM
    Can you check at runtime if a string is translated or defaulting?
    z
    5 replies · 2 participants
  • s

    s.luhmirins

    05/10/2017, 2:24 PM
    after updating kotlin plugin to latest version it appears that annotation processing stopped working for java, have anyone encountered similar issue?
    a
    2 replies · 2 participants
  • g

    gonzalonm

    05/11/2017, 12:45 PM
    hey everyone, just a quick tip about the warning message “Your version of Kotlin in runtime…” shown on Android Studio 2.3.1. I changed
    ext.kotlin_version
    to 1.1.2-2 and that message disappeared.
    d
    4 replies · 2 participants
  • a

    audhil

    05/12/2017, 10:37 AM
    Any thoughts about flutter.io and dart language?
    l
    f
    +3
    9 replies · 6 participants
Powered by Linen
Title
a

audhil

05/12/2017, 10:37 AM
Any thoughts about flutter.io and dart language?
l

louiscad

05/12/2017, 12:17 PM
audhil: For Flutter, I'm waiting for the instance state saving issue to be resolved for using it for Android: https://github.com/flutter/flutter/issues/6827 Should happen sometime before 2029...
a

audhil

05/12/2017, 12:38 PM
lol
f

firezenk

05/12/2017, 1:48 PM
So I started reading the website, then I saw something like: “StatelessWidget” and “StatefulWidget” then I closed my browser
c

curioustechizen

05/12/2017, 1:51 PM
Flutter is the "UI toolkit" for Fuchsia OS, so I wouldn't dismiss it. Dart is a pleasant language too (compared to both Java and JS). What I found not so appealing about flutter is the verbose programmatic UI code. Some Kotlin-esque syntax sugar would have been nice to make more concide DSLs
b

benleggiero

05/12/2017, 11:15 PM
I think Flutter.io has some good ideas
I just looked at Dart and I don't like it. It's a step backwards, not forwards.
d

dariuszbacinski

05/13/2017, 1:27 PM
Flutter is very similar to React, it is much better in terms of tooling, everything just works out of the box, it is still in alfa stage but very promising. Can't wait for a first stable release. And i agree that building layouts with it is a bit to verbose, each ui component has single responsibility and you have to nest a lot of them to get what you want.
Dart is very similar to Java, it is much simpler than Kotlin, but has got all you need to be productive.
b

benleggiero

05/13/2017, 1:37 PM
Dart seems like a step closer to Go, not to Kotlin
View count: 6