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

    Brendan Weinstein

    12/03/2019, 7:38 PM
    Dispatchers.IO defaults to being backed by an executor that can spawn up to 64 threads. Is it possible to architect an app with suspending non-blocking IO calls and we'd just use one thread for the IO dispatcher? Is it a reasonable expectation that migrating to coroutines+flow from rx will reduce the total number of threads an android application uses? This is the high-level question I am trying to answer.
    b
    z
    • 3
    • 7
  • m

    Madalin Valceleanu

    12/04/2019, 8:13 AM
    📚 Android Sample App using modular, clean, scalable, testable Architecture written in Kotlin that presents modern 2019 approach to Android application development, latest tech-stack and best practices. Application is based, apply and strictly complies with each of the following 5 points: • A single-activity architecture, using the Navigation component to manage fragment operations. • Android architecture components, part of Android Jetpack give to project a robust design, testable and maintainable. • Pattern Model-View-ViewModel (MVVM) facilitating separation of development of the graphical user interface. • S.O.L.I.D design principles intended to make software designs more understandable, flexible and maintainable. • Modular app architecture allows being developed features in isolation, independently from other features. For more technical details please check the project readme. Project link: https://github.com/VMadalin/kotlin-sample-app
    👏 10
    w
    a
    • 3
    • 9
  • n

    Nikola Milovic

    12/04/2019, 10:05 AM
    Good way of doing this (a library or article or any pointer, I use Alert Dialog atm but it's not exactly for this job)

    https://cdn.discordapp.com/attachments/647444029147185162/651724985106432020/Screenshot_20191204-1101392.png▾

    (When you long hold on whatsapp this popsup)
    :google: 1
    w
    r
    • 3
    • 5
  • d

    Daniel Asher

    12/04/2019, 12:43 PM
    Hi, first time poster and newbie to Android/Studio, (but a greybeard otherwise 🧓) I’m trying to understand threading with cooroutines and found the AS Debug Tool Window: Frame: Thread drop down rather cryptic. The documentation (https://www.jetbrains.com/help/idea/debug-tool-window-frames.html#status) is not too helpful
    The status and type of a thread is indicated by a special icon and a textual note next to the thread's name.
    and googling is not much better. So how do I parse
    "pool-2-thread-1 @coroutine#3"@4514 in group "main"
    ? What is
    @4514
    ? and what is
    group "main"
    ? Doing a thread dump, at the top of the stack for this thread is
    "pool-2-thread-1 @coroutine#3@4514" prio=5 tid=0x10 nid=NA runnable
    , so this is not on the main thread:
    "main"@1 in group "main"
    with thread dump:
    "main@1" prio=5 tid=0x1 nid=NA waiting
    Cheers, Daniel
    a
    • 2
    • 2
  • m

    Mutlu Celep

    12/04/2019, 8:58 PM
    I am setting credentials in my build.gradle.kts file. But I want to read the credentials from a json or gradle file, because I want to integrate with Jenkins. I am also open other solutions.
    repositories {
        maven { setUrl("<https://urbanairship.bintray.com/android>") }
        maven { setUrl("<https://clojars.org/repo/>") }
        maven {
            setUrl("<https://jfrog.io/>...")
            credentials {
                username = "..."
                password = "...."
            }
        }
        mavenCentral()
    }
    c
    • 2
    • 2
  • d

    David Whittaker

    12/05/2019, 4:42 AM
    For those familiar with Room, is there a way to setup a 1-1 unidirectional relation? It seems every example I find assumed bidirectionality.
    l
    b
    • 3
    • 4
  • j

    Joey

    12/05/2019, 9:09 AM
    I imported my kotlin library to my old java app and i got this error. Anyone encountered this before?
    u
    • 2
    • 1
  • i

    Ive Vasiljevic

    12/05/2019, 1:22 PM
    In which way is the new experimental ViewBinding feature better than Android Kotlin Extensions for accessing views, by their ID? Except for type safety and null safety, are there any speed improvements?
    s
    g
    +2
    • 5
    • 4
  • v

    voben

    12/05/2019, 6:46 PM
    In android, if I launch a coroutine from my fragment to collect a flow. Should I be calling this with
    launch
    ,
    launchWhenStarted
    or
    launchWhenResumed
    . Assuming I’m calling this in the fragment’s
    onViewCreated
    viewLifecycleOwner.lifecycleScope.launchWhenResumed { }
    t
    d
    • 3
    • 5
  • g

    g4sarma

    12/05/2019, 8:11 PM
    Is there anyone here who has applied or works with https://turing.com ?
    :google: 1
    m
    c
    • 3
    • 2
  • t

    thymecypher

    12/06/2019, 1:20 AM
    Anyone have experience with Mockito being an idiot?
    n
    x
    a
    • 4
    • 5
  • g

    Geert

    12/06/2019, 8:18 PM
    Can someone tell me how to update? I downloaded Android Studio 4.0 and gradle hints me that anohter kotlin update is available, but i cant install it
    :google: 1
    a
    p
    +4
    • 7
    • 10
  • n

    Nikola Milovic

    12/07/2019, 10:34 AM
    https://stackoverflow.com/questions/59123938/my-menu-item-in-my-fragment-is-acting-weird-not-displayed-properly if anyone can help
    :google: 4
    d
    • 2
    • 3
  • a

    Abraham Andres Luna

    12/09/2019, 3:37 AM
    I'm not sure where to ask this question, but does anyone know what tool would generate those XML files that describe the apps icons? They are described as vectors
    b
    • 2
    • 4
  • r

    rutowiczprzemyslaw

    12/09/2019, 12:44 PM
    Offtopic : Does anyone know how to get to Android United slack? I'm requesting the invites for quite some time and no response. Or do you know any other active android slack community?
    d
    • 2
    • 2
  • a

    Ayden

    12/09/2019, 1:14 PM
    Hi everyone. Is there any nice Android Unit Testing or TDD course available?
    👍 1
    v
    c
    +2
    • 5
    • 4
  • u

    ursus

    12/10/2019, 5:43 AM
    Im confused as when is java8 bytecode / jdk available
    j
    • 2
    • 4
  • i

    Ive Vasiljevic

    12/10/2019, 11:04 AM
    Does anyone know the best article for Koin DI Framework. Can't seem to find any that has a clear explanation and real examples. Thanks.
    m
    r
    a
    • 4
    • 3
  • j

    James Richardson

    12/10/2019, 11:07 AM
    is anybody trying out the jetpack compose stuff? it doesn't seem to work with LiveData... at least, not how i'm trying to use it! there is only 1 page on the internet dealing with this combination...
    w
    y
    a
    • 4
    • 5
  • d

    dave08

    12/10/2019, 1:38 PM
    Hi! Would anyone have a recently implemented
    IntentService
    using Coroutines and built on top of a
    LifecycleService
    ?
    a
    • 2
    • 17
  • k

    Konstantin Tskhovrebov

    12/10/2019, 2:03 PM
    Hello, is there a way in Kotlin to use property delegates for data classes in constructor? I want to create something like Swift's
    Property Wrapper
    c
    • 2
    • 2
  • k

    Kulwinder Singh

    12/11/2019, 4:23 AM
    and This class i'm using to convert Firstore snapshot listener to live data, here as i told above listener inside
    onActive
    is called immedietly but it won't update
    value
    of live data until
    suspending
    task inside other
    ViewModel
    finished
    class DocumentLiveData<T>(
        private val documentReference: DocumentReference,
        private val typeClass: Class<T>
    ) : LiveData<T>() {
        override fun onActive() {
            super.onActive()
            listener = documentReference.addSnapshotListener(changes) { documentSnapshot, exception ->
    	    //this listener is called but `value` is not updated immedietly
                if (exception == null && documentSnapshot?.exists() == true) {
                    value = documentSnapshot.toObject(typeClass)
                } else {
                    value = null
                }
            }
        }
    }
    r
    • 2
    • 3
  • c

    Cake

    12/11/2019, 12:44 PM
    Hey guys, i was wondering why we can't inject the Viewmodel directly, but instead we've to inject a factory. Which ate the benefits came from this practice?
    :android: 1
    l
    m
    • 3
    • 27
  • s

    stantronic

    12/11/2019, 1:25 PM
    Hi folks, does anyone know if there are any proguard rules which need to be used when using the @Parcelize annotation?
    m
    • 2
    • 6
  • s

    silvio

    12/11/2019, 3:12 PM
    Hey guys, could anyone tell me why my app crashes when I'm in flight mode and making an API call via retrofit? shouldn't it just return null, or does it throw some exception which I don't know?
    :stackoverflow: 2
    d
    k
    • 3
    • 4
  • n

    Nikola Milovic

    12/11/2019, 6:17 PM
    Hey guys, problem with vector drawables and styles. So I have two options, etiher use android:src or android:background to set the vector image. The src allows me to change the tint of the drawable but not the size, while background lets me set the size but not the tint. Any way to change both color and size in xml style?
    <style name="ImageButtonStyle" parent="Widget.AppCompat.ImageButton">
            <item name="android:color">@color/secondaryColor</item>
            <item name="android:tint">@color/secondaryColor</item> // works as its src now
            <item name="android:layout_width">80dp</item> //doesnt work
            <item name="android:layout_height">80dp</item> // doesnt work
            <item name="android:background">@android:color/transparent</item>
        </style>
    android:src="@drawable/ic_favorite"
    t
    • 2
    • 2
  • h

    hesam

    12/11/2019, 7:58 PM
    Hey guys, I am looking for a good library for my case. I have a
    Browse
    button in my activity. When user click it, I want to let user pick image(s) from the gallery. Also, I want user to be able to take photo(s) from that. Do you know any library that handles these cases? Thank you.
    :google: 7
    ↩️ 2
    l
    a
    • 3
    • 4
  • t

    Tram Ngo

    12/12/2019, 3:57 AM
    Hey guys, by default, the Android Studio helps converting 1 single svg file to vector drawable. I am looking for a formal lib which help convert SVG files to vector drawables (.xml) file only by 1 manipulation. I found a lib on stackOverFlow (https://github.com/ravibhojwani86/Svg2VectorAndroid/blob/master/Svg2VectorAndroid-1.0.jar)
    <https://stackoverflow.com/questions/41190803/is-there-a-way-to-bulk-convert-svg-files-using-android-asset-studio>
    Is that any formal lib from google??? Many Thanks
    j
    • 2
    • 2
  • i

    Isaac Udy

    12/12/2019, 6:53 AM
    Hello Android devs! I'm looking into writing a navigation library (expressing navigation routes as a Kotlin DSL), and I'm interested to hear what kind of funky situations you get your navigation stack into. Obviously there's "go to X" or "go back", but the more complicated examples that I'm interested in are about screens presenting nested screens, back-stack manipulations, and understanding the "types" of navigation. The examples I can think of off the top of my head are: • A bottom tab bar Activity presenting several different fragments • An activity presenting two fragments in a Master/Detail flow • A "sign up" flow that tracks and displays progress through completing several child forms • A dialog that pops over a screen and tracks some kind of navigation through a flow or tabs as above • An Activity/Fragment that wants its parent Activity/Fragment to display a snackbar after it has completed (i.e. "XXX has been saved [view]") • Navigation "types" of "forward from this screen" or "on top of this screen" or "replace this screen" If you're not doing anything interesting with your navigation, I'm also interested in hearing whether or not you often pass messages back to a parent screen once the child has finished doing something (via onActivityResult, a message bus, or any other way). Your thoughts and examples are much appreciated!
    s
    r
    • 3
    • 7
  • m

    murdock

    12/12/2019, 3:18 PM
    Hey guys, im having some really weird issues
    abstract class ScanPresenter : MvpPresenter<ScanView>() {
    
        abstract fun applyFilter(imageFilterType: ImageFilterType)
    
    }
    
    class ScanPresenterImpl @Inject constructor() : ScanPresenter() {
    
        override fun applyFilter(imageFilterType: ImageFilterType) {
    
        }
    }
    This wont compile for some reason
    d
    l
    • 3
    • 4
Powered by Linen
Title
m

murdock

12/12/2019, 3:18 PM
Hey guys, im having some really weird issues
abstract class ScanPresenter : MvpPresenter<ScanView>() {

    abstract fun applyFilter(imageFilterType: ImageFilterType)

}

class ScanPresenterImpl @Inject constructor() : ScanPresenter() {

    override fun applyFilter(imageFilterType: ImageFilterType) {

    }
}
This wont compile for some reason
d

Dominaezzz

12/12/2019, 5:12 PM
Fascinating. That looks YouTrack worthy.
m

murdock

12/12/2019, 7:57 PM
Yeah i've managed to isolate the issue, seems like kapt is breaking the build
l

louiscad

01/02/2020, 9:45 AM
Did you report it on kotl.in/issue? If so, can you link it here please?
m

murdock

01/10/2021, 1:02 AM
This issue was caused by a 3rd party library using older version of Kotlin more info: https://kotlinlang.slack.com/archives/C2R77UD35/p1576181784010300
View count: 4