Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Request: CONSUME_AUTO support in Kotlin DSL #104

Closed
SteinerOk opened this issue Mar 17, 2021 · 1 comment · Fixed by #112
Closed

Request: CONSUME_AUTO support in Kotlin DSL #104

SteinerOk opened this issue Mar 17, 2021 · 1 comment · Fixed by #112

Comments

@SteinerOk
Copy link
Contributor

Right now using Kotlin DSL possible only if I use consume with boolean arg, like this:

view.applyInsetter {
    consume(false)
}

witch equals CONSUME_ALL or CONSUME_NONE, but in some cases I need CONSUME_AUTO, like this:

        Insetter.builder()
            .applySystemWindowInsetsToPadding(Side.RIGHT or Side.LEFT)
            .consumeSystemWindowInsets(Insetter.CONSUME_AUTO)
            .applyToView(view)

and is impossible with Kotlin DSL :(

@SteinerOk
Copy link
Contributor Author

@chrisbanes I think easy way to solve it - just add this function to InsetterDsl:

fun consume(@ConsumeOptions consume: Int) {
    builder = builder.consume(consume)
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant