Merge "Fix theming on brightness dialog" into oc-dev

This commit is contained in:
TreeHugger Robot
2017-04-07 17:37:46 +00:00
committed by Android (Google) Code Review
2 changed files with 13 additions and 1 deletions

View File

@@ -2961,5 +2961,8 @@
<java-symbol type="string" name="etws_primary_default_message_test" />
<java-symbol type="string" name="etws_primary_default_message_others" />
<java-symbol type="bool" name="config_quickSettingsSupported" />
<java-symbol type="style" name="Theme.DeviceDefault.QuickSettings" />
</resources>

View File

@@ -18,8 +18,11 @@ package com.android.systemui.settings;
import android.app.Activity;
import android.os.Bundle;
import android.view.ContextThemeWrapper;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
@@ -43,7 +46,13 @@ public class BrightnessDialog extends Activity {
window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
window.requestFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.quick_settings_brightness_dialog);
// Use a dialog theme as the activity theme, but inflate the content as
// the QS content.
ContextThemeWrapper themedContext = new ContextThemeWrapper(this,
com.android.internal.R.style.Theme_DeviceDefault_QuickSettings);
View v = LayoutInflater.from(themedContext).inflate(
R.layout.quick_settings_brightness_dialog, null);
setContentView(v);
final ImageView icon = (ImageView) findViewById(R.id.brightness_icon);
final ToggleSliderView slider = (ToggleSliderView) findViewById(R.id.brightness_slider);