use of android.support.v7.widget.DividerItemDecoration in project AdvancedMaterialDrawer by madcyph3r.
the class DrawerTypesFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.recycleview_layout, container, false);
mRecyclerView = (RecyclerView) v.findViewById(R.id.recycler);
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
mRecyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST));
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
createAdapter(mRecyclerView);
return v;
}
use of android.support.v7.widget.DividerItemDecoration in project AdvancedMaterialDrawer by madcyph3r.
the class FunctionallyFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.recycleview_layout, container, false);
mRecyclerView = (RecyclerView) v.findViewById(R.id.recycler);
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
mRecyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST));
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
createAdapter(mRecyclerView);
return v;
}
use of android.support.v7.widget.DividerItemDecoration in project TinyDancer by friendlyrobotnyc.
the class FPSRecyclerView method onFinishInflate.
@Override
protected void onFinishInflate() {
super.onFinishInflate();
ButterKnife.bind(this);
LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
setLayoutManager(layoutManager);
addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL_LIST));
setAdapter(adapter);
}
use of android.support.v7.widget.DividerItemDecoration in project RecyclerViewItemAnimators by gabrielemariotti.
the class ListActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_recycler);
//Setup Spinner
setupSpinner();
//Setup RecyclerView
mRecyclerView = (RecyclerView) findViewById(R.id.list);
//mRecyclerView.setHasFixedSize(true);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
mRecyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
mAdapter = new SimpleAdapter(this, sCheeseStrings);
mRecyclerView.setAdapter(mAdapter);
}
use of android.support.v7.widget.DividerItemDecoration in project MultiType by drakeet.
the class TestPayloadActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.list);
recyclerView.addItemDecoration(new DividerItemDecoration(this, VERTICAL));
MultiTypeAdapter adapter = new MultiTypeAdapter();
recyclerView.setAdapter(adapter);
adapter.register(HeavyItem.class, new HeavyItemViewBinder());
Items items = new Items();
for (int i = 0; i < 30; i++) {
items.add(new HeavyItem("1000" + i));
}
adapter.setItems(items);
adapter.notifyDataSetChanged();
Toast.makeText(this, "Try to click or long click items", Toast.LENGTH_SHORT).show();
}
Aggregations