• b

    Bino

    1 year ago
    How do I set a gradient background to a card correctly?
    Card(modifier = Modifier.background(linear))
    Will set the background behind the card
    Card(backgroundColor = cardBackground)
    will only accept
    Color
    and no
    Brush
    b
    1 replies
    Copy to Clipboard
  • d

    Daniele B

    1 year ago
    I would like to change the color of both
    iconComposable
    and
    textComposable
    based on the
    selected
    flag. How should I do this correct?
    d
    b
    +1
    8 replies
    Copy to Clipboard
  • Ravi

    Ravi

    1 year ago
    i've created helper function related to spacer and invoking them like this :-
    SpaceHeight(16.dp)
    ,
    SpacerWidth(16.dp)
    . After rolling out to beta channel we are observing crashes on some devices, more in the thread
    @Composable
    fun SpacerHeight(size: Dp) {
        Spacer(modifier = Modifier.height(size))
    }
    
    @Composable
    fun SpacerWidth(size: Dp) {
        Spacer(modifier = Modifier.width(size))
    }
    Ravi
    3 replies
    Copy to Clipboard
  • a

    alorma

    1 year ago
    Hello. Is it possible to know on
    LazyListScope.stickyHeader { ... }
    to know when it's being sticked to the top? For example to make it different color, or have some elevation
    a
    1 replies
    Copy to Clipboard
  • Shakil Karim

    Shakil Karim

    1 year ago
    Hi, I'm trying to create a custom layout that needs to match the design on the right, is there a way to measure a text height based on Text Size
    Shakil Karim
    Cicero
    13 replies
    Copy to Clipboard
  • s

    Slackbot

    1 year ago
    This message was deleted.
    s
    1 replies
    Copy to Clipboard
  • b

    Brian G

    1 year ago
    Does Compose provide a way to measure intrinsic text width/height, synchronously, offscreen OUTSIDE of @Composable function? I'm integrating with a legacy system and it requires measuring certain things ahead of time, with View's you can simply do:
    val view = MyView(context)
    view.measure(widthMeasureSpec, heightMeasureSpec)
    return Pair(textView.measuredWidth, view.measuredHeight)
    I guess I could use
    ComposeView
    for this but I'm wondering if there is something more directly available in Compose API.
    b
    Adam Powell
    8 replies
    Copy to Clipboard
  • Zhelyazko Atanasov

    Zhelyazko Atanasov

    1 year ago
    I'm looking at the animation API and either I'm missing something (most likely) or it's harder to implement this using Compose. I want to implement a shake/wiggle animation. Imagine a
    TextField
    and a button. When the user clicks the button, if the value in the
    TextField
    is not correct or empty, I'd like to move the
    TextField
    to the left/right a few times to draw the user's attention. In a
    View
    world I can do something like this:
    ObjectAnimator
      .ofFloat(myTextInput, "translationX", 0, 25, -25, 25, -25,15, -15, 6, -6, 0)
      .setDuration(duration)
      .start();
    But with Compose I can't figure out a way to have the current and target value be the same. The direction I went into is to use
    animateDpAsState
    together with
    keyframes
    animation spec to animate the
    offset
    of my
    TextField
    and it does the job. My issue is how to trigger the animation.
    Zhelyazko Atanasov
    Zach Klippenstein (he/him) [MOD]
    8 replies
    Copy to Clipboard
  • t

    Tin Tran

    1 year ago
    Hi guys! I think that I'm having a race condition here with
    ModalBottomSheetLayout
    . Code in 🧵
    t
    Ravi
    13 replies
    Copy to Clipboard
  • Archie

    Archie

    1 year ago
    Anyone lost Android Studio’s
    Interactive Mode
    on 4.2 Beta? I can’t seem find out why its missing?
    Archie
    t
    +2
    5 replies
    Copy to Clipboard