androidannotation中的OnViewChangedNotifier有什么作用?
闭关修行中......
Look directly at the code 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); } } }
You can clearly see that it is a helper class used to call onViewChanged to notify OnViewChangedListener that a View state has changed.
Look directly at the code OnViewChangedNotifier
You can clearly see that it is a helper class used to call onViewChanged to notify OnViewChangedListener that a View state has changed.