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
  • h

    Haus

    02/14/2018, 11:21 PM
    Does anyone here was able to overwrite any dependency on kodein for testing?
    d
    l
    • 3
    • 13
  • m

    mariodroid

    02/16/2018, 5:11 AM
    @here Hi Guys I have an issues with memory allocation this is my simplified version of what I do in my app
    data class Foo(var bar: String, var listFoos: MutableList<String>)
        val foos = mutableListOf("one", "due", "three")
            val pair = Pair(Foo("bar", foos), mutableListOf("ignore", "me"))
    
            val pairCopy = pair.copy()
    
            info { "Pair " + pair.second + "and :" + pair.first.listFoos }
            info { "Pair Copy" + pairCopy.second + "and :" + pairCopy.first.listFoos }
            pairCopy.second.clear()
            pairCopy.first.listFoos.clear()
            pairCopy.first.bar = "SUCKIT"
    
            info { "Pair Copy Cleared " + pairCopy.second.toString() + "and :" + pairCopy.first.listFoos.toString() }
            info { "Pair: " + pair.second + "and :" + pair.first.listFoos }
            info { "Pair  Bar property: " + pair.first.bar }
    no matter what I do the list on the first pair is cleared, I supposed that the copy method reallocate the pair object, which does work just for no list type what to do ?
    u
    • 2
    • 3
  • r

    raghuramjampala

    02/16/2018, 12:05 PM
    since we are moving towards using Kotlin more and are moving towards Kotlin data classes for network requests and responses, does anyone know of any adverse effects of Kotlin data classes and GSON? I’ve read it can break the immutability part of Kotlin, so something can be null when it shouldn’t be because of the use of reflection by GSON
    u
    g
    +3
    • 6
    • 8
  • s

    Sagarsrao

    02/18/2018, 7:12 AM
    Hello developers.Please answer my question Does jetbrains recommends usage of Anko library in kotlin projects officially?
    r
    m
    • 3
    • 4
  • b

    bod

    02/18/2018, 12:00 PM
    Hello, World! I’m currently having a weird
    java.lang.VerifyError
    crash when my app starts. I think it’s a Kotlin compiler bug, but not sure. I’ve singled out the exact line that makes this happen (if I comment it, it works). The exact error is:
    java.lang.VerifyError: Verifier rejected class org.jraf.android.cinetoday.app.loadmovies.LoadMoviesHelper: void org.jraf.android.cinetoday.app.loadmovies.LoadMoviesHelper.loadMovies$app_debug() failed to verify: void org.jraf.android.cinetoday.app.loadmovies.LoadMoviesHelper.loadMovies$app_debug(): [0x4A] 'this' argument 'Reference: java.lang.Object' not instance of 'Precise Reference: org.jraf.android.cinetoday.model.movie.Movie' (declaration of 'org.jraf.android.cinetoday.app.loadmovies.LoadMoviesHelper' appears in /data/app/org.jraf.android.cinetoday-1/base.apk)
    And the line causing it is this:
    val allMoviewFromDbById = allMoviesFromDb.associateBy { it.id }
    I know it’s a long shot but… any idea? 😛
    p
    • 2
    • 3
  • d

    Daniel

    02/18/2018, 2:52 PM
    When I run my instrumented test build in Kotlin Android Studio selects the wrong run configuration (the one for unit tests), is there a solution to this problem?
    d
    • 2
    • 1
  • d

    dave08

    02/19/2018, 12:05 PM
    @oleksiyp Is mockK.io compatible w/ Android Espresso?
    o
    n
    • 3
    • 13
  • s

    Shashank Gupta

    02/20/2018, 5:07 AM
    @gildor I shifted the
    allWarningsAsErrors
    to project gradle file and yes now my build has failed with a message
    e: warnings found and -Werror specified
  • m

    Mathbl

    02/20/2018, 2:11 PM
    My use case is: I have a singleton (kotlin object) and I would like to have a method
    disconnect
    that I could call from anywhere. Disconnect would check if
    isConnected
    and if not, will just do nothing. But the thing is, right now, if disconnect is the first method to be called on that object, it will call
    init
    before calling disconnect...and my init calls
    connect()
    on the object. So that's a bit counterproductive to connect then disconnect right after.
    m
    t
    • 3
    • 9
  • g

    gurvinder9

    02/20/2018, 2:24 PM
    hey all I’m new to android development Just started learning kotlin. I created a fragment and inside that i want to show a list of item using RecyclerView is there any tutorial i can look at in kotlin
    :stackoverflow: 7
    k
    p
    • 3
    • 4
  • r

    rCorbellini

    02/21/2018, 10:12 AM
    kotlin-kapt is the dagger 2 at kotlin?
    ❓ 3
    d
    • 2
    • 1
  • w

    withoutclass

    02/21/2018, 4:15 PM
    I wrote a blog post about how I've been doing MVP with coroutines: https://medium.com/@rocketwagon/presenter-as-a-function-reactive-mvp-for-android-using-kotlin-coroutines-442fc4c77119 @dave08 I think you were interested per our previous conversation
    d
    • 2
    • 1
  • m

    Michael Jagielo

    02/21/2018, 4:19 PM
    If I migrate my ButterKnife implementation to KotterKnife what does the grade look like? Are the implementation ButterKnife calls removed?
    • 1
    • 2
  • p

    pablisco

    02/22/2018, 8:29 AM
    That's the resulting action not the reason behind it 😉 You could create a wrapper around the response so it's reusable. I agree that it makes it easier though. But in the long term the fewer dependencies your code has the easier it is to maintain and evolve.
    g
    • 2
    • 1
  • f

    fradiati

    02/22/2018, 1:36 PM
    hi i want to post a List of Strings like this @Field("image") List<String> image if i send more url its works fine but is i post only 1 it send not as list only simple string how can is solve it? i want to send a list with 1 element
    r
    • 2
    • 1
  • n

    Nizzle94

    02/23/2018, 3:18 PM
    Does anyone has any prediction (shocked announcement was Kotlin in 2017) for Google I/O 2018 ?
    o
    g
    +4
    • 7
    • 10
  • j

    jw

    02/23/2018, 3:21 PM
    Groovy first-class language
    😂 3
    :trollface: 20
    a
    • 2
    • 1
  • a

    arekolek

    02/24/2018, 1:44 PM
    I wouldn't worry about that warning now. If you do
    Log.d
    before the whole
    RxTextView
    part, can you see that printed to logcat?
    n
    • 2
    • 4
  • k

    kartikpatodi

    02/24/2018, 5:54 PM
    Hi, I need to make some api calls in my android app and i waant to know how can i do so with kotlin, any library suggestions?
    r
    r
    g
    • 4
    • 17
  • k

    koufa

    02/24/2018, 6:33 PM
    Hello. Does anybody know if there are open source apps with MVI ( Model View Intent) and Kotlin coroutines? I have found a lot of examples that use RxJava but I would like to study some with coroutines instead.
    r
    • 2
    • 1
  • r

    rkeazor

    02/24/2018, 7:41 PM
    why not just find a tutorial on coroutines by itself? its pretty straight forward from what i can see
    k
    • 2
    • 1
  • d

    devKshitijJain

    02/25/2018, 12:22 PM
    Anyone using Kotlin with MultiModule Android Project? Give me not existent class error for classes that are in other module
    g
    r
    • 3
    • 13
  • u

    ursus

    02/25/2018, 5:26 PM
    Hi guys, what is the jury on private string constants? should it be top level const or companion object? Say used for Bundle argument name
    s
    • 2
    • 1
  • j

    Joey Heck

    02/26/2018, 6:33 PM
    I looked at Room, but it's not friendly enough
    e
    • 2
    • 1
  • n

    neuber

    02/27/2018, 2:01 AM
    https://stackoverflow.com/questions/40055298/using-goertzel-algorithm-to-detect-frequency
    g
    • 2
    • 6
  • b

    Ben Piatt

    02/27/2018, 5:27 PM
    Does Kotlin yet have a way to require that implementors of an interface method call super?
    c
    • 2
    • 10
  • f

    fradiati

    02/28/2018, 8:02 AM
    i have an activity with scrollable content and an editbox
    n
    • 2
    • 1
  • f

    fradiati

    02/28/2018, 8:03 AM
    what can i do? adjustResize dont work
    :stackoverflow: 7
    o
    • 2
    • 1
  • j

    jw

    02/28/2018, 7:29 PM
    you need to use 1.2.30 EAPs for that to work
    j
    • 2
    • 3
  • a

    adalbert

    02/28/2018, 8:03 PM
    Hi! Is this possible to add own extension method to
    RxView
    from RxBinding ? (I got unresolved reference)
    fun RxView.throttledClick(v: View, s: () -> Any) {
            this.clicks(v).throttleFirst(1000, TimeUnit.MILLISECONDS).subscribe{s()}
        }
    I tried to look deeper
    @CheckResult
    inline fun View.clicks(): Observable<Unit> = RxView.clicks(this).map(VoidToUnit)
    But I am still confused why I can't just add extension method. (I am still new to kotlin)
    e
    • 2
    • 2
Powered by Linen
Title
a

adalbert

02/28/2018, 8:03 PM
Hi! Is this possible to add own extension method to
RxView
from RxBinding ? (I got unresolved reference)
fun RxView.throttledClick(v: View, s: () -> Any) {
        this.clicks(v).throttleFirst(1000, TimeUnit.MILLISECONDS).subscribe{s()}
    }
I tried to look deeper
@CheckResult
inline fun View.clicks(): Observable<Unit> = RxView.clicks(this).map(VoidToUnit)
But I am still confused why I can't just add extension method. (I am still new to kotlin)
e

edwardwongtl

03/01/2018, 3:39 AM
RxView itself does not have instance, it just provide a brunch of static methods. Extension method is applied to the instance of the class and not the class itself.
👍 2
a

adalbert

03/01/2018, 5:28 PM
thanks!
View count: 2