@Test(expected = IllegalStateException.class) public void viewManagerThrowsIfActivityRestartedTwice() { mockActivity(); viewManager.registerActivity(rootActivity, rootActivity); }
@MainThread public final void registerActivity(@NonNull RootActivityContract activityContract, @NonNull Activity rootActivity) { allMustBeBeNull("Trying to register new foreground activity, but old resources are not cleaned", foregroundActivity, this.activityContract, contentRootView, inflater); this.activityContract = activityContract; this.foregroundActivity = rootActivity; this.inflater = foregroundActivity.getLayoutInflater(); this.contentRootView = activityContract.getContentRootView(); activityContract.hookIntoLifecycle(this); if (viewStack.isEmpty()) { renderFirstView(activityContract.getFirstView()); } else { reRenderTopView(); } }
ViewManager implements Observer<LifecycleEvent> { @MainThread public final void registerActivity(@NonNull RootActivityContract activityContract, @NonNull Activity rootActivity) { allMustBeBeNull("Trying to register new foreground activity, but old resources are not cleaned", foregroundActivity, this.activityContract, contentRootView, inflater); this.activityContract = activityContract; this.foregroundActivity = rootActivity; this.inflater = foregroundActivity.getLayoutInflater(); this.contentRootView = activityContract.getContentRootView(); activityContract.hookIntoLifecycle(this); if (viewStack.isEmpty()) { renderFirstView(activityContract.getFirstView()); } else { reRenderTopView(); } } }
ViewManager implements Observer<LifecycleEvent> { @MainThread public final void registerActivity(@NonNull RootActivityContract activityContract, @NonNull Activity rootActivity) { allMustBeBeNull("Trying to register new foreground activity, but old resources are not cleaned", foregroundActivity, this.activityContract, contentRootView, inflater); this.activityContract = activityContract; this.foregroundActivity = rootActivity; this.inflater = foregroundActivity.getLayoutInflater(); this.contentRootView = activityContract.getContentRootView(); activityContract.hookIntoLifecycle(this); if (viewStack.isEmpty()) { renderFirstView(activityContract.getFirstView()); } else { reRenderTopView(); } } ViewManager(@NonNull GraphProvider graphProvider); }
ViewManager implements Observer<LifecycleEvent> { @MainThread public final void registerActivity(@NonNull RootActivityContract activityContract, @NonNull Activity rootActivity) { allMustBeBeNull("Trying to register new foreground activity, but old resources are not cleaned", foregroundActivity, this.activityContract, contentRootView, inflater); this.activityContract = activityContract; this.foregroundActivity = rootActivity; this.inflater = foregroundActivity.getLayoutInflater(); this.contentRootView = activityContract.getContentRootView(); activityContract.hookIntoLifecycle(this); if (viewStack.isEmpty()) { renderFirstView(activityContract.getFirstView()); } else { reRenderTopView(); } } ViewManager(@NonNull GraphProvider graphProvider); @MainThread final void registerActivity(@NonNull RootActivityContract activityContract,
                                     @NonNull Activity rootActivity); @MainThread final void unregisterActivity(); @Override void onNext(LifecycleEvent lifecycleEvent); @Override void onCompleted(); @Override void onError(Throwable e); @MainThread final boolean handleBackPress(); }
ViewManager implements Observer<LifecycleEvent> { @MainThread public final void registerActivity(@NonNull RootActivityContract activityContract, @NonNull Activity rootActivity) { allMustBeBeNull("Trying to register new foreground activity, but old resources are not cleaned", foregroundActivity, this.activityContract, contentRootView, inflater); this.activityContract = activityContract; this.foregroundActivity = rootActivity; this.inflater = foregroundActivity.getLayoutInflater(); this.contentRootView = activityContract.getContentRootView(); activityContract.hookIntoLifecycle(this); if (viewStack.isEmpty()) { renderFirstView(activityContract.getFirstView()); } else { reRenderTopView(); } } ViewManager(@NonNull GraphProvider graphProvider); @MainThread final void registerActivity(@NonNull RootActivityContract activityContract,
                                     @NonNull Activity rootActivity); @MainThread final void unregisterActivity(); @Override void onNext(LifecycleEvent lifecycleEvent); @Override void onCompleted(); @Override void onError(Throwable e); @MainThread final boolean handleBackPress();  }