use of com.materiallib.devpaul.materiallibrary.list.ListItem in project MaterialLibrary by DeveloperPaul123.
the class CollapsingToolbarRecycler method init.
@Override
public void init() {
List<ListItem> items = new ArrayList<>();
for (int i = 0; i < 45; i++) {
items.add(new ListItem("Item " + i));
}
getRecyclerView().setItemAnimator(new DefaultItemAnimator());
getRecyclerView().setLayoutManager(new LinearLayoutManager(this));
SimpleRecyclerViewAdapter adapter = new SimpleRecyclerViewAdapter(this, items);
getRecyclerView().setAdapter(adapter);
getCollapsingToolbarLayout().setTitle(getToolbar().getTitle());
getCollapsingToolbarLayout().setExpandedTitleColor(getResources().getColor(android.R.color.white));
}
use of com.materiallib.devpaul.materiallibrary.list.ListItem in project MaterialLibrary by DeveloperPaul123.
the class BaseListActivity method init.
@Override
public void init() {
List<ListItem> items = new ArrayList<>();
for (int i = 0; i < 50; i++) {
items.add(new ListItem("Item " + i));
}
MyAdapter adapter = new MyAdapter(BaseListActivity.this, items);
getListView().setAdapter(adapter);
}
use of com.materiallib.devpaul.materiallibrary.list.ListItem in project MaterialLibrary by DeveloperPaul123.
the class CollapsingToolbarFab method init.
@Override
public void init() {
// uncomment to make the fab appear on the left.
// setFloatingActionButtonAlignLeft(true);
List<ListItem> items = new ArrayList<>();
for (int i = 0; i < 45; i++) {
items.add(new ListItem("Item " + i));
}
getRecyclerView().setItemAnimator(new DefaultItemAnimator());
getRecyclerView().setLayoutManager(new LinearLayoutManager(this));
SimpleRecyclerViewAdapter adapter = new SimpleRecyclerViewAdapter(this, items);
getRecyclerView().setAdapter(adapter);
getCollapsingToolbarLayout().setTitle(getToolbar().getTitle());
getCollapsingToolbarLayout().setExpandedTitleColor(getResources().getColor(android.R.color.white));
}
use of com.materiallib.devpaul.materiallibrary.list.ListItem in project MaterialLibrary by DeveloperPaul123.
the class FabListActivity method init.
@Override
public void init() {
List<ListItem> items = new ArrayList<>();
for (int i = 0; i < 50; i++) {
items.add(new ListItem("Item " + i));
}
MyAdapter adapter = new MyAdapter(this, items);
getListView().setAdapter(adapter);
getListView().setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Toast.makeText(FabListActivity.this, "Item " + position + " clicked", Toast.LENGTH_SHORT).show();
}
});
}
use of com.materiallib.devpaul.materiallibrary.list.ListItem in project MaterialLibrary by DeveloperPaul123.
the class QuickReturnActivity method init.
@Override
public void init() {
List<ListItem> items = new ArrayList<>();
for (int i = 0; i < 45; i++) {
items.add(new ListItem("Item " + i));
}
getRecyclerView().setHasFixedSize(true);
getRecyclerView().setItemAnimator(new DefaultItemAnimator());
getRecyclerView().setLayoutManager(new LinearLayoutManager(this));
SimpleRecyclerViewAdapter adapter = new SimpleRecyclerViewAdapter(this, items);
getRecyclerView().setAdapter(adapter);
}
Aggregations