Search in sources :

Example 21 with DialogPlusBuilder

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

the class DialogPlusBuilderTest method testInAnimation.

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

Example 22 with DialogPlusBuilder

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

the class DialogPlusBuilderTest method testSetOnBackPressListener.

@Test
public void testSetOnBackPressListener() {
    DialogPlusBuilder builder = DialogPlus.newDialog(context);
    assertThat(builder.getOnBackPressListener()).isNull();
    OnBackPressListener listener = new OnBackPressListener() {

        @Override
        public void onBackPressed(DialogPlus dialogPlus) {
        }
    };
    builder.setOnBackPressListener(listener);
    assertThat(builder.getOnBackPressListener()).isNotNull();
    assertThat(builder.getOnBackPressListener()).isEqualTo(listener);
}
Also used : DialogPlus(com.orhanobut.dialogplus.DialogPlus) DialogPlusBuilder(com.orhanobut.dialogplus.DialogPlusBuilder) OnBackPressListener(com.orhanobut.dialogplus.OnBackPressListener) Test(org.junit.Test)

Example 23 with DialogPlusBuilder

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

the class DialogPlusBuilderTest method getContextShouldNotReturnNull.

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

Example 24 with DialogPlusBuilder

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

the class DialogPlusBuilderTest method getHolder_shouldBeListHolderAsDefault.

@Test
public void getHolder_shouldBeListHolderAsDefault() {
    DialogPlusBuilder builder = DialogPlus.newDialog(context);
    assertThat(builder.getHolder()).isNotNull();
    assertThat(builder.getHolder()).isInstanceOf(ListHolder.class);
}
Also used : DialogPlusBuilder(com.orhanobut.dialogplus.DialogPlusBuilder) Test(org.junit.Test)

Example 25 with DialogPlusBuilder

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

the class DialogPlusBuilderTest method testDefaultContentMarginWhenGravityCenter.

@Test
public void testDefaultContentMarginWhenGravityCenter() {
    DialogPlusBuilder builder = DialogPlus.newDialog(context);
    builder.setGravity(Gravity.CENTER);
    int minimumMargin = context.getResources().getDimensionPixelSize(R.dimen.dialogplus_default_center_margin);
    int[] margin = builder.getContentMargin();
    assertThat(margin[0]).isEqualTo(minimumMargin);
    assertThat(margin[1]).isEqualTo(minimumMargin);
    assertThat(margin[2]).isEqualTo(minimumMargin);
    assertThat(margin[3]).isEqualTo(minimumMargin);
}
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