Skip to content
This repository has been archived by the owner on Feb 17, 2020. It is now read-only.

Commit

Permalink
Move list initialisation to onCreate πŸ›
Browse files Browse the repository at this point in the history
  • Loading branch information
rock3r committed Mar 29, 2017
1 parent 8f43b96 commit 4a98595
Showing 1 changed file with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
setupToolbar();

licensesList = (RecyclerView) findViewById(R.id.libraries_list);
}

private void setupToolbar() {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(true);
}

@Override
protected void onStart() {
super.onStart();

licensesList.setAdapter(new LibrariesAdapter(this));
licensesList.setLayoutManager(new LinearLayoutManager(this));
Expand All @@ -44,6 +32,13 @@ protected void onStart() {
licensesList.addItemDecoration(new CardSpacingItemDecorator(horizontalSpacing, verticalSpacing));
}

private void setupToolbar() {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(true);
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
Expand Down

0 comments on commit 4a98595

Please sign in to comment.