Skip to content

Instantly share code, notes, and snippets.

@mzgreen
Created February 28, 2015 08:31
Show Gist options
  • Save mzgreen/d3197b0faeb0f8103b71 to your computer and use it in GitHub Desktop.
Save mzgreen/d3197b0faeb0f8103b71 to your computer and use it in GitHub Desktop.
PartTwoActivity setting padding on RecyclerView
private void initRecyclerView() {
final RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
int paddingTop = Utils.getToolbarHeight(PartTwoActivity.this) + Utils.getTabsHeight(PartTwoActivity.this);
recyclerView.setPadding(recyclerView.getPaddingLeft(), paddingTop, recyclerView.getPaddingRight(), recyclerView.getPaddingBottom());
recyclerView.setLayoutManager(new LinearLayoutManager(this));
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment