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
compose
  • c

    Chachako

    08/11/2021, 3:10 PM
    Can I use
    flow
    to handle the
    clickable
    callback event? I need to debounce click. If one example will be grateful! 😄
    j
    i
    • 3
    • 5
  • a

    Angeles Bilbao

    08/11/2021, 3:28 PM
    Good morning! Does anyone knows if there is a way to create Composable elements at runtime? I am working on a sort of playground but I am struggling with creating the preview components.
    z
    • 2
    • 1
  • r

    rajesh

    08/11/2021, 5:19 PM
    How can I check if text is overflowed or not? I want to show
    See more/less
    based on text displayed.
    ➕ 1
    z
    h
    • 3
    • 5
  • c

    carbaj0

    08/11/2021, 5:57 PM
    I have a custom button and I want to allow only some modifiers like weight or width, for example I don't want to allow user to change button height. Is there any way to place restrictions on modifiers?
    c
    a
    • 3
    • 30
  • f

    Fudge

    08/11/2021, 5:58 PM
    Hey, any idea on how to approach debugging why a composable doesn't get recomposed? I've refactored my code slightly and now it no longer recomposes a part of the UI for seemingly no reason. Another part does get properly updated though.
    k
    • 2
    • 2
  • p

    PHondogo

    08/11/2021, 6:40 PM
    Anybody know what can it be if changing mutable state value doesnt trigger recomposition of composable that is using this state object? Is there any limitations of using state objects?
    c
    • 2
    • 3
  • e

    enighma

    08/11/2021, 8:55 PM
    First of all great work on making animations/transitions happen with navhost @Ian Lake + team That being said, whenever I try adding my own, they look kind of broken. I have a hard time setting up a nice transition with
    slideIn
    fadeIn
    etc. Is this a known issue? I.e is the solution to dial in the parameters?
    d
    i
    +2
    • 5
    • 13
  • c

    Chuck Stein

    08/12/2021, 12:48 AM
    Is there any way to add a callback for when the user closes the software keyboard in Compose? I want to unfocus my TextField when the user closes the keyboard, so that they don't have to press the back button 3 times to exit a search query. (Currently it's once to close the keyboard, a second time to unfocus the TextField, and then only the third time does my custom BackHandler get called, to exit the search page.)
    c
    • 2
    • 4
  • a

    Anton Dmytryshyn

    08/12/2021, 2:55 AM
    What would be the best way for me to create spacing between the last item of a lazy list and a FAB in the scaffold encompassing the screen UI. I know that I can easily add an item trailing the list with a Spacer of height 64.dp (This is due to the 48.dp Extended FAB default minheight and a 16.dp spacer from the bottom of the fab to the bottom Nav bar), but I'm wondering if there is a better approach.
    ➕ 1
    p
    c
    • 3
    • 4
  • b

    Benyam Seifu

    08/12/2021, 3:41 AM
    I am working on a form and I wanted to enable autofill for a birthdate text field. But autofill BirthdateFull type is not working. However other types like BirthdateMonth,BirhtdateDay and BirthdayYear are working. Is there anything I am missing? Any help or way arround is greatly appreciated:)
    ➕ 2
    • 1
    • 1
  • t

    Tin Tran

    08/12/2021, 11:23 AM
    Hi. This maybe a noob question but when does remembered state is cleaned?
    b
    • 2
    • 5
  • m

    mmaillot

    08/12/2021, 11:44 AM
    Hello, I’m looking to do a simple view (see screenshot). I’ve 3 compose : MainScreen, Phoneme and Word. The Phoneme is a Row with 3 images inside (lower, upper and cursive). The word is a box with only one image. The drawable for Image are big. I have only the png format so I drop them directly in the drawable folder. I want to get the result in the second screenshot. (code in the thread).
    t
    c
    • 3
    • 11
  • r

    rajesh

    08/12/2021, 11:47 AM
    How should I collect lazyPagingItems in compose. I'm using below code but it says
    Type 'LazyPagingItems<Post>' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate
    and I've already imported
    import androidx.compose.runtime.getValue
    class ProfileViewModel @Inject constructor(
        private val profileRepository: ProfileRepository
    ) : ViewModel() {
    val selfPosts: Flow<PagingData<Post>> =
            profileRepository
                .getSelfPosts()
                .cachedIn(viewModelScope)
    }
    
    fun ProfileScreen(profileViewModel: ProfileViewModel) {
    val selfPosts by remember(profileViewModel) {
            profileViewModel.selfPosts
        }.collectAsLazyPagingItems()
    }
    s
    • 2
    • 2
  • f

    Florian

    08/12/2021, 12:05 PM
    How do I get an activity-scoped ViewModel in Compose? Do just call (
    hilt
    )`viewModel()` in the activity and pass it to my Composable screen?
    t
    c
    i
    • 4
    • 31
  • b

    bodo

    08/12/2021, 12:20 PM
    Hi. I have added the following dependencies:
    implementation(composeUi)
    implementation(composeMaterial)
    implementation(composeUiTooling)
    implementation(composeFoundation)
    this adds 3,7mb to my project with and without proguard with no special rules… is proguard not working for compose???
    c
    • 2
    • 1
  • s

    Shakil Karim

    08/12/2021, 12:33 PM
    When this exception usually occurs? I got this exception in Logs
    Unsupported concurrent change during composition. A state object was " +
        "modified by composition as well as being modified outside composition
    • 1
    • 1
  • t

    Todor Grudev

    08/12/2021, 1:07 PM
    I am trying to load a simple pdf in a
    WebView
    (code in 🧵) but it doesn’t seem to work, is there a potential issue with
    WebView
    and compose?
    c
    t
    +2
    • 5
    • 10
  • r

    rajesh

    08/12/2021, 1:29 PM
    Is there any way (or heck) to modify paging (3) data to show ui changes in compose? Like modifying certain object property from paging list when user interact with ui. Paging doesn't seems to support data modification.
    a
    s
    • 3
    • 16
  • m

    Marko Novakovic

    08/12/2021, 4:08 PM
    am getting
    Failed to get visible insets. (Reflection error). No field mVisibleInsets in class Landroid/view/View$AttachInfo; (declaration of 'android.view.View$AttachInfo' appears in /system/framework/framework.jar!classes3.dex)
    any help? not crashing, app still works fine but I started to see it in the logcat
    c
    • 2
    • 13
  • m

    Marko Novakovic

    08/12/2021, 4:25 PM
    problem with Accompanist navigation animations.
    expandIn
    and
    shrinkOut
    always expand in/shrink to top left corner. setting `expandFrom`/`shrinkTowards` has no effect and default value for those two is
    Alignment = Alignment.BottomEnd
    .
    c
    d
    • 3
    • 12
  • m

    Marko Novakovic

    08/12/2021, 4:44 PM
    any ideas on how to prevent this double click navigation?
    ➕ 1
    c
    p
    a
    • 4
    • 5
  • s

    Sunny

    08/12/2021, 5:57 PM
    so we will have to wait for compose team for this effect in jetpack compose? https://developer.android.com/about/versions/12/overscroll
    c
    s
    a
    • 4
    • 5
  • t

    theapache64

    08/12/2021, 6:59 PM
    🧭 Navigation Compose : How do i start (
    navigate
    ) a page (
    composable
    ) as transparent?
    ✏️ Rephrased : How to overlay one
    composable
    on another
    composable
    when using
    navigation-compose
    library? OR how to create transparent page?
    c
    s
    i
    • 4
    • 12
  • j

    josefdolezal

    08/12/2021, 9:23 PM
    Hey folks! 🖖 Is there some API (modifier?) which would allow me to add show custom attributes of compose view in layout inspector? We are doing runtime inspection using 3rd party tool and there doesn’t seem to be an easy way to tag views so that we are able to find them easily..
    c
    • 2
    • 4
  • a

    Ashu

    08/12/2021, 9:30 PM
    Hi Composers I am trying to animate LazyColumn a little bit smoothly but have no idea what I am doing. What I am trying to do is to allow user to scroll a little bit even if they are already at the top. And when the user flings and hits the top of the list, I want to animate that with anticipate or overshoot kind of easing. I am having a hard time creating a fling behavior for that. Can someone please help me with it?
    ➕ 1
    c
    c
    • 3
    • 3
  • f

    FunkyMuse

    08/12/2021, 10:15 PM
    hey guys, what i'm doing wrong (code in thread)
    c
    c
    • 3
    • 6
  • p

    PHondogo

    08/12/2021, 10:26 PM
    Hello! What is the best way for editing tree like data with sub composables and data validation? With possabiliy to allow to save data only if alll nodes are valid.
    z
    • 2
    • 1
  • z

    Zach Klippenstein (he/him) [MOD]

    08/12/2021, 10:33 PM
    I’m not sure if this is something any of yall would find useful, but I wrote a little dev tool for poking around in the data stored in the slot table. Here’s the code. If it seems interesting to people then I can release it with Radiography.
    Kapture 2021-08-12 at 15.24.12.mp4
    :kotlin-intensifies: 7
    👍 7
    👍🏼 1
    l
    c
    t
    • 4
    • 5
  • k

    Ky

    08/12/2021, 10:46 PM
    Hey guys, I have a question about
    setContent{}
    . I have a shared viewModel between a Fragment and an Activity. In the activity xml I have a
    ComposeView
    and in
    onStart
    I’m attempting to update that ComposeView like this
    Code block 1
    Inside the composable view is something like
    Code block 2
    The problem is that
    setContent
    in the activity is only being called when the activity is attached/detached. It is not observing the data stream but if it switch the code to this(still in onStart):
    Code block 3
    This works fine. Is there something I’m missing about setContent{} in the Activity?
    :thread-please: 1
    k
    • 2
    • 5
  • f

    Florian

    08/12/2021, 11:27 PM
    Can I have activity-wide app bar menu items if I have separate Scaffolds on each screen? I guess no
    k
    b
    • 3
    • 5
Powered by Linen
Title
f

Florian

08/12/2021, 11:27 PM
Can I have activity-wide app bar menu items if I have separate Scaffolds on each screen? I guess no
k

kevindmoore

08/12/2021, 11:29 PM
I think you would have to have just 1 Scaffold and then you would have to communicate Toolbar item changes
f

Florian

08/13/2021, 1:17 AM
ok thank you
so instead I put the shared item on each screen manually?
b

Berkeli Alashov

08/13/2021, 3:23 AM
If you have separate Scaffolds, just have the same AppBars or AppBarMenus composables that you would pass to separate Scaffold or AppBars
f

Florian

08/13/2021, 10:40 AM
@Berkeli Alashov thanks, that sounds like a good idea
View count: 8