use of com.orhanobut.dialogplus.DialogPlusBuilder in project dialogplus by orhanobut.
the class DialogPlusBuilderTest method testExpanded.
@Test
public void testExpanded() {
DialogPlusBuilder builder = DialogPlus.newDialog(context);
//default should be false
assertThat(builder.isExpanded()).isFalse();
builder.setExpanded(true);
assertThat(builder.isExpanded()).isTrue();
}
use of com.orhanobut.dialogplus.DialogPlusBuilder in project dialogplus by orhanobut.
the class DialogPlusBuilderTest method testPadding.
@Test
public void testPadding() {
DialogPlusBuilder builder = DialogPlus.newDialog(context);
//default 0
int[] padding = builder.getContentPadding();
assertThat(padding[0]).isEqualTo(0);
assertThat(padding[1]).isEqualTo(0);
assertThat(padding[2]).isEqualTo(0);
assertThat(padding[3]).isEqualTo(0);
builder.setPadding(1, 2, 3, 4);
padding = builder.getContentPadding();
assertThat(padding[0]).isEqualTo(1);
assertThat(padding[1]).isEqualTo(2);
assertThat(padding[2]).isEqualTo(3);
assertThat(padding[3]).isEqualTo(4);
}
use of com.orhanobut.dialogplus.DialogPlusBuilder in project dialogplus by orhanobut.
the class DialogPlusBuilderTest method testContentMarginWhenSet.
@Test
public void testContentMarginWhenSet() {
DialogPlusBuilder builder = DialogPlus.newDialog(context);
builder.setMargin(1, 2, 3, 4);
int[] margin = builder.getContentMargin();
assertThat(margin[0]).isEqualTo(1);
assertThat(margin[1]).isEqualTo(2);
assertThat(margin[2]).isEqualTo(3);
assertThat(margin[3]).isEqualTo(4);
}
use of com.orhanobut.dialogplus.DialogPlusBuilder 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.DialogPlusBuilder in project dialogplus by orhanobut.
the class DialogPlusBuilderTest method testHeader.
@Test
public void testHeader() {
DialogPlusBuilder builder = DialogPlus.newDialog(context);
builder.setHeader(android.R.layout.simple_list_item_1);
assertThat(builder.getHeaderView()).isNotNull();
LinearLayout headerView = new LinearLayout(context);
builder.setHeader(headerView);
assertThat(builder.getHeaderView()).isEqualTo(headerView);
}
Aggregations