Search code examples
androidandroid-layoutviewgroup

what is layout gutter in android


The ViewGroup class talks about gutter. I know the meaning of gutter in English and so based on that I have some vague idea what they are talking about. But I can't quite see what they mean for certain.


Solution

  • I believe the context they're talking about is just an area to dump Views.

    In the example:

    Here is a complete implementation of a custom ViewGroup that implements a simple FrameLayout along with the ability to stack children in left and right gutters.

    public class CustomLayout extends ViewGroup {
        /** The amount of space used by children in the left gutter. */
        private int mLeftWidth;
    
        /** The amount of space used by children in the right gutter. */
        private int mRightWidth;
    }
    

    So the example all they're showing is how to make a layout that's split in half in which children can either be placed in the left side or the right side. They choose to call them "gutters".

    Then further in the example, they should how to measure out children that are in the left "gutter" and in the right "gutter". Meaning, there's an area designated on the left side of the Layout and the right side of the Layout.

    Other than that, this is not a common term used in ViewGroups or any other layout. It is used to describe the custom ViewGroup that they're building in the example.