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();
}
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();
}
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();
}
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
}
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();
}
Aggregations