Beispiel #1
0
  public void readData() {

    mNotifyRunBackgroundSwitch.setChecked(
        PreferenceUtils.getPrefBoolean(getActivity(), PreferenceConstants.FOREGROUND, true));
    mNewMsgSoundSwitch.setChecked(
        PreferenceUtils.getPrefBoolean(getActivity(), PreferenceConstants.SCLIENTNOTIFY, false));
    mNewMsgVibratorSwitch.setChecked(
        PreferenceUtils.getPrefBoolean(getActivity(), PreferenceConstants.VIBRATIONNOTIFY, true));
    mVisiableNewMsgSwitch.setChecked(
        PreferenceUtils.getPrefBoolean(getActivity(), PreferenceConstants.TICKER, true));
  }
Beispiel #2
0
  @Override
  public void onCheckedChanged(Switch buttonView, boolean isChecked) {
    switch (buttonView.getId()) {
      case R.id.notify_run_background_switch:
        PreferenceUtils.setPrefBoolean(getActivity(), PreferenceConstants.FOREGROUND, isChecked);
        break;
      case R.id.new_msg_sound_switch:
        PreferenceUtils.setPrefBoolean(getActivity(), PreferenceConstants.SCLIENTNOTIFY, isChecked);
        Setting.setVoiceEnable(isChecked);
        break;
      case R.id.new_msg_vibrator_switch:
        PreferenceUtils.setPrefBoolean(
            getActivity(), PreferenceConstants.VIBRATIONNOTIFY, isChecked);
        Setting.setVibrateEnable(isChecked);
        break;

      case R.id.visiable_new_msg_switch:
        PreferenceUtils.setPrefBoolean(getActivity(), PreferenceConstants.TICKER, isChecked);
        break;
      default:
        break;
    }
  }