扫码关注官方订阅号
androidannotation中的OnViewChangedNotifier有什么作用?
闭关修行中......
直接看代码 OnViewChangedNotifier
public class OnViewChangedNotifier { private static OnViewChangedNotifier currentNotifier; public static OnViewChangedNotifier replaceNotifier(OnViewChangedNotifier notifier) { OnViewChangedNotifier previousNotifier = currentNotifier; currentNotifier = notifier; return previousNotifier; } public static void registerOnViewChangedListener(OnViewChangedListener listener) { if (currentNotifier != null) { currentNotifier.listeners.add(listener); } } private final Set<OnViewChangedListener> listeners = new LinkedHashSet<>(); public void notifyViewChanged(HasViews hasViews) { for (OnViewChangedListener listener : listeners) { listener.onViewChanged(hasViews); } } }
可以很明显的看到是用来调用 onViewChanged 来通知 OnViewChangedListener 说明一个 View 状态改变了的助手类。
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
直接看代码 OnViewChangedNotifier
可以很明显的看到是用来调用 onViewChanged 来通知 OnViewChangedListener 说明一个 View 状态改变了的助手类。