package net.squanchy.about.licenses;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;

import net.squanchy.R;
import net.squanchy.fonts.TypefaceStyleableActivity;
import net.squanchy.support.view.CardSpacingItemDecorator;

public class LicensesActivity extends TypefaceStyleableActivity {

    private RecyclerView licensesList;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_licenses);
        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));

        int horizontalSpacing = getResources().getDimensionPixelSize(R.dimen.card_horizontal_margin);
        int verticalSpacing = getResources().getDimensionPixelSize(R.dimen.card_vertical_margin);
        licensesList.addItemDecoration(new CardSpacingItemDecorator(horizontalSpacing, verticalSpacing));
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (item.getItemId() == android.R.id.home) {
            finish();
            return true;
        }
        return super.onOptionsItemSelected(item);
    }
}

@@ -797,355 +797,8 @@
 st);
-%0A    %7D%0A%0A    private void setupToolbar() %7B%0A        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);%0A        setSupportActionBar(toolbar);%0A        getSupportActionBar().setDisplayHomeAsUpEnabled(true);%0A        getSupportActionBar().setDisplayShowTitleEnabled(true);%0A    %7D%0A%0A    @Override%0A    protected void onStart() %7B%0A        super.onStart();
 %0A%0A  
@@ -1240,16 +1240,286 @@
 %0A    %7D%0A%0A
+    private void setupToolbar() %7B%0A        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);%0A        setSupportActionBar(toolbar);%0A        getSupportActionBar().setDisplayHomeAsUpEnabled(true);%0A        getSupportActionBar().setDisplayShowTitleEnabled(true);%0A    %7D%0A%0A
     @Ove

Move list initialisation to onCreate 🐛