Search in sources :

Example 1 with BrightnessController

use of com.android.systemui.settings.BrightnessController in project android_frameworks_base by ParanoidAndroid.

the class BrightnessTile method showBrightnessDialog.

private void showBrightnessDialog() {
    if (mBrightnessDialog == null) {
        mBrightnessDialog = new Dialog(mContext);
        mBrightnessDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        mBrightnessDialog.setContentView(R.layout.quick_settings_brightness_dialog);
        mBrightnessDialog.setCanceledOnTouchOutside(true);
        new BrightnessController(mContext, (ImageView) mBrightnessDialog.findViewById(R.id.brightness_icon), (ToggleSlider) mBrightnessDialog.findViewById(R.id.brightness_slider));
        mBrightnessDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
        mBrightnessDialog.getWindow().getAttributes().privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
        mBrightnessDialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
    }
    if (!mBrightnessDialog.isShowing()) {
        try {
            WindowManagerGlobal.getWindowManagerService().dismissKeyguard();
        } catch (RemoteException e) {
        // Do nothing here
        }
        mBrightnessDialog.show();
        dismissBrightnessDialog(mBrightnessDialogLongTimeout);
    }
}
Also used : BrightnessController(com.android.systemui.settings.BrightnessController) Dialog(android.app.Dialog) RemoteException(android.os.RemoteException)

Aggregations

Dialog (android.app.Dialog)1 RemoteException (android.os.RemoteException)1 BrightnessController (com.android.systemui.settings.BrightnessController)1