//private TunnelInstance tunnel = TunnelInstance.Instance;

		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			AddPreferencesFromResource(Resource.Layout.Settings);

			portNumberPref = (EditTextPreference) FindPreference("tunnelPort");
			deviceListPref = (ListPreference) FindPreference("bluetoothDevice");
			listenForClientsPref = (CheckBoxPreference) FindPreference("listenForClients");

			enableStreaming = (CheckBoxPreference) FindPreference("streamVideo");;
			rtspPort = (EditTextPreference) FindPreference("rtspPort");;
			videoPort = (EditTextPreference) FindPreference("videoPort");;
			resolution = (ListPreference) FindPreference("videoResolution");;
			videoQuality = (ListPreference) FindPreference("videoQuality");;
			frameRate = (ListPreference) FindPreference("frameRate");;

			portNumberPref.OnPreferenceChangeListener = this;
			deviceListPref.OnPreferenceChangeListener = this;
			listenForClientsPref.OnPreferenceChangeListener = this;

			enableStreaming.OnPreferenceChangeListener = this;
			rtspPort.OnPreferenceChangeListener = this;
			videoPort.OnPreferenceChangeListener = this;
			resolution.OnPreferenceChangeListener = this;
			videoQuality.OnPreferenceChangeListener = this;
			frameRate.OnPreferenceChangeListener = this;
		}
 protected override void OnCreate(Bundle bundle)
 {
     base.OnCreate(bundle);
     SupportActionBar.Hide();
     userDao = new UserDao();
     AddPreferencesFromResource(Resource.Layout.Config);
     autoLogin = (CheckBoxPreference)FindPreference("checkbox_preference");
     autoLogin.PreferenceChange += new System.EventHandler<Preference.PreferenceChangeEventArgs>(autoLogin_PreferenceChange);
     autoLogin.Checked = userDao.isAutologinEnabled();
 }
Пример #3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            Settings.Instance.Load ();

            // Create your application here
            AddPreferencesFromResource (Resource.Layout.Settings);

            prefBlacklist = FindPreference ("pref_blacklist");
            prefReorder = FindPreference ("pref_reorder");

            prefDisableHomeDetect = (CheckBoxPreference)FindPreference ("pref_disablecheck");
            prefWallpaperUrl = (EditTextPreference)FindPreference ("pref_WallpaperUrl");

            prefBlacklist.PreferenceClick += delegate {
                StartActivity (typeof (SettingsAppShowHideActivity));
            };
            prefReorder.PreferenceClick += delegate {
                StartActivity (typeof (ReorderActivity));
            };

            // Start the intent service, it will decide to stop itself or not
            prefDisableHomeDetect.PreferenceChange += (sender, e) =>
                StartService (new Intent (this, typeof(ExcuseMeService)));

            prefWallpaperUrl.PreferenceChange += (sender, e) => {
                AndHUD.Shared.Show(this, "Downloading Wallpaper...");

                var url = prefWallpaperUrl.EditText.Text;

                Task.Factory.StartNew (() => {

                    try {
                        var http = new System.Net.WebClient ();
                        var bytes = http.DownloadData (url);
                        var path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments);
                        var filename = System.IO.Path.Combine(path, "wallpaper.png");
                        System.IO.File.WriteAllBytes (filename, bytes);

                        AndHUD.Shared.Dismiss (this);
                    } catch (Exception ex) {

                        AndHUD.Shared.Dismiss (this);

                        Settings.Instance.WallpaperUrl = string.Empty;

                        Toast.MakeText (this, "Failed to Download Wallpaper", ToastLength.Long).Show ();
                        Log.Error ("Downloading Wallpaper Failed", ex);
                    }
                });
            };
        }
        private void PopulateAvailableWidgetsList()
        {
            var availableWidgetsCategory = (PreferenceScreen)FindPreference("GlobalSettings.AvailableWidgets");
            
            foreach (var widgetModel in SmeedeeApp.Instance.AvailableWidgets)
            {
                if (widgetModel.Type == typeof(StartPageWidget)) continue;

                var checkBox = new CheckBoxPreference(this)
                                   {
                                       Checked = widgetModel.Enabled,
                                       Title = widgetModel.Name,
                                       Summary = widgetModel.StaticDescription,
                                       Key = widgetModel.Name,
                                   };
                availableWidgetsCategory.AddPreference(checkBox);
            }
        }
		public override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);

			AddPreferencesFromResource (Resource.Xml.custom_prefs);

			// This sample app uses shared preferences to maintain app restriction settings.  Your app
			// can use other methods to maintain the settings.
			mBooleanPref = FindPreference (KEY_BOOLEAN_PREF) as CheckBoxPreference;
			mChoicePref = FindPreference (KEY_CHOICE_PREF) as ListPreference;
			mMultiPref = FindPreference (KEY_MULTI_PREF) as MultiSelectListPreference;

			mBooleanPref.PreferenceChange += OnPreferenceChange;
			mChoicePref.PreferenceChange += OnPreferenceChange;
			mMultiPref.PreferenceChange += OnPreferenceChange;

			RetainInstance = true;
		}
        protected override void OnCreate(Bundle bundle)
        {
            SetTheme(PreferenceManager.GetDefaultSharedPreferences(ApplicationContext).GetInt("ThemeStyle", Resource.Style.Theme_Sherlock));

            base.OnCreate(bundle);

            this.AddPreferencesFromResource(Resource.Layout.PreferencesLayout);

            cp = (CheckBoxPreference)FindPreference("dualWebviews");
            slp = (ListPreference)FindPreference("listSecondLanguage");

            CheckBoxPreference notesReplace = (CheckBoxPreference)FindPreference("notesReplace");
            CheckBoxPreference allowHighlighting = (CheckBoxPreference)FindPreference("allowHighlighting");
            CheckBoxPreference recordEveryHighlight = (CheckBoxPreference)FindPreference("recordEveryHighlight");

            //notesReplace.Enabled = false;
            //notesReplace.Selectable = false;
            //notesReplace.SetDefaultValue(false);
            //allowHighlighting.Enabled = false;
            //allowHighlighting.Selectable = false;
            //allowHighlighting.SetDefaultValue(false);
            //recordEveryHighlight.Enabled = false;
            //recordEveryHighlight.Selectable = false;
            //recordEveryHighlight.SetDefaultValue(false);
        }
Пример #7
0
            public KeyboardSwitchPrefManager(PreferenceActivity act)
            {
                this._act = act;

                _switchPref = (CheckBoxPreference)_act.FindPreference("kp2a_switch_rooted");
                _openKp2aAutoPref =
                    (CheckBoxPreference)act.FindPreference(act.GetString(Resource.String.OpenKp2aKeyboardAutomatically_key));
                _openOnlyOnSearchPref =
                    (CheckBoxPreference)
                    act.FindPreference(act.GetString(Resource.String.OpenKp2aKeyboardAutomaticallyOnlyAfterSearch_key));
                _switchBackPref =
                    (CheckBoxPreference)act.FindPreference(act.GetString(Resource.String.AutoSwitchBackKeyboard_key));
                _screen = (PreferenceScreen)act.FindPreference(act.GetString(Resource.String.keyboardswitch_prefs_key));
                EnableSwitchPreferences(_switchPref.Checked);

                _switchPref.PreferenceChange += (sender, args) =>
                {
                    bool switchOnRooted = (bool)args.NewValue;
                    EnableSwitchPreferences(switchOnRooted);
                };
            }
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			settings = RemoteSettings.Instance;
			brickController = BrickController.Instance;

			AddPreferencesFromResource(Resource.Layout.Settings);

			deviceList = (ListPreference) FindPreference("bluetoothDevice");
			brickType = (ListPreference) FindPreference("brickType");


			leftMotor = (ListPreference) FindPreference("leftMotor");
			rightMotor = (ListPreference) FindPreference("rightMotor");
			additionalMotor = (ListPreference) FindPreference("additionalMotor");

			leftMotorReverse = (CheckBoxPreference) FindPreference("reverseLeftMotor");
			rightMotorReverse = (CheckBoxPreference) FindPreference("reverseRightMotor");
			additionalMotorReverse = (CheckBoxPreference) FindPreference("reverseAdditionalMotor");

			sendVehicleDataToMailbox = (CheckBoxPreference) FindPreference("sendVehicleDataToMailbox");
			vehicleMailbox = (ListPreference) FindPreference("vehicleMailbox");
			vehicleAngleOffset = (ListPreference) FindPreference("vehicleAngleOffset");

			sensorValueToSpeech = (CheckBoxPreference) FindPreference("sensorValueToSpeech");

			deviceList.OnPreferenceChangeListener = this;
			brickType.OnPreferenceChangeListener = this;


			leftMotor.OnPreferenceChangeListener = this;
			rightMotor.OnPreferenceChangeListener = this;
			additionalMotor.OnPreferenceChangeListener = this;

			leftMotorReverse.OnPreferenceChangeListener = this;
			rightMotorReverse.OnPreferenceChangeListener = this;
			additionalMotorReverse.OnPreferenceChangeListener = this;

			sendVehicleDataToMailbox.OnPreferenceChangeListener = this;
			vehicleMailbox.OnPreferenceChangeListener = this;

			sensorValueToSpeech.OnPreferenceChangeListener = this;
			
			vehicleAngleOffset.OnPreferenceChangeListener = this;
			
		}