package com.satsumasoftware.timetable.ui;

import android.os.Bundle;
import android.support.design.widget.NavigationView;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;

import com.satsumasoftware.timetable.R;

public class AssignmentsActivity extends BaseActivity {

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

        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
    }

    @Override
    protected Toolbar getSelfToolbar() {
        return (Toolbar) findViewById(R.id.toolbar);
    }

    @Override
    protected DrawerLayout getSelfDrawerLayout() {
        return (DrawerLayout) findViewById(R.id.drawerLayout);
    }

    @Override
    protected int getSelfNavDrawerItem() {
        return NAVDRAWER_ITEM_ASSIGNMENTS;
    }

    @Override
    protected NavigationView getSelfNavigationView() {
        return (NavigationView) findViewById(R.id.navigationView);
    }

}

@@ -55,17 +55,136 @@
 oid.
-os.Bundle
+app.Activity;%0Aimport android.content.Intent;%0Aimport android.os.Bundle;%0Aimport android.support.design.widget.FloatingActionButton
 ;%0Aim
@@ -281,16 +281,70 @@
 Layout;%0A
+import android.support.v7.widget.LinearLayoutManager;%0A
 import a
@@ -423,16 +423,42 @@
 Toolbar;
+%0Aimport android.view.View;
 %0A%0Aimport
@@ -495,424 +495,2501 @@
 .R;%0A
-%0Apublic class AssignmentsActivity extends BaseActivity %7B%0A%0A    @Override%0A    protected void onCreate(Bundle savedInstanceState) %7B%0A        super.onCreate(savedInstanceState);%0A        setContentView(R.layout.activity_content_list);%0A%0A        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);%0A        setSupportActionBar(toolbar);%0A%0A        RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
+import com.satsumasoftware.timetable.db.util.AssignmentsUtils;%0Aimport com.satsumasoftware.timetable.framework.Assignment;%0Aimport com.satsumasoftware.timetable.ui.adapter.AssignmentsAdapter;%0A%0Aimport java.util.ArrayList;%0A%0Apublic class AssignmentsActivity extends BaseActivity %7B%0A%0A    protected static final int REQUEST_CODE_ASSIGNMENT_DETAIL = 1;%0A%0A    private ArrayList%3CAssignment%3E mAssignments;%0A    private AssignmentsAdapter mAdapter;%0A%0A    @Override%0A    protected void onCreate(Bundle savedInstanceState) %7B%0A        super.onCreate(savedInstanceState);%0A        setContentView(R.layout.activity_content_list);%0A%0A        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);%0A        setSupportActionBar(toolbar);%0A%0A        mAssignments = AssignmentsUtils.getAssignments(this);%0A%0A        mAdapter = new AssignmentsAdapter(mAssignments);%0A        mAdapter.setOnEntryClickListener(new AssignmentsAdapter.OnEntryClickListener() %7B%0A            @Override%0A            public void onEntryClick(View view, int position) %7B%0A                Intent intent = new Intent(AssignmentsActivity.this, AssignmentDetailActivity.class);%0A                intent.putExtra(AssignmentDetailActivity.EXTRA_ASSIGNMENT, mAssignments.get(position));%0A                startActivityForResult(intent, REQUEST_CODE_ASSIGNMENT_DETAIL);%0A            %7D%0A        %7D);%0A%0A        RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);%0A        recyclerView.setLayoutManager(new LinearLayoutManager(this));%0A        recyclerView.setHasFixedSize(true);%0A        recyclerView.setAdapter(mAdapter);%0A%0A        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);%0A        fab.setOnClickListener(new View.OnClickListener() %7B%0A            @Override%0A            public void onClick(View view) %7B%0A                Intent intent = new Intent(AssignmentsActivity.this, AssignmentDetailActivity.class);%0A                startActivityForResult(intent, REQUEST_CODE_ASSIGNMENT_DETAIL);%0A            %7D%0A        %7D);%0A%0A    %7D%0A%0A    private void refreshList() %7B%0A        mAssignments.clear();%0A        mAssignments.addAll(AssignmentsUtils.getAssignments(this));%0A        mAdapter.notifyDataSetChanged();%0A    %7D%0A%0A    @Override%0A    protected void onActivityResult(int requestCode, int resultCode, Intent data) %7B%0A        super.onActivityResult(requestCode, resultCode, data);%0A%0A        if (requestCode == REQUEST_CODE_ASSIGNMENT_DETAIL) %7B%0A            if (resultCode == Activity.RESULT_OK) %7B%0A                refreshList();%0A            %7D%0A        %7D
 %0A   

Add Intents to AssignmentDetailActivity from AssignmentsActivity