summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/cyngn/theme/chooser/ComponentSelector.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/cyngn/theme/chooser/ComponentSelector.java b/src/com/cyngn/theme/chooser/ComponentSelector.java
index 5c59b31..f3f4af2 100644
--- a/src/com/cyngn/theme/chooser/ComponentSelector.java
+++ b/src/com/cyngn/theme/chooser/ComponentSelector.java
@@ -197,6 +197,19 @@ public class ComponentSelector extends LinearLayout
mThemesObserver.unregister();
}
+ @Override
+ protected void onWindowVisibilityChanged(int visibility) {
+ super.onWindowVisibilityChanged(visibility);
+ // Window visibility transitions as follows
+ // VISIBLE -> INVISIBLE -> GONE
+ // GONE -> INVISIBLE -> VISIBLE
+ if (visibility == View.GONE) {
+ mThemesObserver.unregister();
+ } else if (visibility == View.VISIBLE) {
+ mThemesObserver.register();
+ }
+ }
+
public void setComponentType(String component) {
setComponentType(component, null, DEFAULT_COMPONENT_ID);
}