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

    oday

    01/19/2020, 1:34 PM
    minSDK is now 23 😄 https://twitter.com/minSdkVersion/status/1204145130673975311
    🎉 13
    s
    • 2
    • 1
  • s

    svenjacobs

    01/20/2020, 7:12 AM
    Hi, anyone here who migrated from Glide image loading library to Coil? I'm considering replacing Glide due to performance reasons. Animations stutter when Glide loads an image at the same time. I'm wondering if Coil handles this better?
    l
    • 2
    • 3
  • s

    Sagar Suri

    01/20/2020, 8:39 AM
    Question regarding separation of concern in clean architecture: I have the following layer in my app: 1. UI 2. Presentation 3. Usecase 4. Repository 5. Data layer(Remote & Local data source) Now I get a
    JSONArray
    from the remote data source. For simplicity the
    JSONArray
    consist of a list of the following `JSONObject`:
    {
     "id": 1,
     "type": "city",
     "url": "<http://xyz.com/berlin.png>",
     "section": "world",
    }
    In my UI I want to show only list of Images. My UI should not get all a model which consist of
    URL
    . In which layer should I use a mapper to convert the
    ModelEntity
    to a
    Model
    which consists of
    URL
    only?
    f
    t
    h
    • 4
    • 10
  • i

    iex

    01/20/2020, 9:29 PM
    how do I convert
    MutableLiveData
    to
    Observable
    ?
    a
    g
    +2
    • 5
    • 16
  • s

    Sagar Suri

    01/21/2020, 12:00 PM
    Hey, How to get a `view`’s tag in Appium? I don’t want to set a content-description for to differentiate the content of a
    view
    .
    👍 1
    :google: 2
    :stackoverflow: 1
    c
    h
    • 3
    • 5
  • b

    Bryan Lee

    01/21/2020, 11:08 PM
    Are DialogFragments supposed to be dismissed on device rotation? I'm using Navigation. Nav graph goes from Fragment A -> Dialog B (this is a dialogfragment). When I rotate device on Dialog B, it dismisses the dialog and goes back to Fragment A. I'm expecting Dialog B to stay on screen through device rotation. Has anyone come across this problem?
    :google: 2
    :stackoverflow: 2
    t
    • 2
    • 1
  • s

    Sagar Suri

    01/22/2020, 4:46 AM
    https://github.com/Snapchat/dagger-browser
    👍 3
    e
    t
    • 3
    • 5
  • m

    Michael Lever

    01/22/2020, 8:35 AM
    Hey I'm learning Kotlin using the Kotlin_Koans IDE course in Android Studio. I've just done a task about Data Classes but I'm so confused by what this class is supposed to be doing. It's comparing two names that are the same, despite having two different names in the list, why? I'll copy the correct answer below, then underneath I'll paste the 'task'. data class Person(val name: String, val age: Int) fun getPeople(): List<Person> { return listOf(Person("Alice", 29), Person("Bob", 31)) } fun comparePeople(): Boolean { val p1 = Person("Alice", 29) val p2 = Person("Alice", 29) return p1 == p2 // should be true }
    d
    • 2
    • 3
  • t

    turastory

    01/22/2020, 8:40 AM
    Please check out CoC. https://github.com/JetBrains/kotlin-web-site/blob/master/pages/community/slackccugl.md You should put your code in ```
    m
    • 2
    • 1
  • f

    fcosta

    01/22/2020, 10:51 AM
    Hi! Is it possible to use Java 11 with Android Development or Do I need to stick with the Java 8 yet?
    :java: 6
    :google: 7
    s
    t
    g
    • 4
    • 8
  • i

    iex

    01/22/2020, 1:48 PM
    using jetpack's navigation graph, is there a way to pass safe args to a destination? (not directions)
    :google: 2
    :stackoverflow: 1
    b
    a
    • 3
    • 6
  • b

    bhatnagarm

    01/22/2020, 1:54 PM
    @here Is it possible to set layout_height or layout_width for a view using data binding. Tried SO but didn't work.
    :stackoverflow: 1
    :google: 1
    a
    • 2
    • 8
  • b

    Brais Gabin

    01/22/2020, 5:02 PM
    Is there any “strict mode” to check if I edit some view outside the main thread? I’m getting some strange crashes that doesn’t point to any line of my code. I think that those errors are related with a
    notifyDataSetChanged
    or a
    setText
    performed outside the main thread. The problem is that the app is huge and those errors are race exceptions so they are not easy to reproduce. For that reason I’ll need some “tool” that checks that all the interactions done with view is done in the main thread. Any idea?
    t
    • 2
    • 8
  • t

    Tim

    01/23/2020, 1:56 PM
    does anyone remember when android studio, when using the key combo of Cmd/Ctrl + Shift + Up/Down, would move a line of code up or down manually? In some recent update it tries to make some assumptions on where u would like the code to go, like if the line enters in the scope of a function it would jump above the function. am i able to revert to the old functionality somehow
    🔝 1
    w
    • 2
    • 2
  • r

    Ricardo901130

    01/23/2020, 3:07 PM
    Hey guys, I left you here an Android base project(open source) to use as a template. https://github.com/rootstrap/android-base You can collaborate with new functionalities that are essential when starting a new project. 👍
    i
    • 2
    • 2
  • a

    Andrey B.

    01/24/2020, 7:14 AM
    Hello everyone! I have some problem which really causes me headache and trying to find a solution for this. I also created a question on StackOverflow but it seems not getting any attention. So maybe someone can help me with it? It would be really kind. https://stackoverflow.com/questions/59888640/android-hiding-revealing-bottom-navigation-view-causes-lost-of-scroll-state
    b
    h
    • 3
    • 7
  • a

    Arslan

    01/24/2020, 9:51 AM
    Hi good developers... Sorry if i ask wrong question, but i am much needed this. So i have interview on monday as android developer with experience required 1.5 years. So i am 1 year experinced. And what things i should practice and learn more to meet the interviewer, and he asked me more about cloud messaging, push notification, services etc. please guide me throughout. Thanks for answering guys.
    a
    k
    • 3
    • 6
  • h

    hikkidev

    01/24/2020, 10:51 AM
    Hello everyone, please tell me how can I draw a radial gradient of the ellipse shape on the canvas?
    :stackoverflow: 1
    :google: 1
    • 1
    • 2
  • m

    Maku Mazakpe

    01/24/2020, 4:15 PM
    Hey guys. I have thus on click method, and the view model method,trying to log one value in console. And I get this error. What I'm I missing? [1/24, 6:41 PM] Tosg: Nice!!! [1/24, 7:10 PM] Maku: <Button android:onClick="@{() -> viewModel.sendUserDetails(value)}" ... /json user request method fun sendUserDetails(value: String) { Timber.d("user values "+ value) // dprobe json object 1 var gson = JsonObject() val data = JsonObject() data.addProperty("email", value) // parse the json object val jsonParser = JsonParser() gson = jsonParser.parse(data.toString()) as JsonObject .... ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7.1ANTLR Runtime version 4.5.3 used for parser compilation does not match the current runtime version 4.7.1ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7.1ANTLR Runtime version 4.5.3 used for parser compilation does not match the current runtime version 4.7.1/home/maku/Documents/Android/PotSwatch/app/build/generated/source/kapt/debug/com/maku/potswatch/DataBinderMapperImpl.java:11: error: cannot find symbol import com.maku.potswatch.databinding.SignUpFragmentBindingImpl; ^ symbol: class SignUpFragmentBindingImpl
    Task :app:kaptDebugKotlin FAILED
    location: package com.maku.potswatch.databinding FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:kaptDebugKotlin'.
    A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
    > java.lang.reflect.InvocationTargetException (no error message)
    i
    • 2
    • 3
  • e

    Erik

    01/24/2020, 6:31 PM
    Hi fellow droidheads! I've come across a new challenge with AndroidX Fragments and live data and I wonder if you can confirm the following 'rules': - If you use
    androidx.fragment
    artifacts v1.2.0 and up, AND - If you observe
    LiveData
    in fragments, AND - If that fragment does inflate a view in
    onCreateView
    AND - If that view is not null THEN use
    viewLifecycleOwner
    to observe live data. OTHERWISE use the fragment itself, which is a
    LifecycleOwner
    , to observe live data. Is this correct?
    ➕ 1
    ✅ 1
    a
    a
    • 3
    • 14
  • j

    J6ey

    01/27/2020, 3:06 AM
    Folks remember, real devs go native! None of that flutter or react bs.
    i
    z
    +4
    • 7
    • 10
  • m

    Maku Mazakpe

    01/27/2020, 6:42 AM
    Do in app updates only work in Fragments?
    p
    • 2
    • 1
  • m

    Matsushita Kohei

    01/27/2020, 2:45 PM
    Hi everybody , When will a coroutine flow be less experimental? If anyone knows please tell me
    d
    m
    • 3
    • 4
  • n

    Nikola Milovic

    01/27/2020, 6:15 PM
    Hey guys, does anyone have some interesting (preferably well written) Android project that could make a fun exercise to write tests for? (or any other suggestion on how to improve writing tests)
    a
    s
    • 3
    • 3
  • m

    Matsushita Kohei

    01/28/2020, 9:59 AM
    Hi everyone 👋 How does the Android DI library hold singleton objects? For example, Dagger, Koin, etc. are stored internally just by passing Context. I want to know the internal processing. We also to be aware garbage collection 😢
    :stackoverflow: 5
    👀 1
    j
    a
    a
    • 4
    • 8
  • a

    Artem Shumidub

    01/28/2020, 1:00 PM
    Hello 👋 Many times a day I get compile error
    <http://java.io|java.io>.FileNotFoundException: .../android-application/app/build/tmp/kotlin-classes/beta/META-INF/app_beta.kotlin_module (No such file or directory)
    I tried to disable R8 minification, but it did not helped 😢 . Any ideas ? 👂
    • 1
    • 1
  • w

    wasyl

    01/28/2020, 3:27 PM
    I just hit a weird thing: our app would crash with the following error:
    java.lang.LinkageError: Method void com.example.h72.a() overrides final method in class Lcom.example/de; (declaration of 'com.example.h72' appears in base.apk)
    . That’s after obfuscation with R8. The cause was we’d have the following class hierarchy:
    androidx.lifecycle.ViewModel <- BaseViewModel <- SomeViewModel
    , and in
    SomeViewModel
    we’d have a
    fun clear() { }
    method. However, method with same name and signature appears in `androidx.lifecycle.ViewModel.java`:
    final void clear()
    . What I quite don’t understand is, why everything works without R8? I clearly see
    public final void clear()
    method in the decompiled
    SomeViewModel
    , and so feels like things should crash straight away. What happens instead, app works fine without R8 and only crashes with it. 😕 Any idea what might be the reason?
    z
    t
    • 3
    • 7
  • m

    Mark

    01/29/2020, 3:39 AM
    When representing a width-height combo, is there any advantage (other than interactions with other code requiring
    Point
    ) to using
    Point
    instead of
    Pair<Int, Int>
    ? I’m preferring
    Pair
    (because of destructuring and also not being Android-specific) but since I’m creating potentially tens of thousands of these objects, I wanted to check if there is any performance issues.
    h
    k
    +3
    • 6
    • 18
  • c

    corneil

    01/29/2020, 11:07 AM
    I haven't done Android development in a long while and I am trying to build a little demo app and Android Studio says Android module missing. I'm stumped is there anyone who can take a look at https://github.com/open-jumpco/kfsm-android and tell me what is missing?
    a
    k
    • 3
    • 7
  • m

    Maku Mazakpe

    01/29/2020, 11:37 AM
    https://gist.github.com/ma-za-kpe/e49a0002a1c5ee9106710670685c901c
    w
    n
    • 3
    • 4
Powered by Linen
Title
m

Maku Mazakpe

01/29/2020, 11:37 AM
https://gist.github.com/ma-za-kpe/e49a0002a1c5ee9106710670685c901c
w

wasyl

01/29/2020, 11:49 AM
I don’t think it’s legal to have a package called
interface
And if it is, something’s wrong with it. You might work around it by putting
interface
in backticks
n

Nikolay Sinelnikov

01/29/2020, 1:11 PM
It seems you're trying to paste Kotlin code into java file
You should use New -> "Kotlin File/Class" in Android Studio instead
View count: 1