Beispiel #1
0
 public static void PrepareSeparateNotificationsPreference(PreferenceActivity preferenceActivity)
 {
     try
     {
         //depending on Android version, we offer to show a combined notification (with action buttons) (since API level 16)
         Preference separateNotificationsPref = preferenceActivity.FindPreference(preferenceActivity.GetString(Resource.String.ShowSeparateNotifications_key));
         var passwordAccessScreen = ((PreferenceScreen)preferenceActivity.FindPreference(preferenceActivity.GetString(Resource.String.password_access_prefs_key)));
         if ((int)Build.VERSION.SdkInt < 16)
         {
             passwordAccessScreen.RemovePreference(separateNotificationsPref);
         }
     }
     catch (Exception ex)
     {
         Kp2aLog.Log(ex.ToString());
     }
 }
Beispiel #2
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);
                };
            }