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

    aoriani

    11/09/2022, 1:27 AM
    I only saw examples with actual instrumented tests and Expresso
  • k

    ken_kentan

    11/09/2022, 9:15 AM
    Is there a way to find a composable function that causing performance issue? I tried to use Macrobenchmark, but CPU profiler just provide the timing of recompose…
    t
    y
    • 3
    • 5
  • t

    Tower Guidev2

    11/09/2022, 9:28 AM
    Good Morning "Composers" 😉 can anyone assist with my question currently open on SO? https://stackoverflow.com/questions/74372019/how-to-employ-backdropscaffoldstate-offset-correctly-to-offset-front-contentlaye
    p
    • 2
    • 17
  • j

    Jan Skrasek

    11/09/2022, 10:55 AM
    Can I safely ignore compiler plugin warning with :kotlinnew: Kotlin 1.7.21?
    s
    • 2
    • 2
  • t

    Tinh

    11/09/2022, 1:38 PM
    hello, maybe somebody have answer to this: Is it risky adding @Immutable to an existing data class because we start using it in Compose ?
    s
    s
    • 3
    • 4
  • l

    Lisandro Di Meo

    11/09/2022, 3:05 PM
    It's okay to use a BottomSheetScaffold even though I will not use drawer, fab, and other parameters?
    s
    • 2
    • 5
  • o

    oday

    11/09/2022, 4:01 PM
    supposing I have this piece of Compose code
    BrowseEventsHost(
        eventsState = eventsState,
        locationState = locationState,
        bottomSheetState = bottomSheetState,
        navController = navController,
        filters = filters,
        browseEventsCallbacks = object : IBrowseEventsCallbacks {
            override fun navigateBack() {
                onBackPressedDispatcher.onBackPressed()
            }
    
            override fun onEventClicked(event: Event) {
                browseEventsViewModel.logEventClicked(event)
                startActivity(eventIntentFactory.create(event.id))
            }
    I would like to show a Composable inside onEventClicked, do I setContent again and inside it show it?
    r
    • 2
    • 3
  • d

    dave08

    11/09/2022, 4:24 PM
    I can't figure out how to keep my Button from getting pushed off the screen when the Text in the same Row is too long (even though it has TextOverflow.Ellipsis)... I have a Spacer with weight(1.F) between them to push the button to the End, it works when the text is short... (see thread for code and screen shot)
    r
    • 2
    • 6
  • d

    dazza5000

    11/09/2022, 5:05 PM
    https://stackoverflow.com/questions/69695763/what-is-the-difference-between-modifier-widthintrinsicsize-min-max-and-modifie
  • p

    Per Jansson

    11/09/2022, 6:35 PM
    I would like to increase the press area a lot on one of the buttons in my application. What would be the best way to do that, without increasing the look of the button itself, but still allow the button’s custom press animation to show?
    k
    • 2
    • 3
  • d

    Daniele Segato

    11/09/2022, 7:08 PM
    How do I use
    Modifier.imePadding()
    with
    Scaffold
    ? (Material3) If I use both the scaffold padding (
    PaddingValues
    ) and
    .imePadding()
    in my screen the padding on the bottom is greater than it should be. If I do not use the scaffold bottom padding and only use
    .imePadding()
    the padding is correct when the ime is open but it is too little when it is close. What's the proper way to use these APIs? (btw why is
    WindowsInsets
    not named
    LocalWindowsInsets
    like other "Locals"?)
    v
    a
    c
    • 4
    • 13
  • j

    Jasmin Fajkic

    11/09/2022, 10:16 PM
    Hey peeps. Do you know if there is another library like this in compose?? https://github.com/AmrDeveloper/ReactButton. Thx in advance
    k
    d
    z
    • 4
    • 3
  • p

    Paweł Cyroń

    11/09/2022, 10:58 PM
    Hey , Stuck on problem with ViewPager. Trying to create view like Reels (instagram/youtube/tiktok).
    currentPage
    is awful and get triggered way to often so I have made my own implementation. yet LaunchedEffect are called too often (not only when value is changed). I’m suspecting ViewPager issue in compose. Code in thread
    d
    • 2
    • 9
  • x

    xxfast

    11/10/2022, 12:19 AM
    Hi all - weird question. You know how you can consume a
    Stateflow
    as
    State
    with
    collectAsState()
    ; but is there a way to do the exact opposite? i.e get a flow update whenever a
    State
    changes?
    p
    b
    • 3
    • 4
  • a

    Andy Himberger

    11/10/2022, 3:30 AM
    Upgrading to compose 1.3, none of our icon resources are being minified / discarded anymore. Not sure if anyone else noticed this?
    t
    • 2
    • 3
  • x

    xxfast

    11/10/2022, 3:35 AM
    With
    m3.NavigationBar
    Whats the right way to apply
    windowInsetsPadding
    to bottom
    NavigationBar
    ? I'm doing this right now
    NavigationBar(
      modifier = Modifier
        .windowInsetsPadding(WindowInsets.navigationBars),
    ) {
      pages.forEach { page ->
        NavigationBarItem(..)
      } 
    }
    It looks all wrong 🤔
    o
    j
    • 3
    • 5
  • s

    Slackbot

    11/10/2022, 4:53 AM
    This message was deleted.
    i
    i
    • 3
    • 3
  • s

    Stylianos Gakis

    11/10/2022, 8:32 AM
    Trying out the new compose BOM and I have a question. When a BOM is for say <5 libraries, it’s kinda easy to go through the release notes and check while updating if there’s anything to update with the new version. Compose BOM has 30 artifacts under itself though, meaning that when I am bumping it I can’t be sure I am taking care of everything I would if I did the bumps one by one. And I am not talking about breaking changes in the code, I understand that the version upgrades are backwards compatible for the most part, but it’s also for stuff like when a library upgrades, sometimes they may introduce a new API which I see in the change log and go ahead and learn about it and use it immediatelly. This is not going to be happening with the BOM. So a question, is there anywhere where for a specific BOM update I can also see a huge list of all the change logs for the versions that got updated? A list of all the changelists that look like this; Example of compose material 1.3
    Version 1.3.0 October 24, 2022
    
    Important changes since 1.2.0
    
    Behavior breaking change
    Maximum supported elevation in dialogs and popups has been reduced to 8dp.
    
    API Changes
    Add a Pull-To-Refresh component to Compose (I29168).
    Change parameter name from values to value in RangeSlider (I3b79a).
    a
    e
    • 3
    • 4
  • c

    czuckie

    11/10/2022, 11:10 AM
    Hey guys, can someone help me figure out why I'm getting this when I use compose compiler version 1.3.2 and kotlin 1.7.20 (I've seen this https://github.com/google/ksp/issues/1050 but that was with a beta version of 1.7.20):
    e: java.lang.NoSuchMethodError: 'void org.jetbrains.kotlin.codegen.state.KotlinTypeMapper.<init>(org.jetbrains.kotlin.resolve.BindingContext, org.jetbrains.kotlin.codegen.ClassBuilderMode, java.lang.String, org.jetbrains.kotlin.config.LanguageVersionSettings, boolean, org.jetbrains.kotlin.codegen.state.IncompatibleClassTracker, org.jetbrains.kotlin.config.JvmTarget, boolean, kotlin.jvm.functions.Function1, kotlin.jvm.functions.Function1, int, kotlin.jvm.internal.DefaultConstructorMarker)'
            at com.google.devtools.ksp.processing.impl.ResolverImpl.<init>(ResolverImpl.kt:143)
            at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.doAnalysis(KotlinSymbolProcessingExtension.kt:188)
    • 1
    • 1
  • k

    K Merle

    11/10/2022, 11:22 AM
    Adding
    WindowCompat.setDecorFitsSystemWindows(window, false)
    in latest compose version seems to add additional vertical padding to my screens. Anyone experienced same issue?
    t
    c
    a
    • 4
    • 4
  • a

    Abdul Hafeez Sajid

    11/10/2022, 11:56 AM
    Hi, I am using a custom Horizontal Pager made with
    Layout
    with custom draggable and state handling. I am facing problem with Pager height. If I give specific height, then it works fine. But if I don’t give any height and use
    Modifier.wrapContentHeight()
    then Pager does not show up. The items may have different heights that is why wrapContentHeight is must. I have tried to debug it and found out that, when no height is given then Constraints in
    Layout
    have height set to zero hence placeables get zero height. Kindly help. Code attached in the thread.
    s
    k
    • 3
    • 7
  • l

    Lisandro Di Meo

    11/10/2022, 2:54 PM
    Hello, I have a design question. We have an app where first the following pattern seem to work. But now, we have a lot of screens, not all of them uses scaffold stuff, and we are moving states from everywhere
    Scaffold(/*...*/){
       NavGraph(/*...*/)
    }
    Shouldn't it be better if we face it with a different approach, something like:
    NavGraph(/*...*/){
       composable(A){ Scaffold(...) }
       composable(B){ ModalBottomSheet(...) }
       ...
    }
    Also by using the previous approach, we shouldn't have to move the scaffold state from one place to other, and each screen will know its own traits.
    d
    • 2
    • 14
  • c

    Colton Idle

    11/10/2022, 6:18 PM
    Compose updates were released yesterday (which also coincides with Android Dev Summit part 2) 😛arty-parrot: Some updates that stood out to me! Version 1.3.1 stable Nothing too major there it seems except for some bug fixes. Version 1.4.0-alpha02 • Introduced parameter in Lazy APIs to compose and place out of viewport items (I69e89, b/172029355) • Added
    minLines
    parameter to the
    BasicText
    and
    BasicTextField
    . It allows to set the minimum height of these composables in terms of number of lines (I24294, b/122476634) • Added
    minLines
    parameter into material and material3 Text,
    TextField
    and
    OutlinedTextField
    which allows setting the minimum height of the component in terms of number of lines (I4af1d) • A bunch of "low level" compose-ui api changes. None of them make sense to me (as a user of compose ui) but might be worth checking out if you care about that sort of stuff Check out Android Dev Summit Part 2, Form Factors playlist with tons of GREAT compose content included (compose insets, compose navigation, small mention of compose for TV, etc) https://www.youtube.com/playlist?list=PLWz5rJ2EKKc9jBnpl83LH6oZc7nFIVSRq
  • j

    Jordi Saumell

    11/10/2022, 6:46 PM
    Hi all! I have a list within a LazyColumn and I do not know how to scroll to an item of the inner list. Can someone help me? I add more details in the reply
    a
    • 2
    • 7
  • d

    David Corrado

    11/10/2022, 8:04 PM
    How to make Text wrap like swiftUI. I have a bunch of test cases in the thread. Basically it seems like the rules if you have 2 Text next to each other. If one of the Text is short the other one can fill the available space. Then if both are long then both take 50%. 🧵
    k
    d
    +2
    • 5
    • 21
  • a

    Andy Himberger

    11/10/2022, 11:05 PM
    movableContentOf with subcomposeLayout not working in 1.3? I know there was an issue that it didn't keep remembered state in 1.2 to move between subcompose and not, but without that type of change it was working in 1.2 -- our usage now is crashing after upgrading to 1.3. Maybe similar to https://issuetracker.google.com/issues/258053979 but the callstack is completely different, and in our case there is just 1 arg (modifier) that we're passing right now...
    s
    • 2
    • 5
  • m

    Marco Pierucci

    11/11/2022, 12:02 AM
    Hello! 👋 I updated to compose 1.3.1 from 1.0.5 and suddenly my very basic signature component stopped working. It has to do with with
    pointerInteropFilter
    But not sure why, maybe someone has a few pointers. 🧵
    • 1
    • 3
  • o

    onirutlA

    11/11/2022, 4:17 AM
    Hi there does anyone know how to handle click on leading or trailing icon on text field compose
    z
    • 2
    • 1
  • z

    zt

    11/11/2022, 5:26 AM
    In the TextField composable code, I noticed it annotated the lambda for the decoration box with @Composable, however it works without it. Does the compiler do something different when it's there?
    z
    • 2
    • 3
  • z

    Zaki Shaikh

    11/11/2022, 7:24 AM
    Hi there I have a lazyColumn and each item in it has N children composable so every item has indefinite height I want to scroll to a specific child in an item let it be 3 no child in item #3 so I am only able to go to item but not able to scroll to child and every item has height of multiple of screen height anyone has the solution for it pls help me thank you.
    z
    • 2
    • 4
Powered by Linen
Title
z

Zaki Shaikh

11/11/2022, 7:24 AM
Hi there I have a lazyColumn and each item in it has N children composable so every item has indefinite height I want to scroll to a specific child in an item let it be 3 no child in item #3 so I am only able to go to item but not able to scroll to child and every item has height of multiple of screen height anyone has the solution for it pls help me thank you.
z

Zach Klippenstein (he/him) [MOD]

11/11/2022, 3:30 PM
If your lazy list has items that are larger than the view port, it would be better to break them down so the lazy list can actually do its thing.
But to your question, you could use BringIntoViewRequester on the child once the item is composed.
z

Zaki Shaikh

11/11/2022, 3:53 PM
Thanks I will try this
z

Zach Klippenstein (he/him) [MOD]

11/11/2022, 4:43 PM
Not sure if this will be useful, but FYI: https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/BeyondBoundsLayout
View count: 18