Example #1
0
        protected virtual void OnElementSet(Shell shell)
        {
            Profile.FrameBegin();

            Profile.FramePartition("Flyout");
            _flyoutRenderer = CreateShellFlyoutRenderer();

            Profile.FramePartition("Frame");
            _frameLayout = new CustomFrameLayout(AndroidContext)
            {
                LayoutParameters = new LP(LP.MatchParent, LP.MatchParent),
                Id = Platform.GenerateViewId(),
            };

            Profile.FramePartition("SetFitsSystemWindows");
            _frameLayout.SetFitsSystemWindows(true);

            Profile.FramePartition("AttachFlyout");
            _flyoutRenderer.AttachFlyout(this, _frameLayout);

            Profile.FramePartition("AddAppearanceObserver");
            ((IShellController)shell).AddAppearanceObserver(this, shell);

            // Previewer Hack
            Profile.FramePartition("Previewer Hack");
            if (AndroidContext.GetActivity() != null && shell.CurrentItem != null)
            {
                SwitchFragment(FragmentManager, _frameLayout, shell.CurrentItem, false);
            }

            Profile.FrameEnd();
        }
Example #2
0
        protected virtual void OnElementSet(Shell shell)
        {
            _flyoutRenderer = CreateShellFlyoutRenderer();
            _frameLayout    = new CustomFrameLayout(AndroidContext)
            {
                LayoutParameters = new LP(LP.MatchParent, LP.MatchParent),
                Id = Platform.GenerateViewId(),
            };
            _frameLayout.SetFitsSystemWindows(true);

            _flyoutRenderer.AttachFlyout(this, _frameLayout);

            ((IShellController)shell).AddAppearanceObserver(this, shell);

            SwitchFragment(FragmentManager, _frameLayout, shell.CurrentItem, false);
        }