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

    Tower Guidev2

    11/18/2022, 3:58 PM
    Hi could anyone help with this swipe to dismiss issue i am having with lazy vertical grid? https://stackoverflow.com/questions/74492246/does-android-lazyverticalgrid-support-swipe-to-dismiss
  • i

    itnoles

    11/18/2022, 6:23 PM
    is there is a way to compare Flutter and Jetpack Compose for Animation?
    a
    • 2
    • 5
  • s

    Slackbot

    11/18/2022, 7:25 PM
    This message was deleted.
  • e

    enighma

    11/18/2022, 10:28 PM
    TouchDelegate in Compose It has probably been asked before, at least on SO. However, since compose evolve fairly fast I thought I'd ask if there's an API to do what Touch delegate does? as in a modifier property. The alternative is ofc to delegate it my self, but wanted to check before I did that.
    t
    z
    • 3
    • 9
  • i

    itnoles

    11/18/2022, 11:55 PM
    var timer by remember { mutableStateOf(time) }
        LaunchedEffect(key1 = timer) {
            if (timer > 0) {
                delay(1000L)
                timer -= 1000L
            }
        }
    Is this is best way to do timer per seconds?
    f
    s
    • 3
    • 2
  • c

    Colton Idle

    11/19/2022, 3:44 AM
    Anyone for the compose team use autofill? Any chance we can get this merged? https://android-review.googlesource.com/c/platform/frameworks/support/+/1984831
    r
    t
    • 3
    • 7
  • z

    Zaki Shaikh

    11/19/2022, 6:58 AM
    Hello everyone, I want to ask that if I have NavDestination Object in compose navigation how to get argument from it, checked its argument member variable but unable to grab arguments from it, thank you.
    m
    • 2
    • 1
  • j

    Jasmin Fajkic

    11/19/2022, 10:47 PM
    Hey peeps. I have Scaffold and bottom bar. On one of screens with bottom bar i have textfield and when i apply imepadding it also add bottom bar padding 😞. Any chance to exclude in this case bottom bar padding?
  • z

    zt

    11/20/2022, 5:00 AM
    How could I make a thing where you can swipe up or down and it cycles to the next or previous item, but it continues even if theres none left. Like the account switcher in most google apps
  • v

    v79

    11/20/2022, 9:05 AM
    When is the
    init { }
    block in a ViewModel called? The init block for Screen A's ViewModel doesn't seem to be triggered when swiping back from Screen B, for instance.
    y
    z
    +2
    • 5
    • 26
  • t

    Tolga ÇAĞLAYAN

    11/20/2022, 11:37 AM
    How can I create a Full Screen dialog? Dialog properties throw an error. Does anyone know of a different method?
    z
    • 2
    • 5
  • g

    Gordon

    11/20/2022, 1:12 PM
    I'm looking at the Icons declaration in compose, an i have a style question. Right now the icons declaration looks like this:
    public val Icons.Filled.Circle: ImageVector
        get() {
            if (_circle != null) {
                return _circle!!
            }
            _circle = materialIcon(name = "Filled.Circle") {
                materialPath {
                    moveTo(12.0f, 2.0f)
                    curveTo(6.47f, 2.0f, 2.0f, 6.47f, 2.0f, 12.0f)
                    reflectiveCurveToRelative(4.47f, 10.0f, 10.0f, 10.0f)
                    reflectiveCurveToRelative(10.0f, -4.47f, 10.0f, -10.0f)
                    reflectiveCurveTo(17.53f, 2.0f, 12.0f, 2.0f)
                    close()
                }
            }
            return _circle!!
        }
    
    private var _circle: ImageVector? = null
    And i wonder why doesn't it just use lazy initialization? As in something like this:
    public val Icons.Filled.Circle: ImageVector by lazy {
            materialIcon(name = "Filled.Circle") {
                materialPath {
                    moveTo(12.0f, 2.0f)
                    curveTo(6.47f, 2.0f, 2.0f, 6.47f, 2.0f, 12.0f)
                    reflectiveCurveToRelative(4.47f, 10.0f, 10.0f, 10.0f)
                    reflectiveCurveToRelative(10.0f, -4.47f, 10.0f, -10.0f)
                    reflectiveCurveTo(17.53f, 2.0f, 12.0f, 2.0f)
                    close()
                }
            }
        }
    Is it just a style issue? Or the second approach has hidden performance cost?
    l
    • 2
    • 4
  • n

    nuhkoca

    11/20/2022, 3:45 PM
    I am trying to implement new
    LazyStaggeredGrid
    but I want the first item to take the full width. Isn’t there a span strategy as in the
    LazyGrid
    ?
    • 1
    • 1
  • a

    Ahmed Shehata

    11/21/2022, 8:48 AM
    How can I make background color fill all screen except a portion of it (To be transparent)?
    j
    • 2
    • 7
  • m

    Marko Novakovic

    11/21/2022, 10:39 AM
    rememberSaveable(viewModel) { viewModel.onCreate(); 1 }
    with this I want to call
    onCreate()
    only once and that when
    @Composable
    is first created. but why is
    onCreate()
    called more than once? what am missing here? this can be related to other things in the app like DI setup for this etc. but I want to check is there something am missing about
    rememberSaveable
    c
    • 2
    • 5
  • a

    Ashish Gautam

    11/21/2022, 10:39 AM
    can anyone share the good approach to use tabLayout in compose , how do i use Accompanist pager lib effectively because this example is so easy that, like I have dependencies on my Composable screen.
  • m

    Moritz Post

    11/21/2022, 10:57 AM
    hello. I have a
    Flow
    which comes from the paging library. Until that flow can acutally be created (it needs some parameters from the user) i would like to create an empty flow that can be observed in compose. Something like
    val vacancies: Flow<PagingData<Vacancy>> = emptyFlow()
    Now the question is: once i create that PagingData flow, how can i replace the
    emptyFlow()
    with the new paging data flow while still keeping the state observation from compose intact?
    m
    • 2
    • 1
  • t

    Tower Guidev2

    11/21/2022, 11:54 AM
    Hi where have i made my mistake ? https://stackoverflow.com/questions/74518496/why-does-android-jetpack-compose-snapshotflow-re-emit-last-value-on-configuratio
    c
    z
    • 3
    • 6
  • s

    Stylianos Gakis

    11/21/2022, 1:13 PM
    I guess somewhat related to this discussion, got a question regarding compose navigation, process death recreation and dynamic backend driven routes.
    c
    s
    p
    • 4
    • 16
  • f

    Fahime Ghasemi

    11/21/2022, 2:11 PM
    Hi, I’ve implemented an android app that uses Paging Library for showing list. There is a search bar that shows a progress icon when I enter a keyword for searching. I want to change that progress icon when the result of search comes. My problem is that when I change the state related to search bar icon nothing happens. I’ll send the screen shot of my app and the codes related to search bar, feed list and search screen. I’m be very thankful if somebody helps me
    c
    • 2
    • 6
  • f

    Fahime Ghasemi

    11/21/2022, 2:16 PM
  • n

    Nikolas Guillen Leon

    11/21/2022, 2:43 PM
    hi, is there a way to get data from onGloballyPositioned modifier only once? I have an Image composable (which is zoomable) and I need to get its initial width and height, but I don't want to update it when I zoom. Here's how I'm getting image's width and height on the device screen right now
    .onGloballyPositioned { layoutCoordinates ->
        imageHeight =
            with(localDensity) { layoutCoordinates.size.height.toDp() }
        imageWidth =
            with(localDensity) { layoutCoordinates.size.width.toDp() }
    }
    And I'm using them in an offset calculation like this
    val offsetTop = windowInfo.screenHeight.minus(imageHeight).div(4)
    val offsetStart = windowInfo.screenWidth.minus(imageWidth).div(4)
    t
    • 2
    • 4
  • n

    Nikolas Guillen Leon

    11/21/2022, 2:44 PM
    zooming makes the imageHeight and ImageWidth update, which changes the offsets
  • m

    myanmarking

    11/21/2022, 3:32 PM
    what is the correct api if we want to draw text with a border ?
    c
    z
    h
    • 4
    • 29
  • m

    myanmarking

    11/21/2022, 4:26 PM
    Im using compose 1.3.2 and want to update to 1.4.0-alpha02 and kotlin 1.7.21
    g
    • 2
    • 6
  • s

    Sam Stone

    11/22/2022, 3:22 AM
    What is the earliest iOS version that compose will run on? The Falling Balls MPP sample app runs on iOS 14.1. and the earliest iphone mentioned in this
    enum
    is the iphone 6s
  • k

    K Merle

    11/22/2022, 5:58 AM
    Anyone know about any jetpack compose image cropping library?
    o
    d
    • 3
    • 4
  • s

    statmark56

    11/22/2022, 6:08 AM
    I have
    TopAppBar
    with
    title
    set with
    Text
    composable but with very long text. I expect the AppBar can adjust its height to follow the long text but apparently it sticks with default 56.dp. My question is there a way to automatically adjust the height or I should measure it manually as the only way?
  • r

    rsktash

    11/22/2022, 6:55 AM
    Hi how can we make blur effect with a hole? I want to blur outside a box on a live camera

    https://i.stack.imgur.com/fwlgM.gif▾

    j
    l
    +4
    • 7
    • 27
  • r

    ritesh

    11/22/2022, 8:23 AM
    I was wondering why i am able to access
    androidx.compose.ui.platform.AndroidComposeView
    inside xml, even though they are marked as internal in
    platform
    module. Why linter isn't throwing any error?
    e
    • 2
    • 3
Powered by Linen
Title
r

ritesh

11/22/2022, 8:23 AM
I was wondering why i am able to access
androidx.compose.ui.platform.AndroidComposeView
inside xml, even though they are marked as internal in
platform
module. Why linter isn't throwing any error?
e

ephemient

11/22/2022, 1:13 PM
Android inflates XML by using Java reflection which does not know anything about Kotlin's internal visibility. as far as the framework is concerned, those classes are public
r

ritesh

11/22/2022, 1:17 PM
Inflation happens when you call
LayouInflator.inflate
isn't it? And that when it creates a view tree in Java?
I mean, should be there be a linter for xml's which can look out for modifiers.
View count: 7