• Klaas Kabini

    Klaas Kabini

    2 years ago
    Can you rotate counter-clockwise using the Canvas provided by compose? With legacy view system a negative rotation angle meant rotating counter-clockwise. I am trying to do the same with compose but no success.
    Klaas Kabini
    bezrukov
    +2
    5 replies
    Copy to Clipboard
  • caelum19

    caelum19

    2 years ago
    Hey guys, I'm getting a NoSuchMethodException on any @Preview I attempt to use after upgrading to dev06.
    composeOptions {
            kotlinCompilerExtensionVersion = "0.1.0-dev06"
            kotlinCompilerVersion "1.3.61-dev-withExperimentalGoogleExtensions-20200129"
        }
        buildFeatures {
    //        viewBinding = true
           compose true
        }
    Anyone else experienced this?
    caelum19
    Adam Powell
    +1
    5 replies
    Copy to Clipboard
  • gpaligot

    gpaligot

    2 years ago
    Hello! Someone know how I can scroll at the end of an AdapterList (or a VerticalScroller if it isn't possible with an AdapterList)?
    gpaligot
    1 replies
    Copy to Clipboard
  • u

    ursus

    2 years ago
    I wanted to ask folks bit of a OT but related to paradigm shift compose will bring, i.e. immutable models. I like this, but ergonomics are very poor imo, given a nested model like this
    data class State(
        val items: List<Item> = emptyList(),
        ...
    )
    
    sealed class Item
    data class HeaderItem(val titleRes: Int) : Item()
    sealed class ServiceItem : Item() { ..
    data class SimpleItem(..) : ServiceItem
    data class FormItem(val textItems: List<TextItem> = emptyList()) : ServiceItem
    -- lets say now I need to change text item inside a form item with mutable models code is pretty neat in kotlin
    state.items
        .firstOrNull { it is FormItem && item.service.id == serviceId }
        ?.let { it as FormItem }
        ?.textItems
        ?.firstOrNull { it.id == textItemId }
        ?.apply {
            value = text
            validity = FormItem.TextItem.Validity.PENDING
        }
    with immutable obviously you need to create copies
    setState {
        copy(
            items = items.map { item ->
                if (item is FormItem && item.service.id == serviceId) {
                    item.copy(
                        textItems = item.textItems.map {
                            if (it.id == textItemId) {
                                it.copy(value = text, validity = FormItem.TextItem.Validity.PENDING)
                            } else {
                                it
                            }
                        })
                } else {
                    item
                }
            }
        )
    }
    u
    elizarov
    +1
    3 replies
    Copy to Clipboard
  • u

    ursus

    2 years ago
    tbh thats some BS code -- all the nested copying, or returning identity in map. I must be missing something. So I was wondering, is kotlin missing some sugar for this, or are immutable models at UI level irrelevant if we can enforce only main thread can touch them? Or maybe I think I've read redux/react people denormalize their states?
    u
    Adam Powell
    +1
    24 replies
    Copy to Clipboard
  • jolo

    jolo

    2 years ago
    Beta-build does not have Compose support, please download 4.1 Canary 2 instead 🙂
    jolo
    Klaas Kabini
    +2
    5 replies
    Copy to Clipboard
  • g

    Guy Bieber

    2 years ago
    Jetpack Compose Question: I am trying to get a android.ui.material.button to look pressed. How is that done in compose?
    g
    Adam Powell
    +3
    13 replies
    Copy to Clipboard
  • g

    Guy Bieber

    2 years ago
    Jetpack Compose Question: Is there an easy place to find the modifiers for various widgets?
    g
    Adam Powell
    6 replies
    Copy to Clipboard
  • k

    kyleg

    2 years ago
    I see recommendations for using Compose and things like Room in the same project by isolating Compose to another module. I’m in Android Studio. I create a new module. Is this uspposed to be library module or what? I created Android App module but now can’t get my one module’s Activities to be able to
    import mycomposemodule.testactivity
    . How do I accomplish this? I’m trying to add Compose functionality to an existing application that uses Room and other stuff.
    dev06
    , by the way.
    k
    1 replies
    Copy to Clipboard
  • amar_1995

    amar_1995

    2 years ago
    How to achieve pull-to-refresh a list view in compose ?
    amar_1995
    matvei
    +1
    9 replies
    Copy to Clipboard