• m

    maaxgr

    1 year ago
    I'm searching for a UI component to display a log file onto the screen. The User should be able to scroll through the log file. The Log file can be huge, so it should probably load the needed rows lazy Is there anything for that in jetpack compose or a library you know? It es quite difficult to search for "log file jetpack compose" because the answers most of the time refer to logcat or other Android Studio components
    m
    Will Shelor
    2 replies
    Copy to Clipboard
  • s

    ste

    1 year ago
    Is there a way to animate (e.g. crossfading) a text change?
    s
    1 replies
    Copy to Clipboard
  • s

    Steve C

    11 months ago
    Hello everyone. Pretty new to working with compose, and I'm a bit stuck on animations. I've done quite a bit of searching, but I'm still stuck. I know I just don't know the proper syntax, but can't find a relevant example so I am reaching out for help here. Can anyone enlighten me on the correct way to use a different tween for different states? Here's what I have, but I get a compile error of "Not enough information to infer type variable T" if I put the tween call in a conditional:
    val transition = updateTransition(starState, label = "twinkle transition")
    
    val alpha: State<Float> = transition.animateFloat(transitionSpec = {
        if (StarState.IDLE isTransitioningTo StarState.TWINKLE) {
            tween(durationMillis = 3000, easing = LinearOutSlowInEasing)
        } else {
            tween(durationMillis = 1500, easing = LinearOutSlowInEasing)
        }
    
        tween(durationMillis = 3000, easing = LinearOutSlowInEasing)
    }, label = "alpha transition") { state ->
        if (state == StarState.TWINKLE) 1F else 0F
    }
    s
    1 replies
    Copy to Clipboard
  • k

    Koneko Toujou

    11 months ago
    how does Compose solve the following problem? there exists a Row with a child Row the child Row must know what it's size will be in order to compute how to place it's children but the parent Row cannot know the size of it's child Row until it has measured the child Row, and the child Row cannot know what it's size will be until the parent Row has measured it for example parent Row
    measure child Row
    child Row needs to know how big it will be in order to be able to layout it's children
    child Row needs information from parent Row
    parent Row has no information because it is still trying to measure child Row
    parent Row does not know how big child Row should be
    child Row does not know how big parent Row wants child Row to be
    child Row cannot measure itself reliably without assuming how big it is going to be
    k
    Adam Powell
    2 replies
    Copy to Clipboard
  • b

    Bjarne Gelotte

    11 months ago
    Hey! I'm curious about how
    elevation
    works in Compose. If two
    Surfaces
    with the same
    elevation
    are directly adjacent, they still cast a shadow on each other. How come? Is it possible to avoid this somehow? I would be super grateful for some guidance! Example and code in thread.
    b
    n
    +2
    9 replies
    Copy to Clipboard
  • Hachemi Hamadi

    Hachemi Hamadi

    11 months ago
    Hello, I am wondering how to maintain a global state in Compose, like I have a user that i fetch from my backend, and i want to be able to access the user object throughout the app lifecycle
    Hachemi Hamadi
    1 replies
    Copy to Clipboard
  • s

    ste

    11 months ago
    This might be another snippet that triggers a compiler error. However, my compose version is not the latest (and I'm unable to upgrade it right now). Would you tell me if it's not fixed yet, so I can open an issue? (similar version that compiles in thread).
    @Composable
    fun Err() {
        suspend fun AwaitPointerEventScope.handler() {
            awaitPointerEvent(pass = PointerEventPass.Initial).changes.forEach {
                it // <-- triggers the compiler error
            }
        }
    
        Spacer(modifier = Modifier.pointerInput(Unit) {
            awaitPointerEventScope {
                handler()
            }
        })
    }
    s
    Zach Klippenstein (he/him) [MOD]
    4 replies
    Copy to Clipboard
  • m

    maaxgr

    11 months ago
    I'm trying to embedded a PDFViewer with this library into my jetpack compose app: https://github.com/barteksc/AndroidPdfViewer I have read that we have to use the AndroidView class for embedding legacy views:
    AndroidView(
                    factory = { context ->
    
                        PDFView(context)
                    })
    The problem is that the constructor consumes an AttributeSet Object.
    public PDFView(Context context, AttributeSet set) {
    From where do i get this object? Didn't find anything on stackoverflow/google
    m
    Albert Chang
    2 replies
    Copy to Clipboard
  • y

    yschimke

    11 months ago
    Is it possible to draw to a Compose UI to a android.graphics.Canvas directly, without using AbstractComposeView or generally having it directly attached to a View? Do any of the test functionality do something similar? I was curious whether Compose is usable with an API like Wear watchfaces that has a service that renders to Canvas directly
    androidx.wear.watchface.CanvasRenderer.render(canvas: Canvas, bounds: Rect, zonedDateTime: ZonedDateTime)
    .
    y
    Zach Klippenstein (he/him) [MOD]
    3 replies
    Copy to Clipboard
  • Zoltan Demant

    Zoltan Demant

    11 months ago
    Im seeing some strange behavior with a CompositionLocal: if my top level composable function accepts a value of X, and defaults to LocalX.current; the value is null, even though it can never be null. If I specify LocalX.current inside the composable I get the proper value. Bug in compose?
    Zoltan Demant
    adjpd
    +3
    15 replies
    Copy to Clipboard