//Initialiser
        public StationFacilitiesMarker(Context Context, float XNorm, float YNorm, MarkerTypes MarkerType)
        {
            //Set Variables
            _XNorm            = XNorm;
            _YNorm            = YNorm;
            _MarkerType       = MarkerType;
            RtGraphicsLayouts = new RtGraphicsLayouts(Context);

            _MarkerView = new ImageView(Context);
            _MarkerView.SetBackgroundResource(Resource.Drawable.IconMapDoor);
        }
        //Initialiser
        public RtStationSearchDialog(Context Context, ContextWrapper ContextWrapper, Window Window, int DialogID = ZERO)
        {
            //Set variables
            this.Context        = Context;
            this.ContextWrapper = ContextWrapper;
            this.Window         = Window;
            this.DialogID       = DialogID;

            //Initialise Graphics Layouts
            RtGraphicsLayouts = new RtGraphicsLayouts(this.Context);

            //Create the view
            GenerateView();
        }
        //Initialiser
        public RtStationSearchDialog(Context Context, ContextWrapper ContextWrapper, Window Window)
        {
            //Set variables
            this.Context        = Context;
            this.ContextWrapper = ContextWrapper;
            this.Window         = Window;

            //Set variables from settings
            Option_SearchLocation  = RtSettings.ReadSetting("SSBD") == "1";
            Option_SearchNavigable = RtSettings.ReadSetting("SSO") == "1";

            //Initialise Graphics Layouts
            RtGraphicsLayouts = new RtGraphicsLayouts(this.Context);

            //Create the view
            GenerateView();
        }
Пример #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            RtGraphicsLayouts RtGraphicsLayouts = new RtGraphicsLayouts(this);

            RtGraphicsLayouts.SetColourStatusBar(Window, RtGraphicsColours.Orange);

            LinearLayout RootLayout = new LinearLayout(this);

            RootLayout.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND);
            RootLayout.SetBackgroundColor(RtGraphicsColours.Orange);
            SetContentView(RootLayout);

            GenerateInitialSettings();

            StartActivity(typeof(Activity_Home));
        }
        //Initialiser
        public RtTrainDeparturesView(Context Context, Activity Activity)
        {
            this.Context  = Context;  //Set Context
            this.Activity = Activity; //Set Activity

            //Initialise graphics
            RtGraphicsLayouts = new RtGraphicsLayouts(this.Context);

            //Generate View
            _RootLayout = new LinearLayout(this.Context);
            _RootLayout.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.CONTAIN);
            _RootLayout.Orientation      = Orientation.Vertical;
            _RootLayout.Visibility       = ViewStates.Gone;

            //Generate Departures Root
            _TrainDeparturesLayout = new LinearLayout(this.Context);
            _TrainDeparturesLayout.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.CONTAIN);
            _TrainDeparturesLayout.Orientation      = Orientation.Vertical;
            _TrainDeparturesLayout.Visibility       = ViewStates.Gone;
            _RootLayout.AddView(_TrainDeparturesLayout);

            //Generate Departures Loading Root
            _TrainDeparturesLoading = new LinearLayout(this.Context);
            _TrainDeparturesLoading.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, 400);
            _TrainDeparturesLoading.Orientation      = Orientation.Vertical;
            _TrainDeparturesLoading.SetGravity(GravityFlags.Center);
            _TrainDeparturesLoading.SetBackgroundResource(Resource.Drawable.StyleCornerBox);
            _RootLayout.AddView(_TrainDeparturesLoading);

            ImageView LoadingIcon = new ImageView(this.Context);

            LoadingIcon.LayoutParameters = RtGraphicsLayouts.LayoutParameters(120, 120);
            LoadingIcon.SetImageResource(Resource.Drawable.Icon_Loading);
            _TrainDeparturesLoading.AddView(LoadingIcon);

            //Thread for rotating loading icon
            new Thread(() => { int Z = 0; while (true)
                               {
                                   Activity.RunOnUiThread(() => LoadingIcon.Rotation = Z); Z += 4; Thread.Sleep(20);
                               }
                       }).Start();
        }
        public StationFacilitiesView(Context Context)
        {
            this.Context = Context;

            RtGraphicsLayouts = new RtGraphicsLayouts(this.Context);

            _RootLayout = new LinearLayout(this.Context);
            _RootLayout.SetBackgroundResource(Resource.Drawable.StyleCornerBox);
            _RootLayout.SetOnTouchListener(this);

            _RootPan = new RelativeLayout(this.Context);
            _RootPan.LayoutParameters = new ViewGroup.LayoutParams(10000, 10000);
            _RootLayout.AddView(_RootPan);

            _RootMap = new RelativeLayout(this.Context);
            _RootMap.LayoutParameters = new ViewGroup.LayoutParams(10000, 10000);
            RelativeLayout.LayoutParams params1 = new RelativeLayout.LayoutParams(10000, 10000);
            params1.TopMargin  = -RtGraphicsLayouts.ConvertPxDp(900);
            params1.LeftMargin = -RtGraphicsLayouts.ConvertPxDp(900);
            _RootPan.AddView(_RootMap, params1);

            Redraw("LAN", null);
        }
Пример #7
0
        public RtCheckboxView(Context Context)
        {
            this.Context = Context;

            RtGraphicsLayouts = new RtGraphicsLayouts(Context);

            CheckboxBack = new LinearLayout(Context);
            CheckboxBack.SetDpPadding(RtGraphicsLayouts, 0, SMALLPADDING, 0, SMALLPADDING);
            CheckboxBack.Click += CheckboxBack_Click;

            LeftSide             = new LinearLayout(Context);
            LeftSide.Orientation = Orientation.Vertical;

            TextView = new TextView(Context);
            TextView.Format(RtGraphicsExt.TextFormats.Paragraph);

            DescriptionView = new TextView(Context);
            DescriptionView.Format(RtGraphicsExt.TextFormats.Paragraph1);
            DescriptionView.Visibility = ViewStates.Gone;

            Checkbox = new LinearLayout(Context);
            Checkbox.SetBackgroundResource(Resource.Drawable.IconCheckbox);
        }
Пример #8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            //Initialisation
            RtGraphicsLayouts = new RtGraphicsLayouts(this);
            RtGraphicsLayouts.SetColourStatusBar(Window, RtGraphicsColours.Orange);

            //Root
            LinearLayout RootLayout = new LinearLayout(this);

            RootLayout.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND);
            RootLayout.Orientation      = Orientation.Vertical;
            SetContentView(RootLayout);

            //Navbar Root
            LinearLayout NavbarLayout = new LinearLayout(this);

            NavbarLayout.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, NAVBARHEIGHT);
            NavbarLayout.SetBackgroundColor(RtGraphicsColours.Orange);
            RootLayout.AddView(NavbarLayout);

            //Navbar Back Icon
            LinearLayout NavbarBack = new LinearLayout(this);

            NavbarBack.LayoutParameters = RtGraphicsLayouts.LayoutParameters(NAVBARHEIGHT, NAVBARHEIGHT);
            NavbarBack.SetBackgroundResource(Resource.Drawable.IconBack);
            NavbarBack.Click += NavbarBack_Click;;
            NavbarLayout.AddView(NavbarBack);

            //Navbar Title
            TextView NavBarTitle = new TextView(this);

            NavBarTitle.LayoutParameters = RtGraphicsLayouts.LayoutParameters(-140, RtGraphicsLayouts.EXPAND);
            NavBarTitle.SetDpPadding(RtGraphicsLayouts, NAVBARPADDING, NAVBARPADDING, NAVBARHEIGHT + NAVBARPADDING, NAVBARPADDING);
            NavBarTitle.Gravity = GravityFlags.Center;
            NavBarTitle.Format(RtGraphicsExt.TextFormats.Heading);
            NavBarTitle.Text = NAVBARTEXT;
            NavbarLayout.AddView(NavBarTitle);

            //Screen Content Scroller
            ContentScrollerRoot = new ScrollView(this);
            ContentScrollerRoot.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND);
            RootLayout.AddView(ContentScrollerRoot);

            //Screen Content
            LinearLayout ContentScrollRoot = new LinearLayout(this);

            ContentScrollRoot.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.CONTAIN);
            ContentScrollRoot.Orientation      = Orientation.Vertical;
            ContentScrollRoot.SetDpPadding(RtGraphicsLayouts, SMALLPADDING, SMALLPADDING, SMALLPADDING, SMALLPADDING);
            ContentScrollerRoot.AddView(ContentScrollRoot);

            //From Station Box
            ContentScrollRoot.AddView(GenerateStationSelectionBox(StationSelectionBoxType.From));

            ContentScrollRoot.AddView(GenerateSpacer());

            //Train Results Box
            TrainDepartures           = new RtTrainDeparturesView(this, this);
            TrainDepartures.Callback += TrainDepartures_Callback;
            ContentScrollRoot.AddView(TrainDepartures);

            ContentScrollRoot.AddView(GenerateSpacer());

            //To Station Box
            ContentScrollRoot.AddView(GenerateStationSelectionBox(StationSelectionBoxType.To));
        }
Пример #9
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            //Initialisation
            RtGraphicsLayouts RtGraphicsLayouts = new RtGraphicsLayouts(this);

            RtGraphicsLayouts.SetColourStatusBar(Window, RtGraphicsColours.Orange);

            //Root
            LinearLayout RootLayout = new LinearLayout(this);

            RootLayout.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND);
            RootLayout.Orientation      = Orientation.Vertical;
            SetContentView(RootLayout);

            //Navbar
            LinearLayout NavbarLayout = new LinearLayout(this);

            NavbarLayout.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, NAVBARHEIGHT);
            NavbarLayout.SetBackgroundColor(RtGraphicsColours.Orange);
            RootLayout.AddView(NavbarLayout);

            LinearLayout NavbarBack = new LinearLayout(this);

            NavbarBack.LayoutParameters = RtGraphicsLayouts.LayoutParameters(NAVBARHEIGHT, NAVBARHEIGHT);
            NavbarBack.SetBackgroundResource(Resource.Drawable.IconBack);
            NavbarBack.Click += NavbarBack_Click;;
            NavbarLayout.AddView(NavbarBack);

            TextView NavBarTitle = new TextView(this);

            NavBarTitle.LayoutParameters = RtGraphicsLayouts.LayoutParameters(-140, RtGraphicsLayouts.EXPAND);
            NavBarTitle.SetDpPadding(RtGraphicsLayouts, NAVBARPADDING, NAVBARPADDING, NAVBARHEIGHT + NAVBARPADDING, NAVBARPADDING);
            NavBarTitle.Gravity = GravityFlags.Center;
            NavBarTitle.Format(RtGraphicsExt.TextFormats.Heading);
            NavBarTitle.Text = NAVBARTEXT;
            NavbarLayout.AddView(NavBarTitle);

            //Content
            ScrollView ContentScrollerRoot = new ScrollView(this);

            ContentScrollerRoot.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND);
            RootLayout.AddView(ContentScrollerRoot);

            LinearLayout ContentScrollRoot = new LinearLayout(this);

            ContentScrollRoot.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.CONTAIN);
            ContentScrollRoot.Orientation      = Orientation.Vertical;
            ContentScrollRoot.SetDpPadding(RtGraphicsLayouts, SMALLPADDING, SMALLPADDING, SMALLPADDING, SMALLPADDING);
            ContentScrollerRoot.AddView(ContentScrollRoot);


            //Settings Panel 1
            LinearLayout SettingsBack = new LinearLayout(this);

            SettingsBack.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.CONTAIN);
            SettingsBack.Orientation      = Orientation.Vertical;
            SettingsBack.SetBackgroundResource(Resource.Drawable.StyleCornerBox);
            SettingsBack.SetDpPadding(RtGraphicsLayouts, BIGPADDING, BIGPADDING, BIGPADDING, BIGPADDING);
            ContentScrollRoot.AddView(SettingsBack);

            SettingsCheckbox = new RtCheckboxView(this);
            SettingsCheckbox.LayoutParameters = RtGraphicsLayouts.LayoutParameters(-(BIGPADDING + BIGPADDING + SMALLPADDING + SMALLPADDING), RtGraphicsLayouts.CONTAIN);
            SettingsCheckbox.Callback        += SettingsCheckbox_Callback;
            SettingsCheckbox.Checked          = (RtSettings.ReadSetting("RRINT") == ONE);
            SettingsCheckbox.Text             = SETTINGTEXT;
            SettingsCheckbox.Description      = SETTINGDESC;
            SettingsBack.AddView(SettingsCheckbox);

            SettingsCheckbox1 = new RtCheckboxView(this);
            SettingsCheckbox1.LayoutParameters = RtGraphicsLayouts.LayoutParameters(-(BIGPADDING + BIGPADDING + SMALLPADDING + SMALLPADDING), RtGraphicsLayouts.CONTAIN);
            SettingsCheckbox1.Callback        += SettingsCheckbox_Callback;
            SettingsCheckbox1.Checked          = (RtSettings.ReadSetting("RRAAM") == ONE);
            SettingsCheckbox1.Text             = SETTINGTEXT1;
            SettingsBack.AddView(SettingsCheckbox1);

            LinearLayout SettingsBackSpacer = new LinearLayout(this);

            SettingsBackSpacer.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, SMALLPADDING);
            ContentScrollRoot.AddView(SettingsBackSpacer);

            //Settings Panel 2
            LinearLayout SettingsBack1 = new LinearLayout(this);

            SettingsBack1.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.CONTAIN);
            SettingsBack1.Orientation      = Orientation.Vertical;
            SettingsBack1.SetBackgroundResource(Resource.Drawable.StyleCornerBox);
            SettingsBack1.SetDpPadding(RtGraphicsLayouts, BIGPADDING, BIGPADDING, BIGPADDING, BIGPADDING);
            ContentScrollRoot.AddView(SettingsBack1);

            SettingsCheckbox2 = new RtCheckboxView(this);
            SettingsCheckbox2.LayoutParameters = RtGraphicsLayouts.LayoutParameters(-(BIGPADDING + BIGPADDING + SMALLPADDING + SMALLPADDING), RtGraphicsLayouts.CONTAIN);
            SettingsCheckbox2.Callback        += SettingsCheckbox_Callback;
            SettingsCheckbox2.Checked          = (RtSettings.ReadSetting("SSO") == ONE);
            SettingsCheckbox2.Text             = SETTINGTEXT2;
            SettingsCheckbox2.Description      = SETTINGDESC2;
            SettingsBack1.AddView(SettingsCheckbox2);

            SettingsCheckbox3 = new RtCheckboxView(this);
            SettingsCheckbox3.LayoutParameters = RtGraphicsLayouts.LayoutParameters(-(BIGPADDING + BIGPADDING + SMALLPADDING + SMALLPADDING), RtGraphicsLayouts.CONTAIN);
            SettingsCheckbox3.Callback        += SettingsCheckbox_Callback;
            SettingsCheckbox3.Checked          = (RtSettings.ReadSetting("SSBD") == ONE);
            SettingsCheckbox3.Text             = SETTINGTEXT3;
            SettingsCheckbox3.Description      = SETTINGDESC3;
            SettingsBack1.AddView(SettingsCheckbox3);

            LinearLayout SettingsBackSpacer1 = new LinearLayout(this);

            SettingsBackSpacer1.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, SMALLPADDING);
            ContentScrollRoot.AddView(SettingsBackSpacer1);

            //Settings Panel 3
            LinearLayout SettingsBack2 = new LinearLayout(this);

            SettingsBack2.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.CONTAIN);
            SettingsBack2.Orientation      = Orientation.Vertical;
            SettingsBack2.SetBackgroundResource(Resource.Drawable.StyleCornerBox);
            SettingsBack2.SetDpPadding(RtGraphicsLayouts, BIGPADDING, BIGPADDING, BIGPADDING, BIGPADDING);
            ContentScrollRoot.AddView(SettingsBack2);

            SettingsCheckbox4 = new RtCheckboxView(this);
            SettingsCheckbox4.LayoutParameters = RtGraphicsLayouts.LayoutParameters(-(BIGPADDING + BIGPADDING + SMALLPADDING + SMALLPADDING), RtGraphicsLayouts.CONTAIN);
            SettingsCheckbox4.Callback        += SettingsCheckbox_Callback;
            SettingsCheckbox4.Checked          = (RtSettings.ReadSetting("CN") == ONE);
            SettingsCheckbox4.Text             = SETTINGTEXT4;
            SettingsCheckbox4.Description      = SETTINGDESC4;
            SettingsBack2.AddView(SettingsCheckbox4);

            SettingsCheckbox5 = new RtCheckboxView(this);
            SettingsCheckbox5.LayoutParameters = RtGraphicsLayouts.LayoutParameters(-(BIGPADDING + BIGPADDING + SMALLPADDING + SMALLPADDING), RtGraphicsLayouts.CONTAIN);
            SettingsCheckbox5.Callback        += SettingsCheckbox_Callback;
            SettingsCheckbox5.Checked          = (RtSettings.ReadSetting("SSDI") == ONE);
            SettingsCheckbox5.Text             = SETTINGTEXT5;
            SettingsBack2.AddView(SettingsCheckbox5);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            //Initialisation
            RtGraphicsLayouts RtGraphicsLayouts = new RtGraphicsLayouts(this);
            RtGraphicsLayouts.SetColourStatusBar(Window, RtGraphicsColours.Orange);

            //Root
            RelativeLayout AbsoluteRootLayout = new RelativeLayout(this);
            AbsoluteRootLayout.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND);
            SetContentView(AbsoluteRootLayout);

            //Root Layout
            LinearLayout RootLayout = new LinearLayout(this);
            RootLayout.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND);
            RootLayout.Orientation = Orientation.Vertical;
            AbsoluteRootLayout.AddView(RootLayout);

            //Station Selector Dialog (after screen contents, so it overlays)
            FromStationSearchDialog = new RtStationSearchDialog(this, this, Window);
            FromStationSearchDialog.StationSelected += StationSearchDialog_StationSelected;
            AbsoluteRootLayout.AddView(FromStationSearchDialog);

            ToStationSearchDialog = new RtStationSearchDialog(this, this, Window, 1);
            ToStationSearchDialog.StationSelected += StationSearchDialog_StationSelected;
            AbsoluteRootLayout.AddView(ToStationSearchDialog);

            //Navbar Root
            LinearLayout NavBarSearchBack = new LinearLayout(this);
            NavBarSearchBack.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, NAVBARHEIGHT);
            NavBarSearchBack.SetBackgroundColor(RtGraphicsColours.Orange);
            RootLayout.AddView(NavBarSearchBack);

            //Left Image
            ImageView NavbarSearchLeft = new ImageView(this);
            NavbarSearchLeft.LayoutParameters = RtGraphicsLayouts.LayoutParameters(100, NAVBARHEIGHT);
            NavbarSearchLeft.SetImageResource(Resource.Drawable.Icon_SelectRouteLeft);
            NavBarSearchBack.AddView(NavbarSearchLeft);

            //Centre
            LinearLayout NavBarSearchCentre = new LinearLayout(this);
            NavBarSearchCentre.LayoutParameters = RtGraphicsLayouts.LayoutParameters(-200, NAVBARHEIGHT);
            NavBarSearchCentre.Orientation = Orientation.Vertical;
            NavBarSearchBack.AddView(NavBarSearchCentre);

            //Right Image
            ImageView NavbarSearchRight = new ImageView(this);
            NavbarSearchRight.LayoutParameters = RtGraphicsLayouts.LayoutParameters(100, NAVBARHEIGHT);
            NavbarSearchRight.SetImageResource(Resource.Drawable.Icon_SelectRouteRight);
            NavBarSearchBack.AddView(NavbarSearchRight);

            //Right Event
            NavbarSearchRight.Click += delegate { SwapFromTo(); };

            //From Search Box Back
            LinearLayout FromSearchBack = new LinearLayout(this);
            FromSearchBack.LayoutParameters = RtGraphicsLayouts.LayoutParameters(-200, NAVBARHEIGHT / 2);
            FromSearchBack.SetDpPadding(RtGraphicsLayouts, 0, 35, 0, 10);
            NavBarSearchCentre.AddView(FromSearchBack);

            //From Search Box
            RelativeLayout FromSearchBox = new RelativeLayout(this);
            FromSearchBox.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND);
            FromSearchBox.SetDpPadding(RtGraphicsLayouts, NAVBARPADDING, 0, NAVBARPADDING, 0);
            FromSearchBox.SetBackgroundResource(Resource.Drawable.StyleRoundShaded);
            FromSearchBack.AddView(FromSearchBox);

            //From Search Hint
            FromSearchHint = new TextView(this);
            FromSearchHint.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND);
            FromSearchHint.Format(RtGraphicsExt.TextFormats.Heading1);
            FromSearchHint.SetTextColor(RtGraphicsColours.Salmon);
            FromSearchHint.Gravity = GravityFlags.CenterVertical;
            FromSearchHint.Text = "From";
            FromSearchBox.AddView(FromSearchHint);

            //From Search Text
            FromSearchText = new TextView(this);
            FromSearchText.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND);
            FromSearchText.Format(RtGraphicsExt.TextFormats.Heading1);
            FromSearchText.Gravity = GravityFlags.CenterVertical;
            FromSearchBox.AddView(FromSearchText);

            //From Events
            FromSearchBox.Click += delegate { FromStationSearchDialog.ShowDialog(FromSearchText.Text); };

            //To Search Box Back
            LinearLayout ToSearchBack = new LinearLayout(this);
            ToSearchBack.LayoutParameters = RtGraphicsLayouts.LayoutParameters(-200, NAVBARHEIGHT / 2);
            ToSearchBack.SetDpPadding(RtGraphicsLayouts, 0, 10, 0, 35);
            NavBarSearchCentre.AddView(ToSearchBack);

            //To Search Box
            RelativeLayout ToSearchBox = new RelativeLayout(this);
            ToSearchBox.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND);
            ToSearchBox.SetDpPadding(RtGraphicsLayouts, NAVBARPADDING, 0, NAVBARPADDING, 0);
            ToSearchBox.SetBackgroundResource(Resource.Drawable.StyleRoundShaded);
            ToSearchBack.AddView(ToSearchBox);

            //To Search Hint
            ToSearchHint = new TextView(this);
            ToSearchHint.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND);
            ToSearchHint.Format(RtGraphicsExt.TextFormats.Heading1);
            ToSearchHint.SetTextColor(RtGraphicsColours.Salmon);
            ToSearchHint.Gravity = GravityFlags.CenterVertical;
            ToSearchHint.Text = "To";
            ToSearchBox.AddView(ToSearchHint);

            //To Search Text
            ToSearchText = new TextView(this);
            ToSearchText.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND);
            ToSearchText.Format(RtGraphicsExt.TextFormats.Heading1);
            ToSearchText.Gravity = GravityFlags.CenterVertical;
            ToSearchBox.AddView(ToSearchText);

            //To Events
            ToSearchBox.Click += delegate { ToStationSearchDialog.ShowDialog(ToSearchText.Text); };
            
            //Screen Content Scroller
            ScrollView ContentScrollerRoot = new ScrollView(this);
            ContentScrollerRoot.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND);
            RootLayout.AddView(ContentScrollerRoot);

            //Screen Content 
            LinearLayout ContentScrollRoot = new LinearLayout(this);
            ContentScrollRoot.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.CONTAIN);
            ContentScrollRoot.Orientation = Orientation.Vertical;
            ContentScrollRoot.SetDpPadding(RtGraphicsLayouts, 25, 25, 25, 25);
            ContentScrollerRoot.AddView(ContentScrollRoot);

            //Train Results Box
            RtTrainDeparturesView = new RtTrainDeparturesView(this, this);
            RtTrainDeparturesView.Callback += RtTrainDeparturesView_Callback;
            ContentScrollRoot.AddView(RtTrainDeparturesView);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            //Initialisation
            RtGraphicsLayouts = new RtGraphicsLayouts(this);
            RtGraphicsLayouts.SetColourStatusBar(Window, RtGraphicsColours.Orange);

            //Root
            LinearLayout RootLayout = new LinearLayout(this);

            RootLayout.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND);
            RootLayout.Orientation      = Orientation.Vertical;
            SetContentView(RootLayout);

            //Navbar
            LinearLayout NavbarLayout = new LinearLayout(this);

            NavbarLayout.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, NAVBARHEIGHT);
            NavbarLayout.SetBackgroundColor(RtGraphicsColours.Orange);
            RootLayout.AddView(NavbarLayout);

            LinearLayout NavbarBack = new LinearLayout(this);

            NavbarBack.LayoutParameters = RtGraphicsLayouts.LayoutParameters(NAVBARHEIGHT, NAVBARHEIGHT);
            NavbarBack.SetBackgroundResource(Resource.Drawable.IconBack);
            NavbarBack.Click += NavbarBack_Click;;
            NavbarLayout.AddView(NavbarBack);

            TextView NavBarTitle = new TextView(this);

            NavBarTitle.LayoutParameters = RtGraphicsLayouts.LayoutParameters(-140, RtGraphicsLayouts.EXPAND);
            NavBarTitle.SetDpPadding(RtGraphicsLayouts, NAVBARPADDING, NAVBARPADDING, NAVBARHEIGHT + NAVBARPADDING, NAVBARPADDING);
            NavBarTitle.Gravity = GravityFlags.Center;
            NavBarTitle.Format(RtGraphicsExt.TextFormats.Heading);
            NavBarTitle.Text = NAVBARTEXT;
            NavbarLayout.AddView(NavBarTitle);

            //Content
            ScrollView ContentScrollerRoot = new ScrollView(this);

            ContentScrollerRoot.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND);
            RootLayout.AddView(ContentScrollerRoot);

            LinearLayout ContentScrollRoot = new LinearLayout(this);

            ContentScrollRoot.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.CONTAIN);
            ContentScrollRoot.Orientation      = Orientation.Vertical;
            ContentScrollerRoot.AddView(ContentScrollRoot);

            LinearLayout NavbarTitleBorder = new LinearLayout(this);

            NavbarTitleBorder.SetBackgroundColor(RtGraphicsColours.OrangeDim);
            NavbarTitleBorder.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND);
            NavbarTitleBorder.SetDpPadding(RtGraphicsLayouts, SMALLPADDING, SMALLPADDING, SMALLPADDING, SMALLPADDING);
            ContentScrollRoot.AddView(NavbarTitleBorder);

            EditText NavBarTitleSearch = new EditText(this);

            NavBarTitleSearch.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND);
            //NavBarTitle.SetDpPadding(RtGraphicsLayouts, NAVBARPADDING, NAVBARPADDING, NAVBARHEIGHT + NAVBARPADDING, NAVBARPADDING);
            //NavBarTitleSearch.SetBackgroundColor(RtGraphicsColours.GreyLightest);
            NavBarTitleSearch.Background.SetColorFilter(RtGraphicsColours.OrangeDim, PorterDuff.Mode.SrcIn);
            NavBarTitleSearch.SetHintTextColor(RtGraphicsColours.Orange);
            NavBarTitleSearch.Format(RtGraphicsExt.TextFormats.Heading);
            NavBarTitleSearch.SetTextColor(RtGraphicsColours.GreyLightest);
            NavBarTitleSearch.Hint              = NAVBARTEXT;
            NavBarTitleSearch.AfterTextChanged += NavBarTitle_AfterTextChanged;
            NavbarTitleBorder.AddView(NavBarTitleSearch);

            ContentRoot = new LinearLayout(this);
            ContentRoot.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.CONTAIN);
            ContentRoot.Orientation      = Orientation.Vertical;
            ContentRoot.SetDpPadding(RtGraphicsLayouts, SMALLPADDING, SMALLPADDING, SMALLPADDING, SMALLPADDING);
            ContentScrollRoot.AddView(ContentRoot);
        }
Пример #12
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            //Initialisation
            RtGraphicsLayouts RtGraphicsLayouts = new RtGraphicsLayouts(this);

            RtGraphicsLayouts.SetColourStatusBar(Window, RtGraphicsColours.Orange);

            //Root
            LinearLayout RootLayout = new LinearLayout(this);

            RootLayout.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND);
            RootLayout.Orientation      = Orientation.Vertical;
            SetContentView(RootLayout);

            //Navbar
            LinearLayout NavbarLayout = new LinearLayout(this);

            NavbarLayout.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, NAVBARHEIGHT);
            NavbarLayout.SetBackgroundColor(RtGraphicsColours.Orange);
            RootLayout.AddView(NavbarLayout);

            TextView NavBarTitle = new TextView(this);

            NavBarTitle.LayoutParameters = RtGraphicsLayouts.LayoutParameters(-140, RtGraphicsLayouts.EXPAND);
            NavBarTitle.SetDpPadding(RtGraphicsLayouts, NAVBARHEIGHT + NAVBARPADDING, NAVBARPADDING, NAVBARPADDING, NAVBARPADDING);
            NavBarTitle.Gravity = GravityFlags.Center;
            NavBarTitle.Format(RtGraphicsExt.TextFormats.Heading);
            NavBarTitle.Text = NAVBARTEXT;
            NavbarLayout.AddView(NavBarTitle);

            LinearLayout NavbarOptions = new LinearLayout(this);

            NavbarOptions.LayoutParameters = RtGraphicsLayouts.LayoutParameters(NAVBARHEIGHT, NAVBARHEIGHT);
            NavbarOptions.SetBackgroundResource(Resource.Drawable.IconOptions);
            NavbarOptions.Click += NavbarOptions_Click;
            NavbarLayout.AddView(NavbarOptions);

            //Content
            ScrollView ContentScrollerRoot = new ScrollView(this);

            ContentScrollerRoot.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND);
            RootLayout.AddView(ContentScrollerRoot);

            LinearLayout ContentScrollRoot = new LinearLayout(this);

            ContentScrollRoot.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.CONTAIN);
            ContentScrollRoot.Orientation      = Orientation.Vertical;
            ContentScrollRoot.SetDpPadding(RtGraphicsLayouts, SMALLPADDING, ZERO, SMALLPADDING, SMALLPADDING);
            ContentScrollerRoot.AddView(ContentScrollRoot);

            //Add Route Button
            LinearLayout AddRouteSpacer = new LinearLayout(this);

            AddRouteSpacer.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, ADDROUTESPACERHEIGHT);
            AddRouteSpacer.SetGravity(GravityFlags.Center);
            ContentScrollRoot.AddView(AddRouteSpacer);

            LinearLayout AddRouteButton = new LinearLayout(this);

            AddRouteButton.LayoutParameters = RtGraphicsLayouts.LayoutParameters(ADDROUTEBTNNWIDTH, ADDROUTEBTNHEIGHT);
            AddRouteButton.Orientation      = Orientation.Vertical;
            AddRouteButton.Click           += AddRouteButton_Click;
            AddRouteSpacer.AddView(AddRouteButton);

            LinearLayout AddRouteButtonTop = new LinearLayout(this);

            AddRouteButtonTop.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, BIGPADDING);
            AddRouteButtonTop.SetBackgroundResource(Resource.Drawable.StyleTicketTop);
            AddRouteButton.AddView(AddRouteButtonTop);

            LinearLayout AddRouteButtonMiddle = new LinearLayout(this);

            AddRouteButtonMiddle.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, NAVBARHEIGHT);
            AddRouteButtonMiddle.SetBackgroundResource(Resource.Drawable.StyleTicketMiddle);
            AddRouteButtonMiddle.SetGravity(GravityFlags.Center);
            AddRouteButton.AddView(AddRouteButtonMiddle);

            LinearLayout AddRouteButtonBottom = new LinearLayout(this);

            AddRouteButtonBottom.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, BIGPADDING);
            AddRouteButtonBottom.SetBackgroundResource(Resource.Drawable.StyleTicketBottom);
            AddRouteButton.AddView(AddRouteButtonBottom);

            TextView AddRouteText = new TextView(this);

            AddRouteText.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.CONTAIN, RtGraphicsLayouts.CONTAIN);
            AddRouteText.Format(RtGraphicsExt.TextFormats.Heading2);
            AddRouteText.Text = ADDROUTTBNTEXT;
            AddRouteButtonMiddle.AddView(AddRouteText);

            //No Roots Panel
            LinearLayout NoRootsBack = new LinearLayout(this);

            NoRootsBack.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.CONTAIN);
            NoRootsBack.SetBackgroundResource(Resource.Drawable.StyleCornerBox);
            NoRootsBack.SetDpPadding(RtGraphicsLayouts, BIGPADDING, BIGPADDING, BIGPADDING, BIGPADDING);
            ContentScrollRoot.AddView(NoRootsBack);

            TextView NoRoutesText = new TextView(this);

            NoRoutesText.LayoutParameters = RtGraphicsLayouts.LayoutParameters(-(NOROUTESICONSIZE + BIGPADDING + BIGPADDING + SMALLPADDING + SMALLPADDING), RtGraphicsLayouts.CONTAIN);
            NoRoutesText.Format(RtGraphicsExt.TextFormats.Paragraph);
            NoRoutesText.Text = NOROUTESTEXT;
            NoRootsBack.AddView(NoRoutesText);

            ImageView NoRoutesArt = new ImageView(this);

            NoRoutesArt.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND);
            NoRoutesArt.SetImageResource(Resource.Drawable.IconNoRoutes);
            NoRootsBack.AddView(NoRoutesArt);
        }