Search in sources :

Example 1 with DialogPlus

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

the class MainActivity method showOnlyContentDialog.

private void showOnlyContentDialog(Holder holder, int gravity, BaseAdapter adapter, OnItemClickListener itemClickListener, OnDismissListener dismissListener, OnCancelListener cancelListener, boolean expanded) {
    final DialogPlus dialog = DialogPlus.newDialog(this).setContentHolder(holder).setGravity(gravity).setAdapter(adapter).setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(DialogPlus dialog, Object item, View view, int position) {
            Log.d("DialogPlus", "onItemClick() called with: " + "item = [" + item + "], position = [" + position + "]");
        }
    }).setOnDismissListener(dismissListener).setOnCancelListener(cancelListener).setExpanded(expanded).setCancelable(true).create();
    dialog.show();
}
Also used : DialogPlus(com.orhanobut.dialogplus.DialogPlus) OnItemClickListener(com.orhanobut.dialogplus.OnItemClickListener) TextView(android.widget.TextView) View(android.view.View)

Example 2 with DialogPlus

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

the class MainActivity method showCompleteDialog.

private void showCompleteDialog(Holder holder, int gravity, BaseAdapter adapter, OnClickListener clickListener, OnItemClickListener itemClickListener, OnDismissListener dismissListener, OnCancelListener cancelListener, boolean expanded) {
    final DialogPlus dialog = DialogPlus.newDialog(this).setContentHolder(holder).setHeader(R.layout.header).setFooter(R.layout.footer).setCancelable(true).setGravity(gravity).setAdapter(adapter).setOnClickListener(clickListener).setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(DialogPlus dialog, Object item, View view, int position) {
            Log.d("DialogPlus", "onItemClick() called with: " + "item = [" + item + "], position = [" + position + "]");
        }
    }).setOnDismissListener(dismissListener).setExpanded(expanded).setContentHeight(ViewGroup.LayoutParams.WRAP_CONTENT).setOnCancelListener(cancelListener).setOverlayBackgroundResource(android.R.color.transparent).create();
    dialog.show();
}
Also used : DialogPlus(com.orhanobut.dialogplus.DialogPlus) OnItemClickListener(com.orhanobut.dialogplus.OnItemClickListener) TextView(android.widget.TextView) View(android.view.View)

Example 3 with DialogPlus

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

the class DialogPlusTest method testDialogCreate.

@Test
public void testDialogCreate() {
    DialogPlus dialog = DialogPlus.newDialog(context).create();
    dialog.show();
}
Also used : DialogPlus(com.orhanobut.dialogplus.DialogPlus) Test(org.junit.Test)

Example 4 with DialogPlus

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

the class DialogPlusTest method testDismiss.

@Test
public void testDismiss() {
    DialogPlus dialog = DialogPlus.newDialog(context).create();
    dialog.dismiss();
    assertThat(dialog.isShowing()).isFalse();
    dialog.show();
    assertThat(dialog.isShowing()).isTrue();
    dialog.dismiss();
//TODO wait for dismiss
}
Also used : DialogPlus(com.orhanobut.dialogplus.DialogPlus) Test(org.junit.Test)

Example 5 with DialogPlus

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

the class DialogPlusTest method testIsShowing.

@Test
public void testIsShowing() {
    DialogPlus dialog = DialogPlus.newDialog(context).create();
    assertThat(dialog.isShowing()).isFalse();
    dialog.show();
    assertThat(dialog.isShowing()).isTrue();
    dialog.dismiss();
    assertThat(dialog.isShowing()).isFalse();
}
Also used : DialogPlus(com.orhanobut.dialogplus.DialogPlus) Test(org.junit.Test)

Aggregations

DialogPlus (com.orhanobut.dialogplus.DialogPlus)18 Test (org.junit.Test)12 View (android.view.View)8 TextView (android.widget.TextView)7 OnItemClickListener (com.orhanobut.dialogplus.OnItemClickListener)6 DialogPlusBuilder (com.orhanobut.dialogplus.DialogPlusBuilder)5 ViewHolder (com.orhanobut.dialogplus.ViewHolder)5 LinearLayout (android.widget.LinearLayout)4 OnCancelListener (com.orhanobut.dialogplus.OnCancelListener)3 OnDismissListener (com.orhanobut.dialogplus.OnDismissListener)3 OnBackPressListener (com.orhanobut.dialogplus.OnBackPressListener)2 OnClickListener (com.orhanobut.dialogplus.OnClickListener)2 ActionBar (android.support.v7.app.ActionBar)1 Toolbar (android.support.v7.widget.Toolbar)1 ArrayAdapter (android.widget.ArrayAdapter)1 GridHolder (com.orhanobut.dialogplus.GridHolder)1 Holder (com.orhanobut.dialogplus.Holder)1 ListHolder (com.orhanobut.dialogplus.ListHolder)1