FileDocCategorySizeDatePackage
BrightnessDialog.javaAPI DocAndroid 5.1 API2450Thu Mar 12 22:22:42 GMT 2015com.android.systemui.settings

BrightnessDialog

public class BrightnessDialog extends android.app.Activity
A dialog that provides controls for adjusting the screen brightness.

Fields Summary
private BrightnessController
mBrightnessController
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);

        final Window window = getWindow();

        window.setGravity(Gravity.TOP);
        window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
        window.requestFeature(Window.FEATURE_NO_TITLE);

        setContentView(R.layout.quick_settings_brightness_dialog);

        final ImageView icon = (ImageView) findViewById(R.id.brightness_icon);
        final ToggleSlider slider = (ToggleSlider) findViewById(R.id.brightness_slider);
        mBrightnessController = new BrightnessController(this, icon, slider);
    
public booleanonKeyDown(int keyCode, android.view.KeyEvent event)

        if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN
                || keyCode == KeyEvent.KEYCODE_VOLUME_UP
                || keyCode == KeyEvent.KEYCODE_VOLUME_MUTE) {
            finish();
        }

        return super.onKeyDown(keyCode, event);
    
protected voidonStart()

        super.onStart();
        mBrightnessController.registerCallbacks();
    
protected voidonStop()

        super.onStop();
        mBrightnessController.unregisterCallbacks();