Search in sources :

Example 1 with DefaultIconDropDownItem

use of carbon.component.DefaultIconDropDownItem in project Carbon by ZieIony.

the class RegisterActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_listcomponent);
    Samples.initToolbar(this, getString(R.string.registerActivity_title));
    RecyclerView recycler = (RecyclerView) findViewById(R.id.recycler);
    RowListAdapter adapter = new RowListAdapter<>(DefaultIconEditTextItem.class, IconEditTextRow.FACTORY);
    adapter.addFactory(DividerItem.class, DividerRow.FACTORY);
    adapter.addFactory(DefaultIconPasswordItem.class, IconPasswordRow.FACTORY);
    adapter.addFactory(DefaultIconDropDownItem.class, IconDropDownRow.FACTORY);
    recycler.setAdapter(adapter);
    adapter.setItems(Arrays.asList(new DefaultIconEditTextItem(new VectorDrawable(getResources(), R.raw.profile), "login", ""), new DefaultIconEditTextItem(new VectorDrawable(getResources(), R.raw.email), "email", ""), new DefaultIconPasswordItem(new VectorDrawable(getResources(), R.raw.lock), "password", ""), new DefaultIconPasswordItem(null, "retype password", ""), new DefaultIconDropDownItem<>(new VectorDrawable(getResources(), R.raw.gender), "sex", new String[] { "Male", "Female" }, "Male")));
}
Also used : RowListAdapter(carbon.recycler.RowListAdapter) RecyclerView(carbon.widget.RecyclerView) DefaultIconPasswordItem(carbon.component.DefaultIconPasswordItem) DefaultIconDropDownItem(carbon.component.DefaultIconDropDownItem) VectorDrawable(carbon.drawable.VectorDrawable) DefaultIconEditTextItem(carbon.component.DefaultIconEditTextItem)

Aggregations

DefaultIconDropDownItem (carbon.component.DefaultIconDropDownItem)1 DefaultIconEditTextItem (carbon.component.DefaultIconEditTextItem)1 DefaultIconPasswordItem (carbon.component.DefaultIconPasswordItem)1 VectorDrawable (carbon.drawable.VectorDrawable)1 RowListAdapter (carbon.recycler.RowListAdapter)1 RecyclerView (carbon.widget.RecyclerView)1