private void EnableSwitchPreferences(bool switchOnRooted) { if (!switchOnRooted) { if (_fragment.FindPreference(_act.GetString(Resource.String.OpenKp2aKeyboardAutomatically_key)) == null) { _screen.AddPreference(_openKp2aAutoPref); } if (_fragment.FindPreference(_act.GetString(Resource.String.OpenKp2aKeyboardAutomaticallyOnlyAfterSearch_key)) != null) { _screen.RemovePreference(_openOnlyOnSearchPref); } } else { { _screen.RemovePreference(_openKp2aAutoPref); } if (_fragment.FindPreference(_act.GetString(Resource.String.OpenKp2aKeyboardAutomaticallyOnlyAfterSearch_key)) == null) { _screen.AddPreference(_openOnlyOnSearchPref); } } /*_openKp2aAutoPref.Enabled = !switchOnRooted; * * _openOnlyOnSearchPref.Enabled = switchOnRooted; * * _switchBackPref.Enabled = switchOnRooted;*/ }
protected override void OnAddPreferences(PreferenceScreen preferenceScreen) { base.OnAddPreferences(preferenceScreen); // Add about button Preference aboutPreference = new Preference(Context); aboutPreference.Title = "About"; aboutPreference.Summary = "App info and credits"; aboutPreference.PreferenceClick += AboutPreference_PreferenceClick; preferenceScreen.AddPreference(aboutPreference); }
private void TogglePreferences() { var isTeacher = AndroidDependencyContainer.Instance.ScheduleSettings.IsUserTeacher; if (isTeacher) { PreferenceScreen.RemovePreference(groupNumberPreference); PreferenceScreen.AddPreference(teacherNamePreference); } else { PreferenceScreen.RemovePreference(teacherNamePreference); PreferenceScreen.AddPreference(groupNumberPreference); } }