use of org.robobinding.widget.abslistview.SingleChoiceAdapter in project RoboBinding by RoboBinding.
the class HeaderAttributesTest method shouldNestSubViewWithinLinearLayoutContainerAndAddAsHeader.
@Test
public void shouldNestSubViewWithinLinearLayoutContainerAndAddAsHeader() {
Context context = RuntimeEnvironment.application;
ListView listView = new ListView(context);
View subView = new View(context);
headerAttributes.addSubView(listView, subView, context);
listView.setAdapter(new SingleChoiceAdapter(context));
List<View> headerViews = Shadows.shadowOf(listView).getHeaderViews();
assertThat(headerViews.size(), is(1));
LinearLayout linearLayout = (LinearLayout) headerViews.get(0);
assertThat(linearLayout.getChildAt(0), is(subView));
}
use of org.robobinding.widget.abslistview.SingleChoiceAdapter in project RoboBinding by RoboBinding.
the class OnItemClickAttributeTest method setUp.
@Before
public void setUp() {
attribute = new OnItemClickAttribute();
eventCommand = new EventCommand();
ListAdapter arrayAdapter = new SingleChoiceAdapter(RuntimeEnvironment.application);
view.setAdapter(arrayAdapter);
indexToClick = RandomValues.anyIndex(arrayAdapter.getCount());
}
use of org.robobinding.widget.abslistview.SingleChoiceAdapter in project RoboBinding by RoboBinding.
the class FooterAttributesTest method shouldAddSubViewToListView.
@Test
public void shouldAddSubViewToListView() {
footerAttributes.addSubView(listView, subView, context);
listView.setAdapter(new SingleChoiceAdapter(context));
List<View> footerViews = Shadows.shadowOf(listView).getFooterViews();
assertThat(footerViews.size(), is(1));
assertThat(footerViews.get(0), is(subView));
}
Aggregations