Example #1
0
        protected override void OnLayout(bool changed, int l, int t, int r, int b)
        {
            var width  = r - l;
            var height = b - t;

            Content.Layout(0, 0, width - _widthOffset, height);
            if (SecondaryContent != null)
            {
                SecondaryContent.Layout(0, 0, width - _widthOffset, height);
            }
        }
        protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec)
        {
            var width  = GetDefaultSize(0, widthMeasureSpec);
            var height = GetDefaultSize(0, heightMeasureSpec);

            SetMeasuredDimension(width, height);
            var contentWidth  = GetChildMeasureSpec(widthMeasureSpec, 0, width - _widthOffset);
            var contentHeight = GetChildMeasureSpec(heightMeasureSpec, 0, height);

            Content.Measure(contentWidth, contentHeight);
            if (SecondaryContent != null)
            {
                SecondaryContent.Measure(contentWidth, contentHeight);
            }
        }