Esempio n. 1
0
        private void GenerateInitialSettings()
        {
            RtSettingPair[] Settings = new RtSettingPair[] { new RtSettingPair("RRINT", "0"), new RtSettingPair("RRAAM", "0"),
                                                             new RtSettingPair("SSO", "0"), new RtSettingPair("SSBD", "1"), new RtSettingPair("CN", "1"), new RtSettingPair("SSDI", "1"), new RtSettingPair("UGL", "1") };

            RtSettings.CreateSettings(Settings);
        }
Esempio n. 2
0
        private void GenerateSettingsIfDontExist()
        {
            if (!RtSettings.DoSettingsExist())
            {
                RtSettingPair[] Settings = new RtSettingPair[] { new RtSettingPair("RRINT", "0"), new RtSettingPair("RRAAM", "0"),
                                                                 new RtSettingPair("SSO", "0"), new RtSettingPair("SSBD", "1"), new RtSettingPair("CN", "1"), new RtSettingPair("SSDI", "1"), new RtSettingPair("UGL", "1") };

                RtSettings.CreateSettings(Settings);
            }
        }
Esempio n. 3
0
        private void SettingsCheckbox_Callback(string CheckboxText)
        {
            if (SettingsCheckbox != null && SettingsCheckbox1 != null && SettingsCheckbox2 != null && SettingsCheckbox3 != null &&
                SettingsCheckbox4 != null && SettingsCheckbox5 != null && SettingsCheckbox6 != null)
            {
                RtSettingPair[] Settings = new RtSettingPair[] { new RtSettingPair("RRINT", (SettingsCheckbox.Checked ? ONE: "0")),
                                                                 new RtSettingPair("RRAAM", (SettingsCheckbox1.Checked ? ONE: "0")), new RtSettingPair("SSO", (SettingsCheckbox2.Checked ? ONE: "0")),
                                                                 new RtSettingPair("SSBD", (SettingsCheckbox3.Checked ? ONE: "0")), new RtSettingPair("CN", (SettingsCheckbox4.Checked ? ONE: "0")),
                                                                 new RtSettingPair("SSDI", (SettingsCheckbox5.Checked ? ONE: "0")) };

                RtSettings.CreateSettings(Settings);
            }
        }
        //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();
        }
Esempio n. 5
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);
        }
 //Method for toggling use navagble only in search
 private void ToggleNavigableOption(ImageView View)
 {
     Option_SearchNavigable = !Option_SearchNavigable;
     View.SetImageResource((Option_SearchNavigable) ? Resource.Drawable.Icon_Navigation : Resource.Drawable.Icon_NavigationFaded);
     RtSettings.ChangeSetting("SSO", Option_SearchLocation ? "1" : "0");
 }
 //Method for toggling use location in search
 private void ToggleLocationOption(ImageView View)
 {
     Option_SearchLocation = !Option_SearchLocation;
     View.SetImageResource((Option_SearchLocation) ? Resource.Drawable.Icon_Location : Resource.Drawable.Icon_LocationFaded);
     RtSettings.ChangeSetting("SSBD", Option_SearchLocation ? "1" : "0");
 }