Skip to content

Instantly share code, notes, and snippets.

@mzgreen
Created February 15, 2015 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mzgreen/40201cd9aa1054aebfb4 to your computer and use it in GitHub Desktop.
Save mzgreen/40201cd9aa1054aebfb4 to your computer and use it in GitHub Desktop.
HideOnScrollExample - MainActivity class
public class MainActivity extends ActionBarActivity {
private Toolbar mToolbar;
private ImageButton mFabButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initToolbar();
mFabButton = (ImageButton) findViewById(R.id.fabButton);
initRecyclerView();
}
private void initToolbar() {
mToolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(mToolbar);
setTitle(getString(R.string.app_name));
mToolbar.setTitleTextColor(getResources().getColor(android.R.color.white));
}
private void initRecyclerView() {
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
RecyclerAdapter recyclerAdapter = new RecyclerAdapter(createItemList());
recyclerView.setAdapter(recyclerAdapter);
}
}
@stharlin
Copy link

stharlin commented Dec 1, 2016

where is creatItemList() method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment