//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();
        }
Beispiel #2
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);
        }