Search in sources :

Example 1 with OnItemClickListener

use of com.orhanobut.dialogplus.OnItemClickListener 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 OnItemClickListener

use of com.orhanobut.dialogplus.OnItemClickListener 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 OnItemClickListener

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

the class MainActivity method showNoHeaderDialog.

private void showNoHeaderDialog(Holder holder, int gravity, BaseAdapter adapter, OnClickListener clickListener, OnItemClickListener itemClickListener, OnDismissListener dismissListener, OnCancelListener cancelListener, boolean expanded) {
    final DialogPlus dialog = DialogPlus.newDialog(this).setContentHolder(holder).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).setOnCancelListener(cancelListener).setExpanded(expanded).create();
    dialog.show();
}
Also used : DialogPlus(com.orhanobut.dialogplus.DialogPlus) OnItemClickListener(com.orhanobut.dialogplus.OnItemClickListener) TextView(android.widget.TextView) View(android.view.View)

Example 4 with OnItemClickListener

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

the class DialogPlusBuilderTest method testSetOnItemClickListener.

@Test
public void testSetOnItemClickListener() {
    DialogPlusBuilder builder = DialogPlus.newDialog(context);
    assertThat(builder.getOnItemClickListener()).isNull();
    OnItemClickListener listener = new OnItemClickListener() {

        @Override
        public void onItemClick(DialogPlus dialog, Object item, View view, int position) {
        }
    };
    builder.setOnItemClickListener(listener);
    assertThat(builder.getOnItemClickListener()).isNotNull();
    assertThat(builder.getOnItemClickListener()).isEqualTo(listener);
}
Also used : DialogPlus(com.orhanobut.dialogplus.DialogPlus) OnItemClickListener(com.orhanobut.dialogplus.OnItemClickListener) DialogPlusBuilder(com.orhanobut.dialogplus.DialogPlusBuilder) View(android.view.View) Test(org.junit.Test)

Example 5 with OnItemClickListener

use of com.orhanobut.dialogplus.OnItemClickListener 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();
}
Also used : DialogPlus(com.orhanobut.dialogplus.DialogPlus) OnItemClickListener(com.orhanobut.dialogplus.OnItemClickListener) TextView(android.widget.TextView) View(android.view.View)

Aggregations

View (android.view.View)6 DialogPlus (com.orhanobut.dialogplus.DialogPlus)6 OnItemClickListener (com.orhanobut.dialogplus.OnItemClickListener)6 TextView (android.widget.TextView)5 DialogPlusBuilder (com.orhanobut.dialogplus.DialogPlusBuilder)1 GridHolder (com.orhanobut.dialogplus.GridHolder)1 Holder (com.orhanobut.dialogplus.Holder)1 ListHolder (com.orhanobut.dialogplus.ListHolder)1 OnCancelListener (com.orhanobut.dialogplus.OnCancelListener)1 OnClickListener (com.orhanobut.dialogplus.OnClickListener)1 OnDismissListener (com.orhanobut.dialogplus.OnDismissListener)1 ViewHolder (com.orhanobut.dialogplus.ViewHolder)1 Test (org.junit.Test)1