use of com.orhanobut.dialogplus.ViewHolder in project dialogplus by orhanobut.
the class DialogPlusTest method testFindViewById.
@Test
public void testFindViewById() {
LinearLayout layout = new LinearLayout(context);
TextView textView = new TextView(context);
textView.setId(android.R.id.text1);
layout.addView(textView);
DialogPlus dialog = DialogPlus.newDialog(context).setContentHolder(new ViewHolder(layout)).create();
assertThat(dialog.findViewById(android.R.id.text1)).isNotNull();
}
use of com.orhanobut.dialogplus.ViewHolder in project dialogplus by orhanobut.
the class DialogPlusBuilderTest method testSetContentHolder.
@Test
public void testSetContentHolder() {
DialogPlusBuilder builder = DialogPlus.newDialog(context);
//Test ListHolder
ListHolder listHolder = new ListHolder();
builder.setContentHolder(listHolder);
assertThat(builder.getHolder()).isEqualTo(listHolder);
//test GridHolder
GridHolder gridHolder = new GridHolder(3);
builder.setContentHolder(gridHolder);
assertThat(builder.getHolder()).isEqualTo(gridHolder);
//test ViewHolder
ViewHolder viewHolder = new ViewHolder(new LinearLayout(context));
builder.setContentHolder(viewHolder);
assertThat(builder.getHolder()).isEqualTo(viewHolder);
//should accept null
builder.setContentHolder(null);
}
use of com.orhanobut.dialogplus.ViewHolder in project dialogplus by orhanobut.
the class DialogPlusTest method testGetHolderView.
@Test
public void testGetHolderView() {
LinearLayout layout = new LinearLayout(context);
DialogPlus dialog = DialogPlus.newDialog(context).setContentHolder(new ViewHolder(layout)).create();
assertThat(dialog.getHolderView()).isEqualTo(layout);
}
use of com.orhanobut.dialogplus.ViewHolder in project dialogplus by orhanobut.
the class DialogPlusTest method testGetHeaderView.
@Test
public void testGetHeaderView() {
LinearLayout layout = new LinearLayout(context);
LinearLayout header = new LinearLayout(context);
DialogPlus dialog = DialogPlus.newDialog(context).setContentHolder(new ViewHolder(layout)).setHeader(header).create();
assertThat(dialog.getHeaderView()).isEqualTo(header);
}
use of com.orhanobut.dialogplus.ViewHolder in project dialogplus by orhanobut.
the class DialogPlusTest method testGetFooterView.
@Test
public void testGetFooterView() {
LinearLayout layout = new LinearLayout(context);
LinearLayout footer = new LinearLayout(context);
DialogPlus dialog = DialogPlus.newDialog(context).setContentHolder(new ViewHolder(layout)).setFooter(footer).create();
assertThat(dialog.getFooterView()).isEqualTo(footer);
}
Aggregations