Search in sources :

Example 1 with MaterialSimpleListAdapter

use of com.afollestad.materialdialogs.simplelist.MaterialSimpleListAdapter in project material-dialogs by afollestad.

the class MainActivity method showSimpleList.

@OnClick(R.id.simpleList)
public void showSimpleList() {
    final MaterialSimpleListAdapter adapter = new MaterialSimpleListAdapter((dialog, index1, item) -> showToast(item.getContent().toString()));
    adapter.add(new MaterialSimpleListItem.Builder(this).content("username@gmail.com").icon(R.drawable.ic_account_circle).backgroundColor(Color.WHITE).build());
    adapter.add(new MaterialSimpleListItem.Builder(this).content("user02@gmail.com").icon(R.drawable.ic_account_circle).backgroundColor(Color.WHITE).build());
    adapter.add(new MaterialSimpleListItem.Builder(this).content(R.string.add_account).icon(R.drawable.ic_content_add).iconPaddingDp(8).build());
    new MaterialDialog.Builder(this).title(R.string.set_backup).adapter(adapter, null).show();
}
Also used : MaterialSimpleListAdapter(com.afollestad.materialdialogs.simplelist.MaterialSimpleListAdapter) MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) MaterialSimpleListItem(com.afollestad.materialdialogs.simplelist.MaterialSimpleListItem) OnClick(butterknife.OnClick)

Aggregations

OnClick (butterknife.OnClick)1 MaterialDialog (com.afollestad.materialdialogs.MaterialDialog)1 MaterialSimpleListAdapter (com.afollestad.materialdialogs.simplelist.MaterialSimpleListAdapter)1 MaterialSimpleListItem (com.afollestad.materialdialogs.simplelist.MaterialSimpleListItem)1