Search in sources :

Example 1 with StackPresenter

use of com.reactnativenavigation.viewcontrollers.stack.StackPresenter in project react-native-navigation by wix.

the class TestUtils method newStackController.

public static StackControllerBuilder newStackController(Activity activity) {
    TopBarController topBarController = new TopBarController() {

        @Override
        protected TopBar createTopBar(@NonNull Context context, @NonNull StackLayout stackLayout) {
            TopBar topBar = super.createTopBar(context, stackLayout);
            topBar.layout(0, 0, 1000, UiUtils.getTopBarHeight(context));
            return topBar;
        }
    };
    return new StackControllerBuilder(activity, Mockito.mock(EventEmitter.class)).setId("stack" + CompatUtils.generateViewId()).setChildRegistry(new ChildControllersRegistry()).setTopBarController(topBarController).setStackPresenter(new StackPresenter(activity, new TitleBarReactViewCreatorMock(), new TopBarBackgroundViewCreatorMock(), new TitleBarButtonCreatorMock(), new IconResolver(activity, new ImageLoader()), new TypefaceLoaderMock(), new RenderChecker(), new Options())).setInitialOptions(new Options());
}
Also used : Context(android.content.Context) Options(com.reactnativenavigation.options.Options) IconResolver(com.reactnativenavigation.viewcontrollers.stack.topbar.button.IconResolver) ChildControllersRegistry(com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry) TitleBarButtonCreatorMock(com.reactnativenavigation.mocks.TitleBarButtonCreatorMock) TypefaceLoaderMock(com.reactnativenavigation.mocks.TypefaceLoaderMock) TopBarBackgroundViewCreatorMock(com.reactnativenavigation.mocks.TopBarBackgroundViewCreatorMock) TitleBarReactViewCreatorMock(com.reactnativenavigation.mocks.TitleBarReactViewCreatorMock) NonNull(androidx.annotation.NonNull) StackLayout(com.reactnativenavigation.views.stack.StackLayout) StackPresenter(com.reactnativenavigation.viewcontrollers.stack.StackPresenter) TopBar(com.reactnativenavigation.views.stack.topbar.TopBar) StackControllerBuilder(com.reactnativenavigation.viewcontrollers.stack.StackControllerBuilder) ImageLoader(com.reactnativenavigation.utils.ImageLoader) TopBarController(com.reactnativenavigation.viewcontrollers.stack.topbar.TopBarController) RenderChecker(com.reactnativenavigation.utils.RenderChecker)

Aggregations

Context (android.content.Context)1 NonNull (androidx.annotation.NonNull)1 TitleBarButtonCreatorMock (com.reactnativenavigation.mocks.TitleBarButtonCreatorMock)1 TitleBarReactViewCreatorMock (com.reactnativenavigation.mocks.TitleBarReactViewCreatorMock)1 TopBarBackgroundViewCreatorMock (com.reactnativenavigation.mocks.TopBarBackgroundViewCreatorMock)1 TypefaceLoaderMock (com.reactnativenavigation.mocks.TypefaceLoaderMock)1 Options (com.reactnativenavigation.options.Options)1 ImageLoader (com.reactnativenavigation.utils.ImageLoader)1 RenderChecker (com.reactnativenavigation.utils.RenderChecker)1 ChildControllersRegistry (com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry)1 StackControllerBuilder (com.reactnativenavigation.viewcontrollers.stack.StackControllerBuilder)1 StackPresenter (com.reactnativenavigation.viewcontrollers.stack.StackPresenter)1 TopBarController (com.reactnativenavigation.viewcontrollers.stack.topbar.TopBarController)1 IconResolver (com.reactnativenavigation.viewcontrollers.stack.topbar.button.IconResolver)1 StackLayout (com.reactnativenavigation.views.stack.StackLayout)1 TopBar (com.reactnativenavigation.views.stack.topbar.TopBar)1