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

    jw

    12/18/2017, 8:00 PM
    $ gw tasks --all | grep UnitTestKotlin
    220:compileDebugUnitTestKotlin - Compiles the debugUnitTest kotlin.
    229:compileReleaseUnitTestKotlin - Compiles the releaseUnitTest kotlin.
    👍 1
    h
    • 2
    • 5
  • k

    katien

    12/18/2017, 11:44 PM
    but I am a bit confused about what my
    BaseFragment
    should extend, and I'm not 100% sure this is a good idea to begin with. I end up duplicating that code across all fragments and sometimes will forget to write it, so I was thinking having it in one place might be nice
    d
    s
    • 3
    • 2
  • k

    katien

    12/19/2017, 12:16 AM
    or if there's a cleaner way to abstract out this logic
    r
    • 2
    • 4
  • k

    katien

    12/19/2017, 6:41 AM
    abstract class BaseFragment : Fragment(), BaseView<BasePresenter<BaseFragment>> {
    q
    • 2
    • 1
  • k

    katien

    12/19/2017, 6:41 AM
    I don't think this is right though...
    k
    • 2
    • 1
  • t

    Thiago

    12/19/2017, 3:55 PM
    @bachhuberdesign project ou module?
    b
    • 2
    • 8
  • j

    jw

    12/19/2017, 10:28 PM
    Long
    ➕ 1
    c
    • 2
    • 1
  • j

    jw

    12/19/2017, 10:40 PM
    ok non-troll-y answer: https://github.com/JakeWharton/ThreeTenABP/
    👍 4
    🕰️ 3
    c
    • 2
    • 2
  • t

    Thiago

    12/20/2017, 9:53 AM
    https://android-developers.googleblog.com/2017/12/quick-boot-top-features-in-android.html
    l
    d
    • 3
    • 3
  • m

    myanmarking

    12/20/2017, 12:52 PM
    hello guys! does any1 know any samples that showcase Room+RxJava+Page Library ?
    l
    • 2
    • 2
  • k

    katien

    12/20/2017, 11:38 PM
    I'm still a bit new to these concepts but am thinking maybe I can figure out a way to refactor this to be done with composition instead of inheritance. Not totally sure what that would look like though, since I need access to the fragment lifecycle callbacks
    m
    • 2
    • 5
  • k

    katien

    12/20/2017, 11:47 PM
    interface BasePresenter<T> {
        var view: T?
    
        fun attachView(view: T) { this.view = view}
        fun detachView()  { this.view = null}
    }
    c
    • 2
    • 9
  • k

    katien

    12/21/2017, 12:36 AM
    so, to represent error responses with a format like this:
    {
      "errors": {
        "first_name": [
          "first name is required"
        ],
        "last_name": [
          "last name is required"
        ],
        "image": [
          "Invalid image format"
        ]
      },
      "message": "Invalid profile data",
      "status": 400
    }
    I parse my json into this response model:
    data class ErrorResponse (
            var errors: Map<String, List<String>> = emptyMap(),
            var status: Int = 0) {
        operator fun get(k: String): List<String>? = errors[k]
    }
    😂 1
    s
    • 2
    • 1
  • a

    artfuldev

    12/23/2017, 11:02 AM
    trying to use assimp to import a 3d model (obj or collada) and render via opengl. are there any pointers/sample apps?
    d
    e
    • 3
    • 8
  • j

    jw

    12/23/2017, 7:50 PM
    Retrofit
    j
    f
    • 3
    • 13
  • a

    adam-mcneilly

    12/25/2017, 12:12 AM
    Context (the Kotlin question comes at the end): I'm building a basic finance tracking app. I have a dialog fragment that is used to enter a transaction for the account. I use a new instance method that takes in the account name and puts it in the bundle and life is good I can reference it in
    onCreate()
    . Now I want to expand this same dialog fragment to be used for adding or editing a transaction. In my head I see two options: a separate new instance method that takes in the transaction to be edited and I use some flag to determine the state of the dialog. Is there some way to use sealed classes for this, though? I could have like
    sealed class TransactionState
    with a class for add and edit, but it doesn't look like sealed classes can be parcelable, so idk if what I'm asking is feasible but would love for someone to put my mind at rest about it.
    r
    d
    • 3
    • 5
  • k

    kevin.cianfarini

    12/25/2017, 12:24 AM
    I'm struggling to find out how to listen for collapse/expand events on a collapsing toolbar layout on both the
    CollapsingToolbarLayout
    docs and stackoverflow. Can anyone point me in the right direction?
    :stackoverflow: 5
    t
    • 2
    • 2
  • i

    Iain

    12/26/2017, 5:41 PM
    I’m not sure if this is a Kotlin question, an Android question, or a Retrofit question but here goes,
    class GetCoordinatesApiManager: Callback<LocationResult> {
    
        var completionHandler: (flag:Boolean) -> Unit = {}
    
        fun getCoordinates(userIds: ArrayList<Int>, handler: (flag: Boolean) -> Unit) {
            completionHandler = handler
            ApiClient.apiInterface.getCoordinates(userIds, UserState.bearerToken!!).enqueue(this)
        }
    Android Studio complains that
    this
    in
    enqueue(this)
    is
    Type Mismatch Required: Callback <LocationResult!>! Found: GetCoordinatesApiManager
    a
    l
    k
    • 4
    • 11
  • m

    menegatti

    12/27/2017, 10:04 AM
    once you set it to
    bubble
    you should it use that instead of advancing the iterator again
    j
    • 2
    • 1
  • m

    menegatti

    12/27/2017, 10:30 AM
    their sequence is based on an iterator… so I’m not sure why it wouldn’t work
    j
    • 2
    • 8
  • m

    menegatti

    12/27/2017, 10:43 AM
    let me know if it works 😄
    j
    • 2
    • 1
  • b

    besnik

    12/27/2017, 2:54 PM
    @julioyg thanks, this is what i actually do but i thought there is a better solution with more info
    k
    • 2
    • 1
  • n

    nredondo26

    12/27/2017, 8:24 PM
    Hola alguien me puede ayudar con un control parental
    k
    • 2
    • 1
  • r

    rkeazor

    12/27/2017, 9:29 PM
    Hey guys , whats a good static analysis tool for kotlin
    b
    • 2
    • 1
  • n

    noahdurell

    12/28/2017, 3:05 AM
    I’m trying to progress downloads working with okhttp
    g
    • 2
    • 3
  • s

    sourabhv

    12/28/2017, 12:58 PM
    @menegatti Unfortunately, no. @kingsley Then I get the error
    Type mismatch. Required: VH? Found PaginatedRecyclerViewAdapter<VH, T>.BaseViewHolder?
    k
    • 2
    • 2
  • d

    david.bilik

    12/28/2017, 3:49 PM
    this discussion was here yesterday, use !! in your fragment
    t
    k
    r
    • 4
    • 6
  • r

    redrield

    12/30/2017, 7:40 AM
    Is there a way to get around that?
    k
    • 2
    • 1
  • b

    bradfordholcombe

    01/01/2018, 10:14 PM
    Can anyone point me to an official statement about whether KDoc or Dokka is the way to document Kotlin files going forward? My manager doesn’t want us to invest in one, only to have to switch to another.
    k
    • 2
    • 2
  • b

    bradfordholcombe

    01/02/2018, 12:34 AM
    Dokka has a very different approach to documenting. It prefers references inline with the description using brackets. See for example yole’s answer in https://stackoverflow.com/questions/28527838/kotlin-kdoc-documentation which says that the old “tags are available and supported, but not recommended for use”
    d
    • 2
    • 2
Powered by Linen
Title
b

bradfordholcombe

01/02/2018, 12:34 AM
Dokka has a very different approach to documenting. It prefers references inline with the description using brackets. See for example yole’s answer in https://stackoverflow.com/questions/28527838/kotlin-kdoc-documentation which says that the old “tags are available and supported, but not recommended for use”
d

dave08

01/02/2018, 3:40 AM
See http://kotlinlang.org/docs/reference/coding-conventions.html, the section on documentation comments...
b

bradfordholcombe

01/02/2018, 3:55 AM
Thank you. That is what I needed.
👍🏼 1
View count: 1