use of android.support.v7.widget.LinearLayoutManager in project cw-omnibus by commonsguy.
the class MainActivity method onCreate.
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
getLoaderManager().initLoader(0, null, this);
setLayoutManager(new LinearLayoutManager(this));
setAdapter(new VideoAdapter());
}
use of android.support.v7.widget.LinearLayoutManager in project UltimateAndroid by cymcsg.
the class SnackbarRecyclerViewSampleActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.snack_bar_activity_recyclerview_sample);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mRecyclerView = (RecyclerView) findViewById(android.R.id.list);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
List<String> data = new ArrayList<String>();
for (int i = 0; i < 25; i++) {
data.add(String.format("Item %d", (i + 1)));
}
SimpleDataAdapter adapter = new SimpleDataAdapter(android.R.layout.simple_list_item_1, data, this);
mRecyclerView.setAdapter(adapter);
}
use of android.support.v7.widget.LinearLayoutManager in project kickmaterial by byoutline.
the class SearchListFragment method setUpAdapters.
private void setUpAdapters() {
projectListRv.setEndlessScrollListener(this);
layoutManager = new LinearLayoutManager(getActivity());
projectListRv.setLayoutManager(layoutManager);
projectListRv.addItemDecoration(new SearchListSeparator(getActivity().getApplicationContext()));
adapter = new SearchAdapter(getActivity(), this);
projectListRv.setAdapter(adapter);
}
use of android.support.v7.widget.LinearLayoutManager in project snackbar by nispok.
the class SnackbarRecyclerViewSampleActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_recyclerview_sample);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mRecyclerView = (RecyclerView) findViewById(android.R.id.list);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
List<String> data = new ArrayList<String>();
for (int i = 0; i < 25; i++) {
data.add(String.format("Item %d", (i + 1)));
}
SimpleDataAdapter adapter = new SimpleDataAdapter(android.R.layout.simple_list_item_1, data, this);
mRecyclerView.setAdapter(adapter);
}
use of android.support.v7.widget.LinearLayoutManager in project AdMoney by ErnestoGonAr.
the class Gastos method setRecyclerViewLayoutManager.
public void setRecyclerViewLayoutManager(LayoutManagerType layoutManagerType) {
int scrollPosition = 0;
// If a layout manager has already been set, get current scroll position.
if (mRecyclerView.getLayoutManager() != null) {
scrollPosition = ((LinearLayoutManager) mRecyclerView.getLayoutManager()).findFirstCompletelyVisibleItemPosition();
}
switch(layoutManagerType) {
case GRID_LAYOUT_MANAGER:
mLayoutManager = new GridLayoutManager(getActivity(), SPAN_COUNT);
mCurrentLayoutManagerType = LayoutManagerType.GRID_LAYOUT_MANAGER;
break;
case LINEAR_LAYOUT_MANAGER:
mLayoutManager = new LinearLayoutManager(getActivity());
mCurrentLayoutManagerType = LayoutManagerType.LINEAR_LAYOUT_MANAGER;
break;
default:
mLayoutManager = new LinearLayoutManager(getActivity());
mCurrentLayoutManagerType = LayoutManagerType.LINEAR_LAYOUT_MANAGER;
}
mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.scrollToPosition(scrollPosition);
}
Aggregations