package com.blstream.studybox;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.View;

import butterknife.Bind;
import butterknife.BindInt;
import butterknife.ButterKnife;

public class DecksActivity extends AppCompatActivity implements DecksAdapter.ClickListener {

    private RecyclerView recyclerView;
    private RecyclerView.Adapter adapter;
    private RecyclerView.LayoutManager layoutManager;

    @BindInt(R.integer.column_quantity)
    int columnQuantity;

    @Bind(R.id.toolbar)
    Toolbar toolbar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_decks);

        ButterKnife.bind(this);
        setSupportActionBar(toolbar);

        setUpRecyclerView();
    }

    private void setUpRecyclerView() {
        recyclerView = (RecyclerView) findViewById(R.id.decks_recycler_view);
        layoutManager = new GridLayoutManager(this, columnQuantity);
        recyclerView.setLayoutManager(layoutManager);
        recyclerView.setHasFixedSize(true);

        adapter = new DecksAdapter();
        ((DecksAdapter) adapter).setOnItemClickListener(this);
        recyclerView.setAdapter(adapter);
    }

    @Override
    public void onItemClick(int position, View v) {
        // Start test
    }
}

@@ -266,16 +266,45 @@
 ew.View;
+%0Aimport android.widget.Toast;
 %0A%0Aimport
@@ -485,37 +485,33 @@
     
-private RecyclerView 
+@Bind(R.id.decks_
 recycler
 View
@@ -510,26 +510,19 @@
 cler
-View;
+_view)
 %0A    
-private 
 Recy
@@ -533,76 +533,45 @@
 View
-.Adapter adapter;%0A    private RecyclerView.LayoutManager layoutManag
+ recyclerView;%0A    DecksAdapter adapt
 er;%0A
@@ -1017,75 +1017,13 @@
 View
- = (RecyclerView) findViewById(R.id.decks_recycler_view);%0A        l
+.setL
 ayou
@@ -1030,19 +1030,17 @@
 tManager
- = 
+(
 new Grid
@@ -1078,61 +1078,8 @@
 ity)
-;%0A        recyclerView.setLayoutManager(layoutManager
 );%0A 
@@ -1171,32 +1171,16 @@
     
- ((DecksAdapter)
  adapter
 ).se
@@ -1175,17 +1175,16 @@
  adapter
-)
 .setOnIt
@@ -1198,32 +1198,33 @@
 Listener(this);%0A
+%0A
         recycler
@@ -1333,17 +1333,17 @@
      // 
-S
+s
 tart tes
@@ -1344,16 +1344,92 @@
 rt test%0A
+        Toast.makeText(this,%22You clicked a card%22,Toast.LENGTH_LONG).show();%0A
     %7D%0A%7D%0A

optimize code