@Test public void after_views_mother_calls_first() { OnViewChangedNotifier notifier = new OnViewChangedNotifier(); OnViewChangedNotifier.replaceNotifier(notifier); Child_ child = Child_.getInstance_(mock(Activity.class)); notifier.notifyViewChanged(mock(HasViews.class)); assertThat(child.motherInitViewsWasCalled).isTrue(); }
@Override public void setContentView(View view) { super.setContentView(view); onViewChangedNotifier_.notifyViewChanged(this); }
@Override public void setContentView(View view, LayoutParams params) { super.setContentView(view, params); onViewChangedNotifier_.notifyViewChanged(this); }
@Override public void setContentView(int layoutResID) { super.setContentView(layoutResID); onViewChangedNotifier_.notifyViewChanged(this); }
@Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); onViewChangedNotifier_.notifyViewChanged(this); }