Beispiel #1
0
 public BottomBarTabbedFoNavigationContainer(string titleOfFirstTab, string navigationServiceName) : base(new BottomBarPage())
 {
     NavigationServiceName = navigationServiceName;
     RegisterNavigation();
     FirstTabbedPage       = (BottomBarPage)CurrentPage;
     FirstTabbedPage.Title = titleOfFirstTab;
 }
        public App()
        {
            // The root page of your application
            var content = new BottomBarPage
            {
                Title    = "TabbedPage-CustomRenderer",
                Children = { new Page1(), new Page2(), new Page3() }
            };

            MainPage = content;
        }
Beispiel #3
0
        public App()
        {
            LiveReload.Init();
            InitializeComponent();
            FlowListView.Init();

            //MainPage = new Rest.MainPage();

            BottomBarPage bottomBarPage = new BottomBarPage();

            bottomBarPage.BarTheme = BottomBarPage.BarThemeTypes.DarkWithAlpha;
            //bottomBarPage.FixedMode = true;

            string[] tabTitles = { "Home", "Search", "Categories", "Favorites" };
            Page[]   tabPages  = { new HomePage(), new SearchPage(), new CategoryPage(), new FavoritePage() };

            for (int i = 0; i < tabTitles.Length; ++i)
            {
                string title = tabTitles[i];

                FileImageSource icon = (FileImageSource)FileImageSource.FromFile(string.Format("ic_action_{0}.png", title.ToLowerInvariant()));

                // create tab page
                var tabPage = new NavigationPage(tabPages[i]);
                tabPage.Title = title;
                tabPage.Icon  = icon;

                // set tab color

                /*if (tabColor != null)
                 * {
                 *  BottomBarPageExtensions.SetTabColor(tabPage, Color.FromHex(tabColor));
                 * }*/

                //BottomBarPageExtensions.SetTabColor(tabPage, Color.White);


                // add tab pag to tab control
                bottomBarPage.Children.Add(tabPage);
            }

            MainPage = bottomBarPage;
        }
        public App()
        {
            InitializeComponent();

            BottomBarPage bottomBarPage = new BottomBarPage();

            bottomBarPage.BarBackgroundColor = Color.Pink;

            string [] tabTitles = { "Favorites", "Friends", "Nearby", "Recents", "Restaurants" };
            string [] tabColors = { null, "#5D4037", "#7B1FA2", "#FF5252", "#FF9800" };

            for (int i = 0; i < tabTitles.Length; ++i)
            {
                string title    = tabTitles [i];
                string tabColor = tabColors [i];

                FileImageSource icon = (FileImageSource)FileImageSource.FromFile(string.Format("ic_{0}.png", title.ToLowerInvariant()));

                // create tab page
                var tabPage = new TabPage()
                {
                    Title = title,
                    Icon  = icon
                };

                // set tab color
                if (tabColor != null)
                {
                    tabPage.SetTabColor(Color.FromHex(tabColor));
                }

                // set label based on title
                tabPage.UpdateLabel();

                // add tab pag to tab control
                bottomBarPage.Children.Add(tabPage);
            }

            MainPage = bottomBarPage;
        }
Beispiel #5
0
        public App()
        {
            InitializeComponent();

            BottomBarPage bottomBarPage = new BottomBarPage();

            //bottomBarPage.BarBackgroundColor = Color.Pink;


            // You can only define the color for the active icon if you set the Bottombar to fixed mode
            // So if you want to try this, just uncomment the next two lines

            //bottomBarPage.BarTextColor = Color.Blue; // Setting Color of selected Text and Icon
            //bottomBarPage.FixedMode = true;

            // Whith BarTheme you can select between light and dark theming when using FixedMode
            // When using DarkTheme you can set the Background Color by adding a colors.xml to you Android.Resources.Values
            // with content
            //
            //  <color name="white">#ffffff</color>
            //  < color name = "bb_darkBackgroundColor" >#000000</color>
            //
            // by setting "white" you can select the color of the non selected items and texts in dark theme
            // The Difference between DarkThemeWithAlpha and DarkThemeWithoutAlpha is that WithAlpha will draw not selected items with halfe the
            // intensity instaed of solid "white" value
            //
            // Uncomment next line to use Dark Theme
            // bottomBarPage.BarTheme = BottomBarPage.BarThemeTypes.DarkWithAlpha;

            string[]  tabTitles = { "Favorites", "Friends", "Nearby", "Recents", "Restaurants" };
            string [] tabColors = { null, "#5D4037", "#7B1FA2", "#FF5252", "#FF9800" };

            for (int i = 0; i < tabTitles.Length; ++i)
            {
                string title    = tabTitles [i];
                string tabColor = tabColors [i];

                FileImageSource icon = (FileImageSource)FileImageSource.FromFile(string.Format("ic_{0}.png", title.ToLowerInvariant()));

                // create tab page
                var tabPage = new TabPage()
                {
                    Title = title,
                    Icon  = icon
                };

                // set tab color
                if (tabColor != null)
                {
                    BottomBarPageExtensions.SetTabColor(tabPage, Color.FromHex(tabColor));
                }

                // set label based on title
                tabPage.UpdateLabel();

                // add tab pag to tab control
                bottomBarPage.Children.Add(tabPage);
            }

            MainPage = bottomBarPage;
        }
Beispiel #6
0
        public NavigationPage FetchMainUI()
        {
            momentListPage = new MomentListPage();
            cameraPage     = new CameraPage();
            //cameraPreviewPage = new CameraPreviewPage();
            profilePage = new ProfilePage();

            bottomBarPage = new BottomBarPage();
            bottomBarPage.BarBackgroundColor = Color.Pink;

            bottomBarPage.Children.Add(momentListPage);
            momentListPage.Title = "Moments";
            momentListPage.Icon  = (FileImageSource)ImageSource.FromFile("earth.png");
            //momentListPage.SetTabColor(Color.FromHex("#5D4037"));

            bottomBarPage.Children.Add(cameraPage);
            cameraPage.Title = "Camera";
            cameraPage.Icon  = (FileImageSource)ImageSource.FromFile("camera.png");
            //cameraPage.SetTabColor(Color.FromHex("#5D4037"));

            bottomBarPage.Children.Add(profilePage);
            profilePage.Title = "Profile";
            profilePage.Icon  = (FileImageSource)ImageSource.FromFile("face.png");
            //profilePage.SetTabColor(Color.FromHex("#5D4037"));


            var navigationPage = new NavigationPage(bottomBarPage);

            NavigationPage.SetHasNavigationBar(bottomBarPage, false);
            //NavigationPage navigationPage = null;

            //string[] tabTitles = { "Favorites", "Friends", "Nearby", "Recents", "Restaurants" };
            //string[] tabColors = { null, "#5D4037", "#7B1FA2", "#FF5252", "#FF9800" };

            //for (int i = 0; i < tabTitles.Length; ++i)
            //{
            //    string title = tabTitles[i];
            //    string tabColor = tabColors[i];

            //FileImageSource icon = (FileImageSource)ImageSource.FromFile(string.Format("ic_{0}.png", title.ToLowerInvariant()));

            //    // create tab page
            //    var tabPage = new TabPage()
            //    {
            //        Title = title,
            //        Icon = icon
            //    };

            //    // set tab color
            //    if (tabColor != null)
            //    {
            //        tabPage.SetTabColor(Color.FromHex(tabColor));
            //    }

            //    // set label based on title
            //    tabPage.UpdateLabel();

            //    // add tab pag to tab control
            //    bottomBarPage.Children.Add(tabPage);
            //}

            return(navigationPage);
        }
Beispiel #7
0
        public BottomBarPage GetBottomBar()
        {
            BottomBarPage bottomBarPage = new BottomBarPage();

            Title = "Test";
            bottomBarPage.BarTextColor = Color.Black;
            bottomBarPage.FixedMode    = false;

            MenuViewModel menuVM = new MenuViewModel();

            foreach (MenuItem item in menuVM.MenuPageList)
            {
                switch (item.Title)
                {
                case "Home":
                    HomePage home = new HomePage();

                    FileImageSource homeIcon = (FileImageSource)FileImageSource.FromFile(string.Format(item.ImageSource, item.Title.ToLowerInvariant()));

                    home.Title = item.Title;
                    home.Icon  = homeIcon;

                    bottomBarPage.Children.Add(home);
                    break;

                case "Vehicles":
                    EditVehiclePage vehicle = new EditVehiclePage();

                    FileImageSource vehicleIcon = (FileImageSource)FileImageSource.FromFile(string.Format(item.ImageSource, item.Title.ToLowerInvariant()));

                    vehicle.Title = item.Title;
                    vehicle.Icon  = vehicleIcon;

                    bottomBarPage.Children.Add(vehicle);
                    break;

                case "History":
                    HistoryPage history = new HistoryPage();

                    FileImageSource historyIcon = (FileImageSource)FileImageSource.FromFile(string.Format(item.ImageSource, item.Title.ToLowerInvariant()));

                    history.Title = item.Title;
                    history.Icon  = historyIcon;

                    bottomBarPage.Children.Add(history);
                    break;

                case "Add Shift":
                    AddShiftPage addShift = new AddShiftPage();

                    FileImageSource addShiftIcon = (FileImageSource)FileImageSource.FromFile(string.Format(item.ImageSource, item.Title.ToLowerInvariant()));

                    addShift.Title = item.Title;
                    addShift.Icon  = addShiftIcon;

                    bottomBarPage.Children.Add(addShift);
                    break;
                }
            }

            OthersPage other = new OthersPage();

            bottomBarPage.Children.Add(other);

            return(bottomBarPage);
        }