void CreateUI()
        {
            stack = new StackLayout
            {
                Orientation     = StackOrientation.Vertical,
                WidthRequest    = App.ScreenSize.Width,
                HeightRequest   = App.ScreenSize.Height - 48,
                VerticalOptions = LayoutOptions.StartAndExpand
            };

            innerStack = new StackLayout
            {
                VerticalOptions     = LayoutOptions.Start,
                IsVisible           = false,
                HorizontalOptions   = LayoutOptions.Start,
                Orientation         = StackOrientation.Horizontal,
                MinimumWidthRequest = App.ScreenSize.Width,
                WidthRequest        = App.ScreenSize.Width,
                HeightRequest       = App.ScreenSize.Height - 48,
            };

            mainInnerStack = new StackLayout
            {
                VerticalOptions     = LayoutOptions.Start,
                HorizontalOptions   = LayoutOptions.Center,
                Orientation         = StackOrientation.Vertical,
                MinimumWidthRequest = App.ScreenSize.Width,
                WidthRequest        = App.ScreenSize.Width,
                HeightRequest       = App.ScreenSize.Height - 48,
                //TranslationX = -6,
                InputTransparent = true,
                TranslationY     = -6
            };

            var topbar = new TopBar(!FromStart, "", this, 1, "", "", innerStack).CreateTopBar();

            stack.HeightRequest = App.ScreenSize.Height - topbar.HeightRequest;

            titleBar = new TitleBar("");

            mainInnerStack.Children.Add(titleBar);
            if (!FromStart)
            {
                mainInnerStack.Children.Add(SearchSelectAddDetails.SearchSelectAddVehicle(titleBar, ViewModel));
            }
            else
            {
                mainInnerStack.Children.Add(IntroManageDetails.IntroManage(titleBar, ViewModel));
            }

            //innerStack.Children.Add(mainInnerStack);

            var masterStack = new StackLayout
            {
                HorizontalOptions = LayoutOptions.Start,
                VerticalOptions   = LayoutOptions.Start,
                Children          =
                {
                    new StackLayout
                    {
                        VerticalOptions   = LayoutOptions.Start,
                        HorizontalOptions = LayoutOptions.Start,
                        WidthRequest      = App.ScreenSize.Width,
                        Children          = { topbar }
                    },
                    //innerStack,
                    mainInnerStack
                }
            };

            Content = masterStack;

            if (FromStart)
            {
                ViewModel.MoveToSearch = true;
            }
        }
        void CreateUI()
        {
            stack = new StackLayout
            {
                Orientation     = StackOrientation.Vertical,
                WidthRequest    = App.ScreenSize.Width,
                HeightRequest   = App.ScreenSize.Height - 48,
                VerticalOptions = LayoutOptions.StartAndExpand
            };

            innerStack = new StackLayout
            {
                VerticalOptions     = LayoutOptions.Start,
                HorizontalOptions   = LayoutOptions.Start,
                Orientation         = StackOrientation.Horizontal,
                MinimumWidthRequest = App.ScreenSize.Width,
                WidthRequest        = App.ScreenSize.Width,
                HeightRequest       = App.ScreenSize.Height - 48,
            };

            mainInnerStack = new StackLayout
            {
                VerticalOptions     = LayoutOptions.Start,
                HorizontalOptions   = LayoutOptions.Center,
                Orientation         = StackOrientation.Vertical,
                MinimumWidthRequest = App.ScreenSize.Width,
                WidthRequest        = App.ScreenSize.Width,
                HeightRequest       = App.ScreenSize.Height - 48,
                //TranslationX = -6,
                TranslationY = -8
            };

            var topbar = new TopBar(false, "", this, 1, "", "", innerStack).CreateTopBar();

            stack.HeightRequest = App.ScreenSize.Height - topbar.HeightRequest;

            titleBar = new TitleBar("");

            mainInnerStack.Children.Add(titleBar);
            mainInnerStack.Children.Add(PersonalDetails.GeneratePersonalDetails(titleBar, ViewModel));

            innerStack.Children.Add(mainInnerStack);

            var masterStack = new StackLayout
            {
                HorizontalOptions = LayoutOptions.Start,
                VerticalOptions   = LayoutOptions.Start,
                Children          =
                {
                    new StackLayout
                    {
                        VerticalOptions   = LayoutOptions.Start,
                        HorizontalOptions = LayoutOptions.Start,
                        WidthRequest      = App.ScreenSize.Width,
                        Children          = { topbar }
                    },
                    mainInnerStack
                    //innerStack
                }
            };

            Content = masterStack;
        }
Exemple #3
0
        void CreateUI()
        {
            menuList = new List <MenuListClass>
            {
                new MenuListClass {
                    text = Langs.Const_Label_Change_Password, image = "Settings_Password"
                },
                new MenuListClass {
                    text = Langs.Const_Label_Phone_Number, image = "Settings_PhoneNumber"
                },
                new MenuListClass {
                    text = Langs.Const_Label_Fleet_Code, image = "Settings_FleetCode"
                },
                new MenuListClass {
                    text = Langs.Const_Label_Odometer, image = "Settings_Odometer"
                },
                new MenuListClass {
                    text = Langs.Const_Label_Marketing_Preferences, image = "Settings_Marketing"
                },
                new MenuListClass {
                    text = Langs.Const_Label_Language_Preferences, image = "Settings_Languages"
                },
                new MenuListClass {
                    text = Langs.Const_Label_Log_Files, image = "Settings_LogFiles"
                },
                new MenuListClass {
                    text = Langs.Const_Label_About, image = "Settings_About"
                },
            };

            stack = new StackLayout
            {
                Orientation     = StackOrientation.Vertical,
                WidthRequest    = App.ScreenSize.Width,
                HeightRequest   = App.ScreenSize.Height - 48,
                VerticalOptions = LayoutOptions.StartAndExpand
            };

            innerStack = new StackLayout
            {
                VerticalOptions     = LayoutOptions.Start,
                HorizontalOptions   = LayoutOptions.Start,
                Orientation         = StackOrientation.Horizontal,
                MinimumWidthRequest = App.ScreenSize.Width,
                WidthRequest        = App.ScreenSize.Width,
                HeightRequest       = App.ScreenSize.Height - 48,
            };

            var topbar = new TopBar(true, "", this, 1, "back_arrow", "", innerStack, true).CreateTopBar();

            stack.HeightRequest = App.ScreenSize.Height - topbar.HeightRequest;

            var titleBar = new Label
            {
                WidthRequest            = App.ScreenSize.Width,
                HeightRequest           = 48,
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment   = TextAlignment.Center,
                BackgroundColor         = FormsConstants.AppyLightBlue,
                TextColor = Color.White,
                Text      = Langs.Const_Menu_Settings
            };

            var lstMenu = new ListView
            {
                BackgroundColor     = FormsConstants.AppyDarkBlue,
                MinimumWidthRequest = App.ScreenSize.Width,
                WidthRequest        = App.ScreenSize.Width,
                HeightRequest       = App.ScreenSize.Height,
                ClassId             = "menu",
                ItemsSource         = menuList,
                ItemTemplate        = new DataTemplate(typeof(SettingsListCell))
            };

            lstMenu.ItemSelected += async(s, e) =>
            {
                var item = e.SelectedItem as MenuListClass;
                if (e.SelectedItem == null)
                {
                    return;
                }
                var final = item.image.Split('_').Last();
                switch (final)
                {
                case "Password":
                    await Navigation.PushAsync(new ChangePassword(), true);

                    break;

                case "PhoneNumber":
                    await Navigation.PushAsync(new ChangePhoneNumber(), true);

                    break;

                case "FleetCode":
                    await Navigation.PushAsync(new ChangeFleetCode(), true);

                    break;

                case "Odometer":
                    await Navigation.PushAsync(new ChangeOdometer(), true);

                    break;

                case "Marketing":
                    await Navigation.PushAsync(new Marketting(), true);

                    break;

                case "LogFiles":
                    await Navigation.PushAsync(new LogFiles(), true);

                    break;

                case "About":
                    await Navigation.PushAsync(new About(), true);

                    break;

                case "Language":
                    await Navigation.PushAsync(new ChangeLanguage(), true);

                    break;
                }
                ((ListView)s).SelectedItem = null;
            };

            stack.Children.Add(lstMenu);
            innerStack.Children.Add(stack);

            var masterStack = new StackLayout
            {
                HorizontalOptions = LayoutOptions.Start,
                VerticalOptions   = LayoutOptions.Start,
                Children          =
                {
                    new StackLayout
                    {
                        VerticalOptions   = LayoutOptions.Start,
                        HorizontalOptions = LayoutOptions.Start,
                        WidthRequest      = App.ScreenSize.Width,
                        Children          = { topbar }
                    },
                    new StackLayout
                    {
                        TranslationY = -6,
                        Children     = { titleBar    }
                    },
                    innerStack
                }
            };

            Content = masterStack;
        }
Exemple #4
0
        void CreateUI()
        {
            stack = new StackLayout
            {
                Orientation     = StackOrientation.Vertical,
                WidthRequest    = App.ScreenSize.Width,
                HeightRequest   = App.ScreenSize.Height - 48,
                VerticalOptions = LayoutOptions.StartAndExpand
            };

            innerStack = new StackLayout
            {
                VerticalOptions     = LayoutOptions.Start,
                HorizontalOptions   = LayoutOptions.Start,
                Orientation         = StackOrientation.Horizontal,
                MinimumWidthRequest = App.ScreenSize.Width,
                WidthRequest        = App.ScreenSize.Width,
                HeightRequest       = App.ScreenSize.Height - 48,
            };

            var topbar = new TopBar(true, "", this, 1, "back_arrow", "", innerStack, true).CreateTopBar();

            stack.HeightRequest = App.ScreenSize.Height - topbar.HeightRequest;

            var lstElements = new List <UIAttributes>
            {
                new UIAttributes {
                    Text = Langs.Const_Screen_Title_Journeys, Position = 0
                },
                new UIAttributes {
                    Text = Langs.Const_Label_Show_Private_Off, Position = 1, ScreenLeft = false
                },
                new UIAttributes {
                    Text       = "switch_button_blue_off".CorrectedImageSource(), IsImageSource = true, Position = 0, ScreenLeft = false,
                    ClickEvent = ToggleButton
                }
            };

            titleBar = new GeneralTopBar(lstElements);

            var fromDatePicker = new DatePicker
            {
                MinimumDate = DateTime.Now.AddDays(-30),
                //MaximumDate = DateTime.Now.AddDays(-30),
                IsVisible = false
            };

            fromDatePicker.SetBinding(DatePicker.DateProperty, new Binding("StartDate"));

            var toDatePicker = new DatePicker
            {
                MaximumDate = DateTime.Now,
                //MinimumDate = fromDatePicker.MaximumDate,
                IsVisible = false
            };

            toDatePicker.SetBinding(DatePicker.DateProperty, new Binding("EndDate"));

            var spacer = new DatePicker {
                IsVisible = false
            };

            var btnSearch = new Button
            {
                BorderRadius    = 6,
                BackgroundColor = FormsConstants.AppyBlue,
                TextColor       = Color.White,
                Text            = Langs.Const_Button_Search,
                HeightRequest   = 42
            };

            btnSearch.Clicked += delegate
            {
                ViewModel.PerformSearch();
            };

            btnFrom = new Button
            {
                BackgroundColor = FormsConstants.AppyDarkShade,
                TextColor       = Color.White,
                BorderRadius    = 6,
                HeightRequest   = 42
            };
            btnFrom.SetBinding(Button.TextProperty, new Binding("StartDateText"));
            btnFrom.Clicked += delegate
            {
                fromDatePicker.Focus();
            };

            btnTo = new Button
            {
                BackgroundColor = FormsConstants.AppyDarkShade,
                TextColor       = Color.White,
                HeightRequest   = 42,
                BorderRadius    = 6
            };
            btnTo.SetBinding(Button.TextProperty, new Binding("EndDateText"));
            btnTo.Clicked += delegate {
                toDatePicker.Focus();
            };

            var grid = new Grid
            {
                WidthRequest   = App.ScreenSize.Width,
                RowDefinitions = new RowDefinitionCollection
                {
                    new RowDefinition {
                        Height = App.ScreenSize.Height * .1
                    },
                    new RowDefinition {
                        Height = 1
                    },
                    new RowDefinition {
                        Height = 36
                    },
                    new RowDefinition {
                        Height = GridLength.Star
                    }
                }
            };

            grid.Children.Add(new StackLayout
            {
                Orientation       = StackOrientation.Horizontal,
                HorizontalOptions = LayoutOptions.Center,
                Children          =
                {
                    new StackLayout
                    {
                        Orientation = StackOrientation.Vertical,
                        Children    =
                        {
                            btnFrom,
                            fromDatePicker
                        }
                    },
                    new Image {
                        Source = "date_arrow".CorrectedImageSource(), HeightRequest = 16, WidthRequest = 16
                    },
                    new StackLayout
                    {
                        Orientation = StackOrientation.Vertical,
                        Children    =
                        {
                            btnTo,
                            toDatePicker
                        }
                    },
                    new StackLayout
                    {
                        Orientation = StackOrientation.Vertical,
                        Children    =
                        {
                            btnSearch,
                            spacer
                        }
                    }
                }
            }, 0, 0);
            grid.Children.Add(new BoxView {
                HeightRequest = 1, WidthRequest = App.ScreenSize.Width, BackgroundColor = Color.White
            }, 0, 1);

            lstView = new ListView
            {
                ItemsSource         = ViewModel.Expenses,
                WidthRequest        = App.ScreenSize.Width * .9,
                ItemTemplate        = new DataTemplate(typeof(ExpensesViewCell)),
                SeparatorVisibility = SeparatorVisibility.None,
                HeightRequest       = App.ScreenSize.Height * .8,
                HasUnevenRows       = true
            };

            if (ViewModel.Expenses.Count == 0)
            {
                Task.Run(async() => await DisplayAlert(Langs.Const_Title_Error_1, Langs.Const_Msg_No_Journeys, "OK"));
            }

            grid.Children.Add(new StackLayout
            {
                HorizontalOptions = LayoutOptions.Center,
                WidthRequest      = App.ScreenSize.Width,
                Children          = { lstView }
            }, 0, 2);

            var lblDate = new Label
            {
                FontFamily = Helper.RegFont,
                FontSize   = 12,
                TextColor  = Color.White,
                HorizontalTextAlignment = TextAlignment.Center
            };

            lblDate.SetBinding(Label.TextProperty, new Binding("DateRange"));

            grid.Children.Add(new StackLayout
            {
                HorizontalOptions = LayoutOptions.Center,
                Children          = { lblDate }
            }, 0, 2);

            stack.Children.Add(grid);
            innerStack.Children.Add(stack);

            var masterStack = new StackLayout
            {
                HorizontalOptions = LayoutOptions.Start,
                VerticalOptions   = LayoutOptions.Start,
                Children          =
                {
                    new StackLayout
                    {
                        VerticalOptions   = LayoutOptions.Start,
                        HorizontalOptions = LayoutOptions.Start,
                        WidthRequest      = App.ScreenSize.Width,
                        Children          = { topbar }
                    },
                    new StackLayout
                    {
                        TranslationY = -6,
                        Children     = { titleBar    }
                    },
                    innerStack
                }
            };

            Content = masterStack;
        }