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

Add the ability to reuse insetter #71

Merged
merged 1 commit into from
Jul 15, 2020

Conversation

mercuriy94
Copy link
Contributor

@mercuriy94 mercuriy94 commented Jul 14, 2020

Hello!
I suggest adding the ability to reuse the liners. In some cases, this can be useful to get rid of code duplication.
Since the Insetter instance is immutable, we must reuse it.
For example:

            Insetter leftTopInsetter = Insetter.builder()
                    .applySystemWindowInsetsToPadding(Side.LEFT | Side.TOP)
                    .build();

            leftTopInsetter.applyToView(btnLeftTop1);
            leftTopInsetter.applyToView(btnLeftTop2);

            Insetter rightBottomInsetter = Insetter.builder()
                    .applySystemWindowInsetsToPadding(Side.RIGHT | Side.BOTTOM)
                    .build();

            rightBottomInsetter.applyToView(btnRightBottom1);
            rightBottomInsetter.applyToView(btnRightBottom2);

@mercuriy94 mercuriy94 changed the title Add the ability to reuse insetts Add the ability to reuse insetter Jul 14, 2020
Copy link
Owner

@chrisbanes chrisbanes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@chrisbanes chrisbanes merged commit e46c294 into chrisbanes:main Jul 15, 2020
@mercuriy94 mercuriy94 deleted the ReuseInsetter branch July 17, 2020 18:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants