package edu.rpi.cs.yacs.core;

import android.app.Application;

import com.crashlytics.android.Crashlytics;
import com.squareup.leakcanary.LeakCanary;

import edu.rpi.cs.yacs.enums.RecyclerViewMode;
import edu.rpi.cs.yacs.models.Course;
import edu.rpi.cs.yacs.retrofit.ServiceHelper;

import io.fabric.sdk.android.Fabric;
import io.realm.Realm;
import io.realm.RealmConfiguration;

import java.util.ArrayList;

/**
 * Created by Mark Robinson on 10/4/16.
 */
public class YACSApplication extends Application {
    private static YACSApplication instance;

    private ServiceHelper serviceHelper = null;
    private Realm realm = null;
    private RecyclerViewMode recyclerViewMode = RecyclerViewMode.DEPARTMENTS;
    private ArrayList<Course> selectedCourses = new ArrayList<>();

    public static YACSApplication getInstance() {
        return instance;
    }

    @Override
    public void onCreate() {
        super.onCreate();

        if (LeakCanary.isInAnalyzerProcess(this)) {
            // This process is dedicated to LeakCanary for heap analysis.
            return;
        }

        Fabric.with(this, new Crashlytics());

        instance = this;

        LeakCanary.install(this);

        serviceHelper = new ServiceHelper(getApplicationContext());

        RealmConfiguration realmConfiguration = new RealmConfiguration.Builder(this).build();
        Realm.setDefaultConfiguration(realmConfiguration);

        realm = Realm.getDefaultInstance();
    }

    public ServiceHelper getServiceHelper() {
        return serviceHelper;
    }

    public Realm getRealm() {
        return realm;
    }

    public RecyclerViewMode getRecyclerViewMode() {
        return recyclerViewMode;
    }

    public void setRecyclerViewMode(RecyclerViewMode recyclerViewMode) {
        this.recyclerViewMode = recyclerViewMode;
    }

    public ArrayList<Course> getSelectedCourses() {
        return selectedCourses;
    }
}
@@ -230,16 +230,55 @@
 Course;%0A
+import edu.rpi.cs.yacs.models.Section;%0A
 import e
@@ -316,16 +316,16 @@
 Helper;%0A
-
 %0Aimport 
@@ -812,16 +812,85 @@
 ist%3C%3E();
+%0A    private ArrayList%3CSection%3E selectedSections = new ArrayList%3C%3E();
 %0A%0A    pu
@@ -1365,24 +1365,50 @@
 ontext());%0A%0A
+        Realm.init(this);%0A
         Real
@@ -1474,20 +1474,16 @@
 Builder(
-this
 ).build(
@@ -2008,24 +2008,24 @@
 Courses() %7B%0A
-
         retu
@@ -2049,10 +2049,104 @@
 s;%0A    %7D
+%0A%0A    public ArrayList%3CSection%3E getSelectedSections() %7B%0A        return selectedSections;%0A    %7D
 %0A%7D

Update YACSApplication.java