-
-
Save ThiagoVinicius/ec64aae9ca5a49fd418f to your computer and use it in GitHub Desktop.
Correctly update dialog resources
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From ffff58b2685bd29cbcc11c06bad87d18d448787d Mon Sep 17 00:00:00 2001 | |
From: =?UTF-8?q?Thiago=20Vin=C3=ADcius=20Freire=20de=20Ara=C3=BAjo=20Ribei?= | |
=?UTF-8?q?ro?= <thiagovfar@gmail.com> | |
Date: Fri, 3 May 2013 21:30:06 -0300 | |
Subject: [PATCH] SystemUI: Update brightness dialog, on updateResources() | |
The small dialog also deserves the chance to get updated | |
resources. | |
Thank you Jiangyi, for finding that one. | |
Patch Set 2: Unbreak things | |
Change-Id: I6e9de7c35abff52c2fcc2952771bb42b406496ed | |
--- | |
.../com/android/systemui/quicksettings/BrightnessTile.java | 12 ++++++++++-- | |
1 file changed, 10 insertions(+), 2 deletions(-) | |
diff --git a/packages/SystemUI/src/com/android/systemui/quicksettings/BrightnessTile.java b/packages/SystemUI/src/com/android/systemui/quicksettings/BrightnessTile.java | |
index 690d80f..cd77751 100644 | |
--- a/packages/SystemUI/src/com/android/systemui/quicksettings/BrightnessTile.java | |
+++ b/packages/SystemUI/src/com/android/systemui/quicksettings/BrightnessTile.java | |
@@ -115,6 +115,14 @@ public class BrightnessTile extends QuickSettingsTile implements BrightnessState | |
@Override | |
public void updateResources() { | |
updateTile(); | |
+ // Dismiss dialog before nullifying it. | |
+ mDismissBrightnessDialogRunnable.run(); | |
+ mBrightnessDialog = null; | |
+ super.updateResources(); | |
+ } | |
+ | |
+ private void updateTileResources() { | |
+ updateTile(); | |
super.updateResources(); | |
} | |
@@ -136,11 +144,11 @@ public class BrightnessTile extends QuickSettingsTile implements BrightnessState | |
@Override | |
public void onBrightnessLevelChanged() { | |
- updateResources(); | |
+ updateTileResources(); | |
} | |
@Override | |
public void onChangeUri(ContentResolver resolver, Uri uri) { | |
- updateResources(); | |
+ updateTileResources(); | |
} | |
} | |
-- | |
1.8.1.2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment