use of com.reactnativenavigation.views.bottomtabs.BottomTabs in project react-native-navigation by wix.
the class BottomTabPresenterTest method createBottomTabs.
private void createBottomTabs(Options tab1Options, Options tab2Options, Options tab3Options) {
childRegistry = new ChildControllersRegistry();
bottomTabs = Mockito.mock(BottomTabs.class);
child1 = spy(new SimpleViewController(activity, childRegistry, "child1", tab1Options));
child2 = spy(new SimpleViewController(activity, childRegistry, "child2", tab2Options));
child3 = spy(new SimpleViewController(activity, childRegistry, "child2", tab3Options));
tabs = Arrays.asList(child1, child2, child3);
uut = new BottomTabPresenter(activity, tabs, ImageLoaderMock.mock(), new TypefaceLoaderMock(), new Options());
uut.bindView(bottomTabs);
uut.setDefaultOptions(new Options());
}
use of com.reactnativenavigation.views.bottomtabs.BottomTabs in project react-native-navigation by wix.
the class BottomTabPresenter method mergeDotIndicator.
private void mergeDotIndicator(int index, DotIndicatorOptions dotIndicator) {
if (bottomTabs == null)
return;
AHNotification.Builder builder = new AHNotification.Builder();
if (dotIndicator.color.hasValue())
builder.setBackgroundColor(dotIndicator.color.get());
builder.setSize(dotIndicator.visible.isFalse() ? 0 : dotIndicator.size.get(defaultDotIndicatorSize));
if (dotIndicator.animate.hasValue())
builder.animate(dotIndicator.animate.get());
AHNotification notification = builder.build();
if (notification.hasValue())
bottomTabs.perform(bottomTabs -> bottomTabs.setNotification(notification, index));
}
Aggregations