コード例 #1
0
 @Override
 public boolean onPreferenceDone(Preference preference, String newValue) {
   if (mLcdDensity == preference) {
     mSetting.setLcdDensity(newValue);
     mLcdDensity.setSummary(Misc.getCurrentValueText(this, newValue));
     // not return true
   }
   return false;
 }
コード例 #2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    addPreferencesFromResource(R.xml.general_system_property_pref);

    mSetting = new SystemPropertySetting(this);

    boolean value;

    value = mSetting.getCameraSound();
    mCameraSound = (CheckBoxPreference) findPreference(SystemPropertySetting.KEY_CAMERA_SOUND);
    mCameraSound.setChecked(value);
    mCameraSound.setOnPreferenceChangeListener(this);

    String lcdDensity = mSetting.getLcdDensity();
    mLcdDensity = (SeekBarPreference) findPreference(SystemPropertySetting.KEY_LCD_DENSITY);
    mLcdDensity.setValue(300, 120, Integer.valueOf(lcdDensity));
    mLcdDensity.setSummary(Misc.getCurrentValueText(this, lcdDensity));
    mLcdDensity.setOnPreferenceDoneListener(this);

    value = mSetting.getCrtEffect();
    mCrtEffect = (CheckBoxPreference) findPreference(SystemPropertySetting.KEY_CRT_EFFECT);
    mCrtEffect.setChecked(value);
    mCrtEffect.setOnPreferenceChangeListener(this);

    value = mSetting.getLogger();
    mLogger = (CheckBoxPreference) findPreference(SystemPropertySetting.KEY_LOGGER);
    mLogger.setChecked(value);
    mLogger.setOnPreferenceChangeListener(this);

    value = mSetting.getCifs();
    mCifs = (CheckBoxPreference) findPreference(SystemPropertySetting.KEY_CIFS);
    mCifs.setChecked(value);
    mCifs.setOnPreferenceChangeListener(this);

    value = mSetting.getNtfs();
    mNtfs = (CheckBoxPreference) findPreference(SystemPropertySetting.KEY_NTFS);
    mNtfs.setChecked(value);
    mNtfs.setOnPreferenceChangeListener(this);

    value = mSetting.getJ4fs();
    mJ4fs = (CheckBoxPreference) findPreference(SystemPropertySetting.KEY_J4FS);
    mJ4fs.setChecked(value);
    mJ4fs.setOnPreferenceChangeListener(this);

    String strValue = mSetting.getUsbConfig();
    mUsbConfig = (ListPreference) findPreference(SystemPropertySetting.KEY_USB_CONFIG);
    mUsbConfig.setValue(strValue);
    mUsbConfig.setSummary(
        Misc.getCurrentValueText(
            this,
            Misc.getEntryFromEntryValue(
                mUsbConfig.getEntries(), mUsbConfig.getEntryValues(), strValue)));
    mUsbConfig.setOnPreferenceChangeListener(this);
  }