Example #1
0
        protected override void OnAttachedToWindow()
        {
            base.OnAttachedToWindow();

            for (var i = 0; i < ChildCount; i++)
            {
                var child = GetChildAt(i);
                if (!IsViewInDrawer(child))
                {
                    continue;
                }

                Log.Debug(Tag, "at {0}", i);
                var foldingNavigationLayout = new BaseFoldingLayout(Context)
                {
                    AnchorFactor  = 1,
                    NumberOfFolds = _numberOfFolds
                };
                RemoveView(child);
                foldingNavigationLayout.AddView(child);
                var layoutParams = child.LayoutParameters;
                AddView(foldingNavigationLayout, i, layoutParams);
            }

            DrawerSlide += (s, e) =>
            {
                var foldingLayout = e.DrawerView as BaseFoldingLayout;
                if (foldingLayout == null)
                {
                    return;
                }

                foldingLayout.FoldFactor = 1 - e.SlideOffset;
            };
        }
Example #2
0
        protected override void OnAttachedToWindow()
        {
            base.OnAttachedToWindow();

            // Pane content is always the first view?
            var child = GetChildAt(0);

            if (child != null)
            {
                RemoveView(child);

                _baseFoldingLayout.AddView(child);
                AddView(_baseFoldingLayout, 0, child.LayoutParameters);
            }

            PanelSlide += (s, e) =>
            {
                if (_baseFoldingLayout != null)
                {
                    _baseFoldingLayout.FoldFactor = 1 - e.SlideOffset;
                }
            };
        }