Search in sources :

Example 1 with SingleChoiceAdapter

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));
}
Also used : Context(android.content.Context) SingleChoiceAdapter(org.robobinding.widget.abslistview.SingleChoiceAdapter) ListView(android.widget.ListView) View(android.view.View) ListView(android.widget.ListView) LinearLayout(android.widget.LinearLayout) Test(org.junit.Test)

Example 2 with SingleChoiceAdapter

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());
}
Also used : SingleChoiceAdapter(org.robobinding.widget.abslistview.SingleChoiceAdapter) EventCommand(org.robobinding.widget.EventCommand) ListAdapter(android.widget.ListAdapter) Before(org.junit.Before)

Example 3 with SingleChoiceAdapter

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));
}
Also used : SingleChoiceAdapter(org.robobinding.widget.abslistview.SingleChoiceAdapter) View(android.view.View) ListView(android.widget.ListView) Test(org.junit.Test)

Aggregations

SingleChoiceAdapter (org.robobinding.widget.abslistview.SingleChoiceAdapter)3 View (android.view.View)2 ListView (android.widget.ListView)2 Test (org.junit.Test)2 Context (android.content.Context)1 LinearLayout (android.widget.LinearLayout)1 ListAdapter (android.widget.ListAdapter)1 Before (org.junit.Before)1 EventCommand (org.robobinding.widget.EventCommand)1