Hooks for theme changes, locale changes, configuration changes, etc.
| 8 | * Hooks for theme changes, locale changes, configuration changes, etc. |
| 9 | */ |
| 10 | public class InvalidationHook implements Initializable { |
| 11 | public static final InvalidationHook INSTANCE = new InvalidationHook(); |
| 12 | |
| 13 | private boolean mInitialized = false; |
| 14 | |
| 15 | private InvalidationHook() { |
| 16 | } |
| 17 | |
| 18 | @Override |
| 19 | public boolean initialize() { |
| 20 | if (mInitialized) { |
| 21 | return true; |
| 22 | } |
| 23 | // TODO: 2022-01-24 add hooks to Theme changes, configuration changes, etc. |
| 24 | mInitialized = true; |
| 25 | return true; |
| 26 | } |
| 27 | |
| 28 | private static void dispatchConfigurationChanged() { |
| 29 | LayoutHelper.invalidate(); |
| 30 | } |
| 31 | |
| 32 | private static void dispatchThemeChanged() { |
| 33 | Theme.invalidate(); |
| 34 | } |
| 35 | |
| 36 | private static void dispatchLocaleChanged() { |
| 37 | LocaleController.invalidate(); |
| 38 | } |
| 39 | } |
nothing calls this directly
no outgoing calls
no test coverage detected