Methods Summary |
---|
protected void | onBindDialogView(android.view.View view)
super.onBindDialogView(view);
mSeekBar = getSeekBar(view);
mSeekBar.setOnSeekBarChangeListener(this);
mSeekBar.setMax(MAXIMUM_BACKLIGHT - MINIMUM_BACKLIGHT);
try {
mOldBrightness = Settings.System.getInt(getContext().getContentResolver(),
Settings.System.SCREEN_BRIGHTNESS);
} catch (SettingNotFoundException snfe) {
mOldBrightness = MAXIMUM_BACKLIGHT;
}
mSeekBar.setProgress(mOldBrightness - MINIMUM_BACKLIGHT);
|
protected void | onDialogClosed(boolean positiveResult)
super.onDialogClosed(positiveResult);
if (positiveResult) {
Settings.System.putInt(getContext().getContentResolver(),
Settings.System.SCREEN_BRIGHTNESS,
mSeekBar.getProgress() + MINIMUM_BACKLIGHT);
} else {
setBrightness(mOldBrightness);
}
|
public void | onProgressChanged(android.widget.SeekBar seekBar, int progress, boolean fromTouch)
setBrightness(progress + MINIMUM_BACKLIGHT);
|
public void | onStartTrackingTouch(android.widget.SeekBar seekBar)
// NA
|
public void | onStopTrackingTouch(android.widget.SeekBar seekBar)
// NA
|
private void | setBrightness(int brightness)
try {
IHardwareService hardware = IHardwareService.Stub.asInterface(
ServiceManager.getService("hardware"));
if (hardware != null) {
hardware.setBacklights(brightness);
}
} catch (RemoteException doe) {
}
|