@Test public void testCount() throws Throwable { MainPresenter mainPresenter = new MainPresenter(null); verify(view, never()).showBinderCounter(anyInt()); mainPresenter.onBindChange(view); verify(view).showBinderCounter(1); mainPresenter.onBindChange(null); mainPresenter.onBindChange(view); verify(view).showBinderCounter(2); }
@Override public void onBindChange(@Nullable View view) { super.onBindChange(view); onView(v -> v.showBinderCounter(++bindCounter)); onView(v -> { if (doInit) { doInit = false; v.showFragment(startingFragment); } }); }
MainPresenter extends ComponentPresenter<MainPresenter.View, MainComponent> { @Override public void onBindChange(@Nullable View view) { super.onBindChange(view); onView(v -> v.showBinderCounter(++bindCounter)); onView(v -> { if (doInit) { doInit = false; v.showFragment(startingFragment); } }); } }
MainPresenter extends ComponentPresenter<MainPresenter.View, MainComponent> { @Override public void onBindChange(@Nullable View view) { super.onBindChange(view); onView(v -> v.showBinderCounter(++bindCounter)); onView(v -> { if (doInit) { doInit = false; v.showFragment(startingFragment); } }); } @Inject  MainPresenter(Class<? extends Fragment> startingFragment); }
MainPresenter extends ComponentPresenter<MainPresenter.View, MainComponent> { @Override public void onBindChange(@Nullable View view) { super.onBindChange(view); onView(v -> v.showBinderCounter(++bindCounter)); onView(v -> { if (doInit) { doInit = false; v.showFragment(startingFragment); } }); } @Inject  MainPresenter(Class<? extends Fragment> startingFragment); @Override void onCreate(@Nullable Bundle savedInstanceState); @Override void onSaveInstanceState(@NonNull Bundle outState); @Override void onBindChange(@Nullable View view); }
MainPresenter extends ComponentPresenter<MainPresenter.View, MainComponent> { @Override public void onBindChange(@Nullable View view) { super.onBindChange(view); onView(v -> v.showBinderCounter(++bindCounter)); onView(v -> { if (doInit) { doInit = false; v.showFragment(startingFragment); } }); } @Inject  MainPresenter(Class<? extends Fragment> startingFragment); @Override void onCreate(@Nullable Bundle savedInstanceState); @Override void onSaveInstanceState(@NonNull Bundle outState); @Override void onBindChange(@Nullable View view);  }