https://kotlinlang.org logo
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
  • i

    igoticecream

    05/18/2017, 11:49 PM
    Hi guys, I'm new into kotlin, I have a few questions: 1. annotationProcessor or kapt? 2. Butterknife or kotlin android extensions?
    d
    v
    +6
    • 9
    • 14
  • a

    aris

    05/19/2017, 7:04 AM
    kotlin extensions
    m
    • 2
    • 13
  • d

    deviant

    05/19/2017, 8:20 AM
    hey guys, have anybody tried https://developer.android.com/topic/libraries/architecture/index.html ? i'm not sure how to fetch resources (strings, colors etc) inside of
    ViewModel
    . Of course we can use
    AndroidViewModel
    which receives
    Application
    as a constructor param. But in this case we expose android implementation and can't easily test our
    ViewModel
    with unit tests (without mocking the app)
    a
    • 2
    • 6
  • q

    quiro

    05/19/2017, 8:23 AM
    I don't think you should fetch resources like strings and colors inside the
    ViewModel
    m
    • 2
    • 2
  • d

    deviant

    05/19/2017, 8:35 AM
    yep. i used to
    ObservableField
    everywhere 🙂 btw i hope they will add some delegated properties support for
    ObservableField
    , so we can use fields as
    textLabel = "hello world"
    instead of
    textLabel.set("hello world")
    ☝️ 3
    😊 1
    d
    a
    • 3
    • 7
  • a

    aidanvii

    05/19/2017, 8:37 AM
    whoops 😄
    d
    y
    • 3
    • 5
  • e

    ebnrdwan

    05/19/2017, 12:17 PM
    hey there i need to know why it's better to use kotlin over java se8 on android ? also does kotlin has it's own compiler or it is fully depended on jvm ?
    l
    v
    • 3
    • 2
  • c

    chansek

    05/19/2017, 12:24 PM
    I had one constants file in Java, where all my "public static final String" were declared. Now I converted that to Kotlin using the AS 3.0 tool. The generated file converted public class -> object -- Why not class? public static final String -> val -- It is understandable. But the places I was using those constants changed to: Constants.TEST -> Constants.INSTANCE.getTEST() -- Any better way to achieve this? All my switch case fails as they need String literals not String object. I know when in Kotlin, but those classes are Java and can't convert whole project in Kotlin at one shot. As I am new to Kotlin.
    l
    d
    +3
    • 6
    • 51
  • c

    chansek

    05/19/2017, 12:25 PM
    I am completely new to Kotlin and this is my 1st class in Kotlin. So your help is appreciated.
    m
    • 2
    • 2
  • i

    inv3rse

    05/19/2017, 2:11 PM
    Even the automatic generated unit tests in a newly created project fail...
    k
    • 2
    • 1
  • c

    codeslubber

    05/19/2017, 3:52 PM
    was just looking at Dagger, the scopes seem to lack something comparable to a conversation? Activity scope is not great because the Activity is not remade each time, so for instance, a wizard would not work with that scope, correct?
    m
    c
    • 3
    • 33
  • y

    yousuf.haque

    05/19/2017, 3:55 PM
    i have a fragment, and a mapView, and in my fragment’s onstart, I’m trying to call mapView.onstart
    m
    • 2
    • 11
  • l

    leodeleon

    05/19/2017, 4:59 PM
    message has been deleted
    e
    t
    i
    • 4
    • 14
  • r

    r-z

    05/19/2017, 6:11 PM
    Ayy wadaap, tying out android development with kotlin and can't figure out of how to open new activities. I'm guessing it's the same as it is with java, so create new intent, start intent
    i
    r
    • 3
    • 8
  • a

    abanoub.wagdy91

    05/19/2017, 8:04 PM
    In means of annotations
    d
    • 2
    • 6
  • s

    Slackbot

    05/19/2017, 8:06 PM
    This message was deleted.
    d
    • 2
    • 1
  • d

    d.medina

    05/19/2017, 8:15 PM
    is there away to see the member count of this channel before I/O
    😝 2
  • f

    fabianterhorst

    05/19/2017, 10:06 PM
    are kotlin junit tests supported in android studio 3.0? Im always getting class not found.
    m
    z
    • 3
    • 2
  • z

    zak.taccardi

    05/20/2017, 4:50 AM
    So, we don't need to apply to Kotlin plugin anymore with the Android Gradle plugin v 3.0?
    a
    m
    +2
    • 5
    • 9
  • h

    hasen

    05/20/2017, 8:47 AM
    object: OnObbStateChangeListener() {
        override fun onObbStateChange(path: String?, state: Int) { ... } }
    u
    • 2
    • 3
  • c

    chris.zou

    05/20/2017, 9:37 AM
    Where can I get more information about this?
    k
    • 2
    • 1
  • k

    kiku

    05/20/2017, 9:43 AM
    a return statement always returns from the nearest block.. so if you had something like
    fun something(x: List<String>) { x.forEach { ...; return something; }}
    , you would be returning from the inner lambda
    👍 3
    u
    • 2
    • 1
  • e

    eddie

    05/20/2017, 6:44 PM
    @orangy not directly related to Kotlin, but I wonder if you could comment on the 3.0.0-alpha1 plugin and its interaction with IntelliJ - I posted this (https://www.reddit.com/r/androiddev/comments/6c71av/using_android_gradle_plugin_300alpha1_with/) to /r/androiddev and got a response from the Android Tools team stating that integration with IJ will likely break further until AS 3.0 is released and JB pulls in the appropriate changes. I use IntelliJ Ultimate day-to-day and would prefer not to have to switch over to AS 3.0 for Android projects.
    o
    y
    • 3
    • 2
  • p

    Paul Woitaschek

    05/20/2017, 9:02 PM
    Also all Mockito.any() calls throw when the parameter is not nullable
    i
    • 2
    • 1
  • b

    blakelee

    05/21/2017, 3:11 PM
    The new room persistence is annoying in kotlin :( hooray for kotlin/java interoperability
    d
    k
    l
    • 4
    • 4
  • w

    wasyl

    05/21/2017, 4:45 PM
    @orangy could you comment on this https://kotlinlang.slack.com/archives/C0B8M7BUY/p1495379879095455?thread_ts=1495379501.078221&amp;cid=C0B8M7BUY ? For constructor parameters annotation processors work well, I was under the impression that regular methods work fine as well. Is it something that should be reported?
    b
    t
    • 3
    • 7
  • o

    orangy

    05/21/2017, 4:47 PM
    How can I comment if I don’t understand the question? Please don’t mention anyone from [JB] team if you are not absolutely sure we are the person to ask. Also, it’s Sunday, so most people are with families, friends, or traveling.
    w
    • 2
    • 2
  • k

    kuyawa

    05/22/2017, 1:32 AM
    There are 165 channels, any recommendations?
    k
    • 2
    • 1
  • s

    Slackbot

    05/22/2017, 11:45 AM
    This message was deleted.
    f
    • 2
    • 1
  • d

    diego-gomez-olvera

    05/22/2017, 11:50 AM
    it can lead to accidental crash
    k
    • 2
    • 3
Powered by Linen
Title
d

diego-gomez-olvera

05/22/2017, 11:50 AM
it can lead to accidental crash
k

kingsley

05/22/2017, 3:31 PM
diego-gomez-olvera: https://kotlinlang.org/docs/reference/java-interop.html#null-safety-and-platform-types
d

diego-gomez-olvera

05/22/2017, 3:36 PM
I know 🙂 But the properties are generated in Kotlin, so they can be done more stricty (
@Nullable
). There is a ticket for it. https://youtrack.jetbrains.com/issue/KT-18012
k

kingsley

05/22/2017, 4:07 PM
diego-gomez-olvera: Right. Platform types like Yan said. AFAIK, it doesn't do any strict checking of whether or not that property actually exists. Also, it was once non nullable, but that was quickly relaxed. Keep in mind that the view, even if present, are only available between onviewcreated and onviewdestroyed. So they can indeed be both nullable and not
View count: 2