Search in sources :

Example 1 with IconResolver

use of com.reactnativenavigation.viewcontrollers.stack.topbar.button.IconResolver 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)

Example 2 with IconResolver

use of com.reactnativenavigation.viewcontrollers.stack.topbar.button.IconResolver in project react-native-navigation by wix.

the class TitleBarButtonControllerTest method beforeEach.

@Override
public void beforeEach() {
    Activity activity = newActivity();
    titleBar = new ButtonBar(activity);
    ButtonOptions button = createComponentButton();
    uut = new ButtonController(activity, new ButtonPresenter(activity, button, new IconResolver(activity, ImageLoaderMock.mock())), button, new TitleBarButtonCreatorMock(), Mockito.mock(ButtonController.OnClickListener.class));
}
Also used : ButtonOptions(com.reactnativenavigation.options.ButtonOptions) ButtonController(com.reactnativenavigation.viewcontrollers.stack.topbar.button.ButtonController) ButtonBar(com.reactnativenavigation.views.stack.topbar.titlebar.ButtonBar) ButtonPresenter(com.reactnativenavigation.viewcontrollers.stack.topbar.button.ButtonPresenter) IconResolver(com.reactnativenavigation.viewcontrollers.stack.topbar.button.IconResolver) Activity(android.app.Activity) TitleBarButtonCreatorMock(com.reactnativenavigation.mocks.TitleBarButtonCreatorMock)

Example 3 with IconResolver

use of com.reactnativenavigation.viewcontrollers.stack.topbar.button.IconResolver in project react-native-navigation by wix.

the class NavigationIconResolverTest method beforeEach.

@Override
public void beforeEach() {
    imageLoader = ImageLoaderMock.mock();
    context = newActivity();
    uut = new IconResolver(context, imageLoader);
}
Also used : IconResolver(com.reactnativenavigation.viewcontrollers.stack.topbar.button.IconResolver)

Aggregations

IconResolver (com.reactnativenavigation.viewcontrollers.stack.topbar.button.IconResolver)3 TitleBarButtonCreatorMock (com.reactnativenavigation.mocks.TitleBarButtonCreatorMock)2 Activity (android.app.Activity)1 Context (android.content.Context)1 NonNull (androidx.annotation.NonNull)1 TitleBarReactViewCreatorMock (com.reactnativenavigation.mocks.TitleBarReactViewCreatorMock)1 TopBarBackgroundViewCreatorMock (com.reactnativenavigation.mocks.TopBarBackgroundViewCreatorMock)1 TypefaceLoaderMock (com.reactnativenavigation.mocks.TypefaceLoaderMock)1 ButtonOptions (com.reactnativenavigation.options.ButtonOptions)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 ButtonController (com.reactnativenavigation.viewcontrollers.stack.topbar.button.ButtonController)1 ButtonPresenter (com.reactnativenavigation.viewcontrollers.stack.topbar.button.ButtonPresenter)1 StackLayout (com.reactnativenavigation.views.stack.StackLayout)1 TopBar (com.reactnativenavigation.views.stack.topbar.TopBar)1