MCPcopy Create free account
hub / github.com/cinit/TMoe / InvalidationHook

Class InvalidationHook

app/src/main/java/cc/ioctl/tmoe/hook/core/InvalidationHook.java:10–39  ·  view source on GitHub ↗

Hooks for theme changes, locale changes, configuration changes, etc.

Source from the content-addressed store, hash-verified

8 * Hooks for theme changes, locale changes, configuration changes, etc.
9 */
10public 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected