use of com.orhanobut.dialogplus.DialogPlus in project dialogplus by orhanobut.
the class MainActivity method showNoFooterDialog.
private void showNoFooterDialog(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).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).setOnCancelListener(cancelListener).setExpanded(expanded).create();
dialog.show();
}
use of com.orhanobut.dialogplus.DialogPlus in project dialogplus by orhanobut.
the class DialogPlusTest method testGetHolderView.
@Test
public void testGetHolderView() {
LinearLayout layout = new LinearLayout(context);
DialogPlus dialog = DialogPlus.newDialog(context).setContentHolder(new ViewHolder(layout)).create();
assertThat(dialog.getHolderView()).isEqualTo(layout);
}
use of com.orhanobut.dialogplus.DialogPlus in project dialogplus by orhanobut.
the class DialogPlusTest method testGetHeaderView.
@Test
public void testGetHeaderView() {
LinearLayout layout = new LinearLayout(context);
LinearLayout header = new LinearLayout(context);
DialogPlus dialog = DialogPlus.newDialog(context).setContentHolder(new ViewHolder(layout)).setHeader(header).create();
assertThat(dialog.getHeaderView()).isEqualTo(header);
}
use of com.orhanobut.dialogplus.DialogPlus in project dialogplus by orhanobut.
the class DialogPlusTest method testGetFooterView.
@Test
public void testGetFooterView() {
LinearLayout layout = new LinearLayout(context);
LinearLayout footer = new LinearLayout(context);
DialogPlus dialog = DialogPlus.newDialog(context).setContentHolder(new ViewHolder(layout)).setFooter(footer).create();
assertThat(dialog.getFooterView()).isEqualTo(footer);
}
use of com.orhanobut.dialogplus.DialogPlus in project dialogplus by orhanobut.
the class DialogPlusBuilderTest method testSetOnDismissListener.
@Test
public void testSetOnDismissListener() {
DialogPlusBuilder builder = DialogPlus.newDialog(context);
assertThat(builder.getOnDismissListener()).isNull();
OnDismissListener listener = new OnDismissListener() {
@Override
public void onDismiss(DialogPlus dialog) {
}
};
builder.setOnDismissListener(listener);
assertThat(builder.getOnDismissListener()).isNotNull();
assertThat(builder.getOnDismissListener()).isEqualTo(listener);
}
Aggregations