Example #1
0
        /// <summary>
        /// Attach the specified view and savedInstanceState.
        /// </summary>
        /// <returns>The attach.</returns>
        /// <param name="view">View.</param>
        /// <param name="savedInstanceState">Saved instance state.</param>
        public static BottomBar Attach(View view, Bundle savedInstanceState)
        {
            BottomBar bottomBar = new BottomBar(view.Context);

            bottomBar.OnRestoreInstanceState(savedInstanceState);

            ViewGroup contentView = (ViewGroup)view.Parent;

            if (contentView != null)
            {
                View oldLayout = contentView.GetChildAt(0);
                contentView.RemoveView(oldLayout);

                bottomBar.PendingUserContentView = oldLayout;
                contentView.AddView(bottomBar, 0);
            }
            else
            {
                bottomBar.PendingUserContentView = view;
            }

            return(bottomBar);
        }