use of org.robobinding.ItemBinder in project RoboBinding by RoboBinding.
the class BindingTest method newBindingContext.
@SuppressWarnings("unchecked")
private BindingContext newBindingContext() {
BinderProvider binderProvider = mock(BinderProvider.class);
BindableView bindableView = mock(BindableView.class);
when(bindableView.getRootView()).then(new Answer<View>() {
@Override
public View answer(InvocationOnMock invocation) throws Throwable {
return new View(context);
}
});
ItemBinder itemBinder = mock(ItemBinder.class);
when(itemBinder.inflateWithoutAttachingToRoot(anyInt(), anyCollection(), any(ViewGroup.class))).thenReturn(bindableView);
when(binderProvider.createItemBinder(any(BindingContextFactory.class))).thenReturn(itemBinder);
return new BindingContext(binderProvider, context, new PresentationModelAdapterFactory().create(new JavaReflectionPresentationModelObject(new PresentationModelForTest())), PreInitializingViews.initial(true));
}
use of org.robobinding.ItemBinder in project RoboBinding by RoboBinding.
the class DataSetAdapterBuilder method build.
public DataSetAdapter build() {
ItemBinder itemBinder = bindingContext.createItemBinder();
ItemLayoutBinder itemLayoutBinder = new ItemLayoutBinder(itemBinder, itemPredefinedMappings);
ItemLayoutSelector itemLayoutSelector = buildItemLayoutSelector();
DataSetAdapter dataSetAdapter = new DataSetAdapter(valueModelWithPreInitializeViews(), itemLayoutBinder, itemLayoutSelector, new ViewTags<RefreshableItemPresentationModel>(ITEM_PRESENTATION_MODEL_KEY), bindingContext.shouldPreInitializeViews());
registerPropertyChangeListener(dataSetAdapter);
return dataSetAdapter;
}
use of org.robobinding.ItemBinder in project RoboBinding by RoboBinding.
the class DataSetAdapterBuilder method build.
public DataSetAdapter build() {
ItemBinder itemBinder = bindingContext.createItemBinder();
ItemLayoutBinder itemLayoutBinder = new ItemLayoutBinder(itemBinder, itemPredefinedMappings);
ItemLayoutBinder dropdownLayoutBinder = new ItemLayoutBinder(itemBinder, dropdownPredefinedMappings);
ItemLayoutSelector itemLayoutSelector = buildItemLayoutSelector();
DataSetAdapter dataSetAdapter = new DataSetAdapter(valueModelWithPreInitializingViews(), itemLayoutBinder, dropdownLayoutBinder, itemLayoutSelector, dropdownLayoutId, new ViewTags<RefreshableItemPresentationModel>(ITEM_PRESENTATION_MODEL_KEY), bindingContext.shouldPreInitializeViews());
registerPropertyChangeListener(dataSetAdapter);
return dataSetAdapter;
}
Aggregations