Example #1
0
        public override void Draw(Canvas canvas)
        {
            base.Draw(canvas);

            if (_slideableView == null)
            {
                return;
            }
            if (ShadowDrawable == null)
            {
                return;
            }

            var right = _slideableView.Right;
            var left  = _slideableView.Left;
            int top;
            int bottom;

            if (_isSlidingUp)
            {
                top    = _slideableView.Top - _shadowHeight;
                bottom = _slideableView.Top;
            }
            else
            {
                top    = _slideableView.Bottom;
                bottom = _slideableView.Bottom + _shadowHeight;
            }

            ShadowDrawable.SetBounds(left, top, right, bottom);
            ShadowDrawable.Draw(canvas);
        }
        public void DrawShadow(View content, Canvas canvas)
        {
            if (ShadowDrawable == null || ShadowWidth <= 0)
            {
                return;
            }
            var left = 0;

            switch (Mode)
            {
            case MenuMode.Left:
                left = content.Left - ShadowWidth;
                break;

            case MenuMode.Right:
                left = content.Right;
                break;

            case MenuMode.LeftRight:
                if (SecondaryShadowDrawable != null)
                {
                    left = content.Right;
                    SecondaryShadowDrawable.SetBounds(left, 0, left + ShadowWidth, Height);
                    SecondaryShadowDrawable.Draw(canvas);
                }
                left = content.Left - ShadowWidth;
                break;
            }
            ShadowDrawable.SetBounds(left, 0, left + ShadowWidth, Height);
            ShadowDrawable.Draw(canvas);
        }