• d

    dimsuz

    11 months ago
    I need to inform the grand-grand-[grand]-parent of LazyRow that scroll is in progress. What is the most idiomatic way to do this? Code in thread.
    d
    Albert Chang
    3 replies
    Copy to Clipboard
  • Daniele Segato

    Daniele Segato

    11 months ago
    Is there some documentation explaining the differences from
    Layout
    and
    SubcomposeLayout
    ? what changes in performances? Why do we need a
    SubcomposeLayout
    for
    BoxWithConstraints
    ? A lot of the time all you want is the size (width / height) of the composable, which you can get with
    Modifier.onSizeChanged {}
    or
    Modifier.onGloballyPositioned {}
    but it is asynchronous: you need to wait for the first composition before you get a callback to that, which means if you need the size of the widget to do something on the UI you'll have a flickering. Can someone give me an in-depth answer or a link with an in-depth answer to these things? What I'm most interest in is what are the drawback of using subcompositions and what are all the options to get the layout constraints / why we need subcomposition to get them before composing (modifiers have access to them). EDIT: for instance
    IntrinsicSize
    stop working if a child has
    BoxWithConstraints
    right? Thanks
    Daniele Segato
    Andrey Kulikov
    +2
    4 replies
    Copy to Clipboard
  • Napa Ram

    Napa Ram

    11 months ago
    HI Team anyone integrated ktlint with compose project ?
    Napa Ram
    Csaba Kozák
    +1
    5 replies
    Copy to Clipboard
  • Ashu

    Ashu

    11 months ago
    Are preview functions removed from release build by Proguard or R8?
    Ashu
    p
    +1
    5 replies
    Copy to Clipboard
  • Vivek Sharma

    Vivek Sharma

    11 months ago
    Is there something I can use to erase things, like kinda erasing images or text on gesture, do I need Canvas for that?
    Vivek Sharma
    1 replies
    Copy to Clipboard
  • Marcello Galhardo

    Marcello Galhardo

    11 months ago
    What is the appropriated way to load a dimension resource as SP? Currently
    dimensionResource
    returns a DP value and it looks like there is no support to SP at all in the docs: https://developer.android.com/jetpack/compose/resources
    Marcello Galhardo
    f
    2 replies
    Copy to Clipboard
  • a

    Anton Shilov

    11 months ago
    Hello folks! Is there a way to get the current progress of
    Transition
    on a more granular level rather than current/target state? I'm trying to use
    Transition.playTimeNanos
    and
    Transition.totalDurationNanos
    . But total duration is calculated only in seek mode, which as I assume is reserved for tooling. cc @Doris Liu
    a
    Zach Klippenstein (he/him) [MOD]
    4 replies
    Copy to Clipboard
  • Chris Fillmore

    Chris Fillmore

    11 months ago
    Is there a way to make text wrap in a
    BasicTextField
    , while still enforcing
    singleLine
    ? I don’t want newline characters, and I don’t want the user to have to horizontal scroll.
    Chris Fillmore
    1 replies
    Copy to Clipboard
  • Rick Regan

    Rick Regan

    11 months ago
    I'm trying to determine the best way to manage changes in UI state when the screen configuration changes. I use the width provided within
    BoxWithConstraints
    to compute the number of a particular UI element that can fit on the screen. Let’s say I want two elements when the width is “portrait” and three when it is “landscape”. These elements display editable state that I want retained across rotations, so that when the third element is rotated off screen and then back on, it displays its old data. (My state is “global”, so I’m not talking about
    rememberSaveable
    .) The composable I've written that detects the rotation puts out the appropriate number of elements and then uses a
    SideEffect
    to tell the state what the number of elements is. This seems backwards, since it’s like the state change is reacting to the UI change. (Another detail that may be relevant: I have a button that “tabs through” the visible elements, so that button’s callback needs to check the state to know what’s on screen.) Now I’m thinking that instead I should use a
    LaunchedEffect
    (with key the number of elements) to update the state and then use the number of elements as recorded in the state (rather than in the local variable as above) to generate the elements. This seems more natural, almost like making configuration change a callback. In any case, I wanted to ask about best practices before I got too far off track. Thanks.
    Rick Regan
    Alex Vanyo
    14 replies
    Copy to Clipboard
  • Danish Ansari

    Danish Ansari

    11 months ago
    Since the
    LazyVerticalGrid
    is experimental. Is there any workaround to create grid list using
    LazyColumn
    ?
    Danish Ansari
    Albert Chang
    +1
    7 replies
    Copy to Clipboard