• v

    Vinay Gaba

    1 year ago
    Noticing some weird issues as I’m trying to upgrade my library to beta-01. Think that some mutable state values are only being propagated once I minimize the app and open it again. Anyone notice something of this flavor or an existing bug that might’ve been discussed already?
    v
    Adam Powell
    6 replies
    Copy to Clipboard
  • s

    Shivam Sethi

    1 year ago
    any idea, why getting a context is giving an error here:
    s
    k
    3 replies
    Copy to Clipboard
  • a

    aherbel

    1 year ago
    Hi, can someone tell me what are the replacements for these functions?
    a
    k
    +1
    5 replies
    Copy to Clipboard
  • Samir Basnet

    Samir Basnet

    1 year ago
    @Composable
    fun ProgressStep(modifier:Modifier,max: Int, current: Int) {
        Layout(modifier = modifier,
            content = {
                for (i in 1..max)
                    StepCircle(step = i, color = if (i <= current) purple else Color.Gray)
    
            }) { measurables, constraints ->
    
            val startPoint = (constraints.maxWidth/max)/2
    
    
            val placeables = measurables.map { measurable ->
                measurable.measure(constraints.copy(minWidth = 0))
            }
            layout(constraints.maxWidth, constraints.minWidth) {
                var xPosition = startPoint
                placeables.forEachIndexed { index, placeable ->
                    placeable.place(x = xPosition-11, y = constraints.maxHeight / 2)
                    xPosition += (startPoint * 2)
                }
            }
        }
    }
    i noticed the mesurements here are accepted in Integer so the gap after the last item in less compared to others. how am i supposed to gap equally here?
    Samir Basnet
    1 replies
    Copy to Clipboard
  • Samir Basnet

    Samir Basnet

    1 year ago
    Also has anyone built a ProgressSteps View in Compose?
    Samir Basnet
    l
    3 replies
    Copy to Clipboard
  • l

    Lukasz Burcon

    1 year ago
    Hey, I was working on implementing a wrappable Text compose function that doesn’t overlap any other view in the same row and instead takes all the available space and becomes a multiline text view. The problem is that even if it was wrapContent, it took all the available space while measuring (typical behaviour). I needed the width of multiline text to be the same as the X coordinate of the last letter in the longest row to match my design’s paddings. I had to create a custom
    Layout
    and measure it in multiple layout passes as you can’t call
    measurables.measure()
    multiple times in the same
    layout
    section. Do you guys plan on opening MultiMeasureLayout API that’s internally used in ConstraintLayout so I don’t have to do multiple layout passes and just remeasure my view in one layout pass? Or is there any better solution to my problem you know about?
    l
    Halil Ozercan
    2 replies
    Copy to Clipboard
  • g

    Gabriel

    1 year ago
    How comes AlertDialogs don't show in previews? Should I be using straight Dialog? Or would that have the same issue?
    g
    1 replies
    Copy to Clipboard
  • Adriano Celentano

    Adriano Celentano

    1 year ago
    Is it possible to know the ime padding before the ime is shown ? would be cool to use the keyboard as source of truth for animations.
    Adriano Celentano
    jim
    +2
    15 replies
    Copy to Clipboard
  • d

    Daniel

    1 year ago
    I'm writing an ebook reader. I needed custom text drawing, so I needed to implement my own text selection. I've got that mostly working using ~700 lines of code copied from Jetpack compose internal and private functions and lightly modified. My current problem is that I detect drag events on the handles, but the handles are very small. The unit of selection is the character or word, and the handles should be at the start and end of the selection. That means the handles should jump as you drag them. The problem is then that as you drag the pointer goes temporarily out of the touch area for the handle between snaps, and thus I don't get drag events. I could just add some padding around the handles to increase the touch area, but that wouldn't have quite the behavior I want. I want to specify that a drag event must start with a pointer down in a small area, but can continue with a pointer move in a larger area. I could also just implement that myself (looking at the source PointerInputScope.detectDragGestures, it seems relatively straightforward) but I want to make sure there isn't a better way to do this. I'm also a bit puzzled by why Jetpack's implementation of handles doesn't run into the same issues, as it's almost the same code as I'm using.
    d
    jim
    2 replies
    Copy to Clipboard
  • s

    Shivam Sethi

    1 year ago
    Hello, how can I create a viewModel as in documentations using =viewModel() as default with a ViewModel with dependencies injected to it with Hilt ?
    s
    a
    +3
    13 replies
    Copy to Clipboard