Search in sources :

Example 26 with DialogPlusBuilder

use of com.orhanobut.dialogplus.DialogPlusBuilder in project dialogplus by orhanobut.

the class DialogPlusBuilderTest method testContentLayoutParams_whenExpandedTrueAndNotSet.

@Test
public void testContentLayoutParams_whenExpandedTrueAndNotSet() {
    DialogPlusBuilder builder = DialogPlus.newDialog(context);
    builder.setExpanded(true);
    assertThat(builder.getContentParams()).isInstanceOf(FrameLayout.LayoutParams.class);
    //when not expanded
    FrameLayout.LayoutParams params = builder.getContentParams();
    assertThat(builder.isExpanded()).isTrue();
    assertThat(params.width).isEqualTo(ViewGroup.LayoutParams.MATCH_PARENT);
    assertThat(params.height).isEqualTo(builder.getDefaultContentHeight());
    assertThat(params.gravity).isEqualTo(Gravity.BOTTOM);
}
Also used : DialogPlusBuilder(com.orhanobut.dialogplus.DialogPlusBuilder) FrameLayout(android.widget.FrameLayout) Test(org.junit.Test)

Example 27 with DialogPlusBuilder

use of com.orhanobut.dialogplus.DialogPlusBuilder in project dialogplus by orhanobut.

the class DialogPlusBuilderTest method testAdapter.

@Test
public void testAdapter() {
    ArrayAdapter<String> adapter = new ArrayAdapter<>(context, android.R.layout.simple_list_item_1, new String[] { "234" });
    DialogPlusBuilder builder = DialogPlus.newDialog(context).setAdapter(adapter);
    assertThat(builder.getAdapter()).isEqualTo(adapter);
}
Also used : DialogPlusBuilder(com.orhanobut.dialogplus.DialogPlusBuilder) ArrayAdapter(android.widget.ArrayAdapter) Test(org.junit.Test)

Example 28 with DialogPlusBuilder

use of com.orhanobut.dialogplus.DialogPlusBuilder in project dialogplus by orhanobut.

the class DialogPlusBuilderTest method testOutAnimation.

@Test
public void testOutAnimation() {
    DialogPlusBuilder builder = DialogPlus.newDialog(context);
    assertThat(builder.getOutAnimation()).isNotNull();
//TODO
}
Also used : DialogPlusBuilder(com.orhanobut.dialogplus.DialogPlusBuilder) Test(org.junit.Test)

Aggregations

DialogPlusBuilder (com.orhanobut.dialogplus.DialogPlusBuilder)28 Test (org.junit.Test)28 FrameLayout (android.widget.FrameLayout)7 DialogPlus (com.orhanobut.dialogplus.DialogPlus)5 LinearLayout (android.widget.LinearLayout)3 View (android.view.View)2 ArrayAdapter (android.widget.ArrayAdapter)1 GridHolder (com.orhanobut.dialogplus.GridHolder)1 ListHolder (com.orhanobut.dialogplus.ListHolder)1 OnBackPressListener (com.orhanobut.dialogplus.OnBackPressListener)1 OnCancelListener (com.orhanobut.dialogplus.OnCancelListener)1 OnClickListener (com.orhanobut.dialogplus.OnClickListener)1 OnDismissListener (com.orhanobut.dialogplus.OnDismissListener)1 OnItemClickListener (com.orhanobut.dialogplus.OnItemClickListener)1 ViewHolder (com.orhanobut.dialogplus.ViewHolder)1