// Path: app/src/main/java/com/nasageek/utexasutilities/AnalyticsHandler.java
// public class AnalyticsHandler {
// 
//     private static FirebaseAnalytics analyticsTracker;
// 
//     private AnalyticsHandler() {
//         // do nothing
//     }
// 
//     public static void initTrackerIfNeeded(Context con, boolean enabled) {
//         if (analyticsTracker == null) {
//             analyticsTracker = FirebaseAnalytics.getInstance(con);
//             analyticsTracker.setAnalyticsCollectionEnabled(enabled);
//         }
//     }
// 
//     public static void trackLogoutEvent() {
//         analyticsTracker.logEvent("logout", null);
//     }
// 
//     public static void trackCalendarExportEvent() {
//         analyticsTracker.logEvent("export_calendar", null);
//     }
// 
//     public static void trackMapAllClassesEvent() {
//         analyticsTracker.logEvent("map_all_classes", null);
//     }
// 
//     public static void trackGetDirectionsEvent() {
//         analyticsTracker.logEvent("get_directions", null);
//     }
// 
//     public static void trackBusRouteEvent() {
//         analyticsTracker.logEvent("view_bus_route", null);
//     }
// }


import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.AsyncQueryHandler;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.provider.CalendarContract;
import android.support.annotation.NonNull;
import android.support.v4.app.FragmentActivity;
import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import android.widget.Toast;
import com.nasageek.utexasutilities.AnalyticsHandler;
import com.nasageek.utexasutilities.R;
import java.util.ArrayList;

package com.nasageek.utexasutilities.fragments;




public class PickCalendarDialogFragment extends ExportScheduleDialogFragment {

    private FragmentActivity parentAct;

    public PickCalendarDialogFragment() {
    }

    public static PickCalendarDialogFragment newInstance(ArrayList<Integer> indices,
            ArrayList<String> calendars, ArrayList<ContentValues> valuesList) {
        PickCalendarDialogFragment pcdf = new PickCalendarDialogFragment();
        Bundle args = new Bundle();
        args.putIntegerArrayList("indices", indices);
        args.putStringArrayList("calendars", calendars);
        args.putParcelableArrayList("valuesList", valuesList);
        pcdf.setArguments(args);
        return pcdf;
    }

    @NonNull
    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        parentAct = getActivity();
        ArrayList<String> calendars = getArguments().getStringArrayList("calendars");
        return new AlertDialog.Builder(getActivity())
                .setAdapter(new CalendarAdapter(getActivity(), calendars), (dialog, which) -> {
                    CalendarInsertHandler cih = new CalendarInsertHandler(getActivity()
                            .getContentResolver());
// Path: app/src/main/java/com/nasageek/utexasutilities/AnalyticsHandler.java
// public class AnalyticsHandler {
// 
//     private static FirebaseAnalytics analyticsTracker;
// 
//     private AnalyticsHandler() {
//         // do nothing
//     }
// 
//     public static void initTrackerIfNeeded(Context con, boolean enabled) {
//         if (analyticsTracker == null) {
//             analyticsTracker = FirebaseAnalytics.getInstance(con);
//             analyticsTracker.setAnalyticsCollectionEnabled(enabled);
//         }
//     }
// 
//     public static void trackLogoutEvent() {
//         analyticsTracker.logEvent("logout", null);
//     }
// 
//     public static void trackCalendarExportEvent() {
//         analyticsTracker.logEvent("export_calendar", null);
//     }
// 
//     public static void trackMapAllClassesEvent() {
//         analyticsTracker.logEvent("map_all_classes", null);
//     }
// 
//     public static void trackGetDirectionsEvent() {
//         analyticsTracker.logEvent("get_directions", null);
//     }
// 
//     public static void trackBusRouteEvent() {
//         analyticsTracker.logEvent("view_bus_route", null);
//     }
// }


// Path: app/src/main/java/com/nasageek/utexasutilities/fragments/PickCalendarDialogFragment.java
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.AsyncQueryHandler;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.provider.CalendarContract;
import android.support.annotation.NonNull;
import android.support.v4.app.FragmentActivity;
import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import android.widget.Toast;
import com.nasageek.utexasutilities.AnalyticsHandler;
import com.nasageek.utexasutilities.R;
import java.util.ArrayList;


package com.nasageek.utexasutilities.fragments;




public class PickCalendarDialogFragment extends ExportScheduleDialogFragment {

    private FragmentActivity parentAct;

    public PickCalendarDialogFragment() {
    }

    public static PickCalendarDialogFragment newInstance(ArrayList<Integer> indices,
            ArrayList<String> calendars, ArrayList<ContentValues> valuesList) {
        PickCalendarDialogFragment pcdf = new PickCalendarDialogFragment();
        Bundle args = new Bundle();
        args.putIntegerArrayList("indices", indices);
        args.putStringArrayList("calendars", calendars);
        args.putParcelableArrayList("valuesList", valuesList);
        pcdf.setArguments(args);
        return pcdf;
    }

    @NonNull
    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        parentAct = getActivity();
        ArrayList<String> calendars = getArguments().getStringArrayList("calendars");
        return new AlertDialog.Builder(getActivity())
                .setAdapter(new CalendarAdapter(getActivity(), calendars), (dialog, which) -> {
                    CalendarInsertHandler cih = new CalendarInsertHandler(getActivity()
                            .getContentResolver());
                    ArrayList<ContentValues> cvList = getArguments().getParcelableArrayList(