• Colton Idle

    Colton Idle

    1 year ago
    My company isn't using material, so we're just defining colors like this
    object MyCompanyColors {
        val Background = Color(0xFFFFFFFF)
        val Text = Color(0xFF424242)
        //20 other colors
    }
    Anyone see anything wrong with this? I feel like the docs and codelabs don't really have any guidance on how to create a Color sheet UNLESS you go the material theme route
    Colton Idle
    Jeisson Sáchica
    2 replies
    Copy to Clipboard
  • izyaboi

    izyaboi

    1 year ago
    one question i want to implement audio exoplayer in my project . is it right that i must interop the views that used in exoplayer?https://developer.android.com/jetpack/compose/interop have anyone a example for exoplayer with compose? or is there a compose project for it?
    izyaboi
    1 replies
    Copy to Clipboard
  • a

    allan.conda

    1 year ago
  • a

    allan.conda

    1 year ago
    Are there considerations for exposing internal components/functions for building material components like
    Switch
    so we can build our own design components with less effort? Just like we have
    BasicTextField
    , I’m wondering if we could have something like
    BasicSwitch
    . Currently we resort to copy-pasting non-public components in order to easily build our own design. I’m wondering if this is the ideal way to move forward for such cases.
    a
    jim
    2 replies
    Copy to Clipboard
  • j

    julioromano

    1 year ago
    Can you type in a compose text field using the PC’s keyboard when running the app in an emulator? It’s not working on my machine, I have to use the on-screen keyboard inside the emulator.
    j
    a
    +1
    7 replies
    Copy to Clipboard
  • j

    julioromano

    1 year ago
    Is there anything like RecyclerView’s
    StateRestorationPolicy.PREVENT_WHEN_EMPTY
    for
    LazyColumn
    ?
    LazyColumn
    doesn’t currently restore the scroll position if the list’s data is fed using something like
    val myList by aFlow.collectAsState(emptyList())
    . For example during configuration changes (like rotation, dark/light theme switch, etc.) the flow will be resubscribed to and so
    aFlow
    will temporarily emit
    emptyList()
    causing the saved scroll position to be discarded. This is a workaround I found but I was hoping it could be handled better:
    if (myList.isNotEmpty()) {
        LazyColumn() {
           // .....
        }
    }
    j
    i
    +2
    6 replies
    Copy to Clipboard
  • David Attias

    David Attias

    1 year ago
    Hey guys, I'm having trouble to use
    popUpTo
    with a route which includes an optional argument. Is it supposed to work? Is it an issue ?
    David Attias
    i
    7 replies
    Copy to Clipboard
  • Kensuke Sano

    Kensuke Sano

    1 year ago
    Is there any way to specify width as a percentage?
    Box(modifier = Modifier.width(100.dp)) {
               Box(modifier = Modifier.preferredSize(50 %) ) { // 50% equals 50.dp
                        Text("HELLO")
               }
    }
    Kensuke Sano
    Adam Powell
    2 replies
    Copy to Clipboard
  • Colton Idle

    Colton Idle

    1 year ago
    When I set buttonColors on a button, I get this error
    Functions which invoke @Composable functions must be marked with the @Composable annotation
    colors = object : ButtonColors {
        override fun backgroundColor(enabled: Boolean): Color =
            JetsnackTheme.colors.color1
    
        override fun contentColor(enabled: Boolean): Color =
            JetsnackTheme.colors.color1
    }
    if I remove that block, then everything compiles fine. Any ideas?
    Colton Idle
    Cyril Find
    +1
    13 replies
    Copy to Clipboard
  • Oussama Haff.

    Oussama Haff.

    1 year ago
    Hello everyone, I was checking the source code of Material Theme declaration in Compose (alpha11) I realized that the classes :
    Colors
    and
    Typography
    are annotated with different annotations
    @Stable
    for the first and
    @Immutable
    for the second. Does this mean at a higher level that The Material Theme Composable expect colors to change at a moment of time (dark/light) but not expecting a change of typography ?
    Oussama Haff.
    f
    +1
    5 replies
    Copy to Clipboard