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

    scottiedog45

    04/15/2019, 4:15 PM
    Hi everyone Happy Monday 😃. What’s the best solution for creating a static list, something like a settings screen, where the options don’t change? Is a ListView the best way to go, and then still setting up an adapter? My only hesitation is that it seems weird to wire up all this logic if the screen is basically static, but if that’s the only way (with an adapter) then that’s what I’ll do 👍🏻. (My mental model for layout construction is coming from xcode where I could basically do everything in the storyboard).
    :google: 4
    r
    t
    +2
    5 replies · 5 participants
  • a

    am414

    04/16/2019, 3:41 AM
    Hi everyone, how I can access a drawable file inside a fragment? I tried many things and unfortunately didn't work such as : context?.resources?.getDrawable(R.drawable.kw, activity?.theme) ResourcesCompat.getDrawable(resources, R.drawable.kw, null)
    :stackoverflow: 4
    :google: 3
    p
    3 replies · 2 participants
  • o

    oleksandr_sandul

    04/16/2019, 8:00 AM
    Hey, we have an issue in the Google Issue Tracker that we need for a project: https://issuetracker.google.com/issues/130580473 It'd be awesome if you could star this 🙂
    👎 6
    🇳🇴 8
    👍 1
    ❌ 6
    d
    m
    +1
    7 replies · 4 participants
  • a

    Akram

    04/16/2019, 4:44 PM
    hello guys , i'm currently building a library that generates implementation of the interactors i have in the domain layer so the generated implementation will have an
    @Inject
    annotation and also i'll generates a dagger Module to provide the interactors with the
    @Binds
    annotation , the problem here is how could i add the module in the appcomponent because its not generated in compile time .
    :stackoverflow: 4
    b
    2 replies · 2 participants
  • i

    ibcoleman

    04/16/2019, 6:50 PM
    hi, everyone. I'm trying to figure out why my builds take so long in Gradle, and going through the gradle profile output, it seems like kaptGenerateStubsDebugKotlin, kaptDebugKotlin, compileDebugKotlin are always executed even if no code changes. Is that just unavoidable?
    n
    5 replies · 2 participants
  • k

    Katie Levy

    04/17/2019, 12:23 AM
    Hey, I just released this Card UI Library for Android, written fully in Kotlin. Check it out and let me know any questions you have! https://github.com/intuit/truffle-shuffle
    textcontentvideo.webm
    👍 18
    r
    2 replies · 2 participants
  • u

    ubu

    04/17/2019, 10:33 AM
    Hi there. I somehow misconfigured running configuration, so that every time I make some changes to the code base, I should rebuild project in order to build app with those changes. If I do not rebuild project before launching app, it will just go "launching activity" without any changes. Do you have any idea of how to switch back to normal behavior? Thank you.
    :stackoverflow: 2
    a
    2 replies · 2 participants
  • m

    Marko Mitic

    04/17/2019, 5:05 PM
    AS 3.4 is out
    c
    d
    +4
    10 replies · 7 participants
  • i

    itnoles

    04/17/2019, 5:21 PM
    Is anyone else getting "java.lang.NoClassDefFoundError: org/jetbrains/kotlin/config/KotlinSourceRootType$Source at com.android.tools.idea.navigator.nodes.other.NonAndroidSourceType.<clinit>" in 3.5 Canary?
    o
    1 reply · 2 participants
  • d

    dawidhyzy

    04/18/2019, 6:44 AM
    Any idea why last Android Studio updates are not available in JetBrain Toolbox?
    ➕ 1
    t
    2 replies · 2 participants
  • c

    czuckie

    04/18/2019, 9:12 AM
    almost slightly off-topic: Is it possible to test a fragment via espresso in a library module?
    :google: 9
    s
    2 replies · 2 participants
  • h

    hmole

    04/18/2019, 4:41 PM
    Why is removing
    META-INF/kotlin_module
    from an
    aar
    artifact breaks my
    android-application
    compilation with extensions functions and global properties from the
    aar
    not being acessable by the compiler???
    l
    1 reply · 2 participants
  • m

    morcerfdumas

    04/20/2019, 7:42 AM
    Hi all, just a minor issue. I’ve marked my sealed class
    Serializable
    , and sending one of it’s sub-classes as intent extra to the next activity. However, in the 2nd activity, pattern matching fails because the serialized object obtained from the intent extras is not the same as the classes in the
    when
    classes
    g
    1 reply · 2 participants
  • d

    Damien O'Reilly

    04/20/2019, 2:18 PM
    I have been following https://github.com/google/iosched/blob/2696fc7e06/mobile/src/main/java/com/google/samples/apps/iosched/di/AppComponent.kt#L50 as an example how to use dagger2, but I am seeing that
    dagger.android.AndroidInjector.Builder
    is deprecated. https://google.github.io/dagger/api/latest/dagger/android/AndroidInjector.Builder.html
    Prefer AndroidInjector.Factory now that components can have factories instead of builders
    Has anyone tried this yet? I am struggling to find an example of this.
    t
    2 replies · 2 participants
  • a

    Akram

    04/20/2019, 9:11 PM
    https://medium.com/@djawedbenahmed/handle-fragments-with-bottom-navigation-and-prevent-recreating-fragments-each-time-activity-65f76b8d0e61
    g
    1 reply · 2 participants
  • r

    rook

    04/22/2019, 2:34 PM
    Is it ok to have meta conversations about channel policy in-channel?
    d
    g
    +1
    9 replies · 4 participants
  • t

    tyler

    04/23/2019, 4:17 AM
    Hey everyone! I’m having an issue with Java Collections .sort on a list from some kotlin code. Let me know if you see anything obvious! https://stackoverflow.com/questions/55802573/abstractlist-unsupportedoperationexception-when-calling-sort-on-a-list
    g
    1 reply · 2 participants
  • n

    natansalda

    04/23/2019, 5:57 AM
    Hello, I am having a trouble with drawing custom view - I don't want to allocate bitmap/paint/nothing in onDraw, but when I move it outside, I get NPE. Below is my class which works - anyone could provide some suggestion how to refactor it? 🙂 This is my first custom view drawing so please don't be too harsh on me 🙂
    there was code but there is not anymore, as I won't get help here anyway as I see
    :google: 3
    g
    r
    7 replies · 3 participants
  • h

    hmole

    04/23/2019, 7:28 AM
    Why can't I import
    com.android.tools.build:builder
    artifact into my
    buildSrc
    to be able to configure AGP from kotlin code? Sources compile fine, but the code that references it is all red in IDE. Anyone faced simular issue?
    g
    m
    7 replies · 3 participants
  • o

    Oleh Ponomarenko

    04/23/2019, 3:14 PM
    Hello guys! How can I get data from response header? I use Retrofit for network requests.
    @POST("api/auth/login")
        fun loginAsync(@Body loginRequest: LoginRequest): Deferred<LoginResponse>
    data class LoginResponse(
            val status: String
    )
    In my response I don't see it, but it exists. http://prntscr.com/nfty4z http://prntscr.com/nftylc
    r
    4 replies · 2 participants
  • t

    tyler

    04/23/2019, 4:01 PM
    Is it possible for kotlin.collections functions to return a mixture of immutable and mutable lists? I’m trying to java.collections sort a list mutated by .sortByDescending, and a very small percentage, but a substantial amount, of my users are crashing due to an UnsupportedOperationException being thrown by
    AbstractList.set(int index, E element)
    public E set(int index, E element) {
            throw new UnsupportedOperationException();
        }
    p
    35 replies · 2 participants
  • b

    Benoît

    04/23/2019, 6:22 PM
    Hey guys, I’m working on a solution for building layouts using pure Kotlin. It’s more of a research kind of thing at the moment so bare with me. Here’s a quick demo, link to the repo in the video description. Let me know your thoughts!

    https://www.youtube.com/watch?v=MmUCau26tLg▾

    👏 5
    👍 3
    😮 2
    a
    d
    +1
    5 replies · 4 participants
  • d

    darkmoon_uk

    04/24/2019, 12:09 AM
    Sad that there is no option to generate a new project's Gradle files in Kotlin DSL, in Android Studio - this seems like a benchmark for adoption.
    g
    a
    +1
    11 replies · 4 participants
  • h

    hussain

    04/25/2019, 10:08 AM
    Hey, has anyone faced this problem where ProGuard obfuscates your Data Classes?
    g
    1 reply · 2 participants
  • h

    hussain

    04/25/2019, 10:09 AM
    I find it tedious to keep adding each of my model classes path in the proguard rules
    g
    12 replies · 2 participants
  • l

    Lilly

    04/25/2019, 10:39 AM
    Hi some help needed please. I have one Activity but to keep it tidy I outsourced some of the code to another class called
    EventHandler
    . Im working with Kotlin + Dagger 2 (not dagger-android) with currently one simple
    Component
    which is built in application class.
    EventHandler
    needs the activity or at least some views and I will inject it into my activity so its a circular dependency. Is there a better way to do this or to avoid the circular dependency?
    r
    15 replies · 2 participants
  • t

    tseisel

    04/25/2019, 8:04 PM
    Does anyone has this issue when building ?
    Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
    > More than one file was found with OS independent path 'META-INF/atomicfu.kotlin_module'
    it seems related to having
    org.jetbrains.kotlinx:kotlinx-coroutines-android:1.2.0
    as a dependency. I solved it with the following workaround :
    android {
        packagingOptions {
            exclude 'META-INF/*.kotlin_module'
        }
    }
    But that wasn't necessary in
    1.1.1
    .
    l
    s
    +1
    6 replies · 4 participants
  • p

    paras

    04/26/2019, 5:32 AM
    has anyone faced issues after updating the android studio in creating release build.. I am started getting
    java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
    library/build/intermediates/res/merged/release/values/values.xml:307: error: resource android:attr/fontVariationSettings not found.
    library/build/intermediates/res/merged/release/values/values.xml:308: error: resource android:attr/ttcIndex not found.
    :google: 4
    g
    2 replies · 2 participants
  • j

    jw

    04/29/2019, 3:39 PM
    yes. it was meant to be stable in 1.3.30 but we forgot to cherry pick it to the release branch. it's stable in 1.3.40
    👍🏼 19
    r
    1 reply · 2 participants
  • g

    Geert

    04/30/2019, 7:23 AM
    Can someone help me with a nice suggestion for Segmented Control (like in iOS) but for Android?
    :google: 1
    y
    2 replies · 2 participants
Powered by Linen
Title
g

Geert

04/30/2019, 7:23 AM
Can someone help me with a nice suggestion for Segmented Control (like in iOS) but for Android?
:google: 1
y

yousefa2

04/30/2019, 8:25 AM
Tabs ? Chips ?
g

Geert

04/30/2019, 8:51 AM
Thanks, Ill probably gonna use Chips
View count: 2