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

    Stylianos Gakis

    08/10/2022, 7:47 AM
    We were thinking with some of our QA engineers to look into starting an effort to have them write some UI tests with something like appium (or whatever alternative) but I was worried that now that our App is a hybrid of View/Compose this might be more tricky than it already is. Has someone gone down that road? Got any resources to share regarding it? Maybe I’m missing some part of the official docs. Everything I’ve tried to look regarding such tests with Appium (Maybe appium is the wrong path for them to take) seems to be from 4+ years ago so no mention of compose whatsoever.
    c
    • 2
    • 4
  • t

    Tin Tran

    08/10/2022, 8:44 AM
    Is this considered “Stable”?
    @Stable
    class Foo {
       var fieldA: Boolean by mutableStateOf(false)
    }
  • n

    nlindberg

    08/10/2022, 11:07 AM
    Is there a character you can use that looks like a space but is not treated as one when a Text is overflowing into a new line so you can control that multiple words including “spaces” will overflow together?
    a
    • 2
    • 2
  • a

    AmrJyniat

    08/10/2022, 1:07 PM
    I'm starting a new project with Compose, but I tend to use fragments(and use ComposeView inside them) instead of pure compose for several reasons: 1- I see one activity multiple fragments architecture is more constant than pure Compose (correct me). 2- I like Navigation component with safeArgs that Compose doesn't support, although, I heard a lot of complaints about NC Compose. 3- I need an easy way to write XML code if I faced any blocked issue with Compose or when I need it. Any tip/resource apricated :)
    s
    • 2
    • 1
  • k

    KotlinLeaner

    08/10/2022, 2:56 PM
    I have textfield and end drawable which is info type. When I click on that I want to open this popup menu look like this. I don't know what we call this. Anyone guide me how can I make like this?
    n
    • 2
    • 2
  • d

    dimsuz

    08/10/2022, 3:08 PM
    I have a weird API design consideration. I'm writing a container which can arrange and animate its items
    val state = rememberNiceState(itemPositions: Positions.Stage0)
    NiceContainer(
      itemCount = 3,
      state: NiceState = state,
      itemContent = { index -> MyItem(index) }
    )
    LaunchedEffect(Unit) {
      state.animateItems(Positions.Stage1)
    }
    The problem is that to calculate an (x,y) of each item given the "stage" I need to know the
    itemsCount
    : both in State consctructor and in
    animateItems
    . I could make
    itemCount
    private val in State, but I do not want to require user to pass
    itemsCount
    both to
    NiceContainer
    composable and to State constructor, this feels weird. Similarly passing
    itemCount
    only to State constructor and removing it from
    NiceContainer
    argument list feels not like something you do in other composable container layouts... Any suggestions?
    • 1
    • 1
  • a

    Alejandro Rios

    08/10/2022, 3:52 PM
    Hello everyone, I have a question that maybe you have already answered, why the
    @Preview
    does not work in libraries, I am creating a library of components for my project, but the previews do not load, one of the proposed "solutions" was to include
    androidx.appcompat:appcompat
    in the library, I did it but it still does not work, do you know anything about it?
    s
    c
    c
    • 4
    • 4
  • e

    Emmanuel

    08/10/2022, 6:30 PM
    What should be done when a component has too many inputs and events? Is there such a thing as too many inputs/events from a single component?
    MyComponent(
      input1...,
      inputN,
      event1...,
      eventN
    )
    d
    s
    c
    • 4
    • 10
  • j

    Jaime

    08/10/2022, 6:34 PM
    Hello everyone, I have a strange error, has anyone else experienced this error?
    s
    a
    • 3
    • 5
  • c

    Colton Idle

    08/10/2022, 7:02 PM
    Been writing compose apps for like a year+ (3 fully compose apps shipped to prod) I've never written
    @Stable
    in any of my codebases. 🙈 Am I missing something basic here? Should I be marking classes as stable?
    s
    s
    +3
    • 6
    • 10
  • a

    aoriani

    08/10/2022, 7:47 PM
    I'm trying to implement a PIN entry text field, therefore it can only accept digits and it has a fixed number of digits. I was considering using
    BasicTextField
    and its
    onValueChanged
    parameter to filter out any non-digit character. However, reading the documentation I found this :
    Please keep in mind that
    onValueChange
    is useful to be informed about the latest state of the text input by users, however it is generally not recommended to modify the value that you get via
    onValueChange
    callback. Any change to this value may result in a context reset and end up with input session restart. Such a scenario would cause glitches in the UI or text input experience for users.
    Does that mean that something like
    var text by rememberSaveable { mutableStateOf("") }
    BasicTextField(
        value = text,
        onValueChange = { input ->
            text = input.filter { it.isDigit() }.take(5)
        }
    )
    could be a problem because I am not passing
    input
    as is to
    value
    ?
    s
    e
    • 3
    • 6
  • j

    Jaime

    08/10/2022, 10:18 PM
    Hello, I have a problem with
    isSystemInDarkTheme()
    I am adding it to the theme but sometimes it returns true after false
    2022-08-10 17:12:22.215 6489-6489/ E/isSystemInDarkTheme: true darkMode 
    2022-08-10 17:12:23.338 6489-6489/ E/isSystemInDarkTheme: true darkMode 
    2022-08-10 17:12:24.478 6489-6489/ E/isSystemInDarkTheme: false darkMode 
    2022-08-10 17:12:30.008 6489-6489/ E/isSystemInDarkTheme: false darkMode 
    2022-08-10 17:12:30.697 6489-6489/ E/isSystemInDarkTheme: false darkMode
    @Composable
    fun Theme(
        darkTheme: Boolean = isSystemInDarkTheme(),
        content: @Composable () -> Unit
    ) {
        val colors = if (darkTheme) {
            DarkColorPalette
        } else {
            LightColorPalette
        }
    
        ProvideHapiColors(colors) {
            MaterialTheme(
                colors = if (darkTheme) darkColors() else lightColors(),
                typography = Typography,
                shapes = Shapes,
                content = content
            )
        }
    }
    c
    • 2
    • 10
  • c

    Colton Idle

    08/11/2022, 2:47 AM
    New compose versions released today 🎉. Some interesting things from my pov stable • 1.3.0 stable of compose compiler • 1.2.1 stable of most other artifacts • 1.2.1 stable releases are pretty minor but it did fix a memory leak and some layout inspector issues alpha • 1.3.0-alpha03 is avail • New param in
    Crossfade
    ,
    animateAsState
    and
    Animatable
    for tooling label • Added
    atFraction
    function for defining keyframes at a fraction instead of at a specific duration. • Resource Fonts now support setting font variation settings (API 26+). • Variable font support in
    DeviceFontFamilyNameFont
    • Text fields will now throw more detailed exceptions when the
    OffsetMapping
    provided by a
    VisualTransformation
    returns invalid indices. • Introduce experimental APIs to share item provider logic between Lazy layouts. 🤔 • Deprecate
    TextInputService.show|hideSoftwareKeyboard
    . Please use
    SoftwareKeyboardController
    instead in app code and
    TextInputSession
    in IME-management code •
    LayoutCoordinates.findRootCoordinates()
    is now public • Added experimental API to get the
    LayoutCoordinates
    in the
    PlacementScope
    . This lets developers know where the current layout is to place children relative to its position • Paragraph is now expect|actual and defined for Android and Desktop. • Added
    @RequiresPermission
    to APIs that require granting the
    POST_NOTIFICATIONS
    permission on SDK 33 and above. material 3 • 1.0.0-alpha16 • Support specifying a custom width on a navigation drawer • Removes
    Divider
    from
    MenuDefaults
    and
    TabDefaults
    o
    s
    • 3
    • 2
  • v

    vide

    08/11/2022, 7:30 AM
    I have asked a similar question before here when I was just starting with compose but I still feel a bit confused now that I ran into this section of the documentation: Defer reads as long as possible (https://developer.android.com/jetpack/compose/performance#defer-reads) which states:
    You should defer reading state variables as long as possible. Deferring state reads can help ensure that Compose re-runs the minimum possible code on recomposition. For example, if your UI has state that is hoisted high up in the composable tree and you read the state in a child composable, you can wrap the state read in a lambda function. Doing this makes the read occur only when it is actually needed.
    All other documentation and examples seem to prefer passing only immutable data classes for state -- is this deferring technique recommended only for the most intensive cases (for example animations with values changing every frame)? To my understanding, when a value changes, the whole scope that read it is recomposed, including all child composables (unless the inputs are @Stable in which case all of the inputs will be diffed and recomposed only if the inputs are different). What is the downside of doing deferred reads and passing
    State
    , how much overhead does it add compared to diffing all parameters of invalidated child composables in a large invalidated scope? Also, does it matter how the state read is deferred? I have preferred not to use the delegate syntax for mutableStateOf so I can easily pass
    State<T>
    objects directly to child composables. Is there some reason why the provided example uses a callback and not something like this:
    @Composable fun Child(state: State<T>) { state.value }
    ?
    o
    • 2
    • 4
  • n

    Napa Ram

    08/11/2022, 7:41 AM
    Hi, I am using Parent Layout as Column and then adding vertical Scroll state, inside column i have used AndroidView With RecyclerView now my problem is how i can addOnScrollListener on scroll so i can add functionality based on recyclers scroll.
    • 1
    • 1
  • a

    AmrJyniat

    08/11/2022, 7:52 AM
    Can I set
    ViewCompositionStrategy
    to the ComposeView from the XML?
  • a

    Asad Mukhtar

    08/11/2022, 8:21 AM
    Hi everyone, why content not scroll in Compose, even i add adjustResize in the manifest and also keyboard opened but not scrolling not worked.
    Column(
            modifier = Modifier
                .fillMaxSize(1f)
                .background(color = Color.White)
                .verticalScroll(state = rememberScrollState(),
        ) {
            HeaderSection("Welcome!", "It's great to have you here") {
                viewModel.events.postValue(AuthModuleClickEventsObject.BACK_CLICK)
            }
            ContentSection(
                modifier = Modifier
                    .background(
                        color = Color(0xFFF3F6F9),
                        shape = RoundedCornerShape(topStart = 34.dp, topEnd = 34.dp)
                    )
                    .fillMaxWidth()
                    .fillMaxHeight()
                    .padding(horizontal = 17.5.dp),
                {}, {
                    viewModel.events.postValue(AuthModuleClickEventsObject.FORGOT_PASSWORD_CLICK_EVENT)
                })
        }
    z
    o
    • 3
    • 6
  • n

    natario1

    08/11/2022, 10:12 AM
    Are there any plans to improve stability inference? It looks to me like this, but also many more complex, super common structures could be inferred to be stable by the compiler (may not be straightforward, but still, possible). https://kotlinlang.slack.com/archives/CJLTWPH7S/p1660121060190209
  • a

    Asad Mukhtar

    08/11/2022, 10:40 AM
    Hi all, is there anyone also facing the issue of Column didn`t scroll when keyboard open even i added verticalScroll state.
  • z

    Zoltan Demant

    08/11/2022, 11:06 AM
    How can a function with unstable values be restartable & skippable? All documentation Ive read on the subject tells me that this is impossible, or is it?
    restartable skippable scheme("[androidx.compose.ui.UiComposable]") fun BottomBar(
      unstable pages: List<ExplorePage>
      stable currentPage: ExplorePage
    )
    i
    s
    +3
    • 6
    • 10
  • h

    harry.singh

    08/11/2022, 2:07 PM
    Hey all! Is there a way to pass a click event from top view to bottom view in overlapping views? I've a
    Column
    overlapped by a
    LazyList
    (trying to implement a nested scroll) and I was wondering if there's a way to pass click events to the
    Column
    beneath and scroll events be handled by the
    LazyList
    itself. I want to preferably do this only for the first item in the list. Is something could be done in Compose today?
  • l

    Lukasz Kalnik

    08/11/2022, 2:19 PM
    Are there any good solutions for typesafe and boilerplate free Compose Navigation? 1. For specific navigation graph only a certain set of destinations (sealed class hierarchy/enums) can be passed to
    navigate()
    2. Pass navigation arguments (like item IDs) in a typesafe manner 3. Automatically generate the route URIs with argument placeholders 4. Easily extract the navigation arguments without additional boilerplate I'm writing extension functions and sealed class hierarchies/enums for this, but this is such a common use case that maybe someone already came up with a library (or at least someone of you has good suggestions).
    i
    • 2
    • 6
  • r

    Richard Steventon

    08/11/2022, 3:00 PM
    Does anyone know how to get the contents of a compose Row to be spaced by a minimum amount, but if the parent is larger, to then increase that spacing size? A combination of
    Arrangement.spacedBy
    and
    Arrangement.SpaceBetween
    ?
    c
    c
    • 3
    • 7
  • j

    John Nichol

    08/11/2022, 3:39 PM
    There is an animateItemPlacement modifier
    s
    c
    +2
    • 5
    • 10
  • r

    Rick Regan

    08/11/2022, 5:20 PM
    Is it OK to pass mutable state across a nested graph? I have screens in a
    NavHost
    where each
    composable {}
    contains a Composable function that is passed State representing the app’s settings (the State’s value actually, originating as
    by mutableStateOf
    above
    NavHost
    ). I decided to separate out all the settings screens into a subgraph (same module) using an extension function called
    NavGraphBuilder.settingsNavGraph
    . In order to get the state to continue to track in the screens now moved into the subgraph, I pass a lambda to
    settingsNavGraph
    that reads the
    .value
    of the settings. (Locally, just above the
    NavHost
    call, I declared
    val settingsAsState = rememberUpdatedState(settings)
    in order to set this up.) This seems to work well, but I wanted to know if it was OK to do so, or if there is a better way. (The Compose Owl sample app does something similar, passing a
    State<>
    to the extension function – but it looks like it is the only sample app that does this.)
  • t

    Tiago Nunes

    08/11/2022, 5:50 PM
    Hi guys, I'm facing an issue with compose
    navigation-animation
    : When I interrupt the transition to another screen by pressing the back button, the animation gets bugged (List screen moves up a bit). I found this issue tracker link, which is probably the cause: AnimatedContent sets incorrect target animation on interrupt Has this ever happen to any of you, and is there a solution? In the video, you can see the expected behaviour happening in the second attempt, and the bug happens in the first and third attempts.
    z
    i
    f
    • 4
    • 8
  • j

    Jose Carlos Hernandez

    08/11/2022, 6:21 PM
    Hi guys, I’m trying to validate a TextField with Jetpack Compose using StateFlow on a ViewModel I saw an example that looks like this:
    val isButtonEnabled: StateFlow<Boolean> =
            combine(isLoading, login, password) { isLoading, login, password ->
                isLoading.not() && login.isNotBlank() && password.isNotBlank()
            }.stateIn(viewModelScope, SharingStarted.Eagerly, false)
    But I only have 1 field instead to validate so I try to put it like this
    val isContinueEnable: StateFlow<Boolean> = MutableStateFlow(login.value.isNotBlank())
            .stateIn(viewModelScope, SharingStarted.Eagerly, false)
    but when I start typing on the TextField it doesn’t change de value to
    true
    so is there a method similar to
    combine
    to get
    Flow
    but just with one element?
    l
    • 2
    • 3
  • z

    zsperske

    08/11/2022, 9:14 PM
    Does
    Locale
    make sense as a composition local? How do y’all handle things like
    uppercase()
    which accepts a locale argument?
    j
    • 2
    • 2
  • m

    Mohan manu

    08/12/2022, 4:18 AM
    When we navigate from screen “A” to screen “B”. Screen “B” has some default background Color. How do make this screen B partially transparent so that I can see screen A . Thanks in advance 🙏
    c
    i
    • 3
    • 10
  • c

    Christoph Wiesner

    08/12/2022, 8:12 AM
    Question around sharing VMs with hilt and compose navigation having following navGraph
    NavHost(navController, startDestination = "home") {
        composable("home") {
            Home(/* uses viewModel by hiltViewModel() */) 
        }
        subGraph()
    }
    
    fun NavGraphBuilder.subGraph() {
    	composable("subDestination") {
    		MyComposable()
    	}
    }
    
    fun MyComposable(
    	viewModel by hiltViewModel(/* Home backstackEntry ?*/)
    )
    I want to share VM between the “Home” and the nested destination in the subgraph. I’m not passing down the navController to nested graphs to avoid dependencies to navigation in there. Is there a way I get the home backStackEntry for my nested destination still without quering it in place? Passing the entry down from top level does not work as when building the graph intially there is not yet a backStackEntry to query
    • 1
    • 1
Powered by Linen
Title
c

Christoph Wiesner

08/12/2022, 8:12 AM
Question around sharing VMs with hilt and compose navigation having following navGraph
NavHost(navController, startDestination = "home") {
    composable("home") {
        Home(/* uses viewModel by hiltViewModel() */) 
    }
    subGraph()
}

fun NavGraphBuilder.subGraph() {
	composable("subDestination") {
		MyComposable()
	}
}

fun MyComposable(
	viewModel by hiltViewModel(/* Home backstackEntry ?*/)
)
I want to share VM between the “Home” and the nested destination in the subgraph. I’m not passing down the navController to nested graphs to avoid dependencies to navigation in there. Is there a way I get the home backStackEntry for my nested destination still without quering it in place? Passing the entry down from top level does not work as when building the graph intially there is not yet a backStackEntry to query
for now i did quite a verbose solution: the nested destination looks as follows:
@Composable
fun NestedDestinationComposable(
    backStackEntry: NavBackStackEntry,
    vm: MyViewModel = hiltViewModel(backStackEntry))
the nested navgraph has a callback to get the actual backStackEntry
NavGraphBuilder.goalNavGraph(
    getSharedBackStackEntry: () -> NavBackStackEntry,) {
  composable() {
     NestedNavComposable(
        remember { getSharedBackStackEntry()}
     )
  }
}
the top level navgraph
NavHost(
    navController,
    startDestination = "Home"
) {
    composable("Home") {
        HomeScreen()
    }
    subGraph(
        getSharedBackStackEntry = { navController.getBackStackEntry("Home") },
        ...
    )
}
View count: 9