// Path: app/src/main/java/ca/rmen/android/scrumchatter/meeting/Meetings.java
// public class Meetings {
//     private static final String TAG = Constants.TAG + "/" + Meetings.class.getSimpleName();
//     public static final String EXTRA_MEETING_ID = "meeting_id";
//     public static final String EXTRA_MEETING_STATE = "meeting_state";
//     private final FragmentActivity mActivity;
// 
//     public Meetings(FragmentActivity activity) {
//         mActivity = activity;
//     }
// 
//     /**
//      * Checks if there are any team members in the given team id. If not, an error dialog is shown. If the team does have members, then we start
//      * the MeetingActivity class for a new meeting.
//      */
//     public Single<Meeting> createMeeting(final int teamId) {
//         Log.v(TAG, "createMeeting in team " + teamId);
//         return Single.fromCallable(() -> {
//             Cursor c = mActivity.getContentResolver().query(MemberColumns.CONTENT_URI, new String[]{"count(*)"},
//                     MemberColumns.TEAM_ID + "=? AND " + MemberColumns.DELETED + "= 0", new String[]{String.valueOf(teamId)}, null);
//             if (c != null) {
//                 try {
//                     c.moveToFirst();
//                     int memberCount = c.getInt(0);
//                     if (memberCount > 0) return Meeting.createNewMeeting(mActivity);
//                 } finally {
//                     c.close();
//                 }
//             }
//             throw new IllegalArgumentException("Can't create meeting for team " + teamId + " because it doesn't exist or has no members");
//         })
//                 .subscribeOn(Schedulers.io())
//                 .observeOn(AndroidSchedulers.mainThread());
//     }
// 
//     public Single<Meeting> readMeeting(long meetingId) {
//         return Single.fromCallable(() -> Meeting.read(mActivity, meetingId))
//                 .subscribeOn(Schedulers.io())
//                 .observeOn(AndroidSchedulers.mainThread());
//     }
// 
//     /**
//      * Shows a confirmation dialog to delete the given meeting.
//      */
//     public void confirmDelete(final Meeting meeting) {
//         Log.v(TAG, "confirm delete meeting: " + meeting);
//         // Let's ask him if he's sure first.
//         Bundle extras = new Bundle(1);
//         extras.putLong(EXTRA_MEETING_ID, meeting.getId());
//         DialogFragmentFactory.showConfirmDialog(mActivity, mActivity.getString(R.string.action_delete_meeting),
//                 mActivity.getString(R.string.dialog_message_delete_meeting_confirm, TextUtils.formatDateTime(mActivity, meeting.getStartDate())),
//                 R.id.action_delete_meeting, extras);
//     }
// 
//     /**
//      * Deletes the given meeting from the DB.
//      */
//     public void delete(final long meetingId) {
//         Log.v(TAG, "delete meeting " + meetingId);
//         // Delete the meeting in a background thread.
//         Single.fromCallable(() -> Meeting.read(mActivity, meetingId))
//                 .subscribeOn(Schedulers.io())
//                 .observeOn(Schedulers.io())
//                 .subscribe(Meeting::delete,
//                         throwable -> Log.v(TAG, "couldn't delete meeting " + meetingId, throwable));
//     }
// 
//     /**
//      * Read the data for the given meeting, then show an intent chooser to export this data as text.
//      */
//     public void export(long meetingId) {
//         Log.v(TAG, "export meeting " + meetingId);
//         // Export the meeting in a background thread.
//         Single.fromCallable(() -> new MeetingExport(mActivity).exportMeeting(meetingId))
//                 .subscribeOn(Schedulers.io())
//                 .observeOn(AndroidSchedulers.mainThread())
//                 .subscribe(success -> {
//                     if (!success) Snackbar.make(mActivity.getWindow().getDecorView().getRootView(), R.string.error_sharing_meeting, Snackbar.LENGTH_LONG).show();
//                 });
//     }
// }


import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import ca.rmen.android.scrumchatter.R;
import ca.rmen.android.scrumchatter.meeting.Meetings;
/*
 * Copyright 2016 Carmen Alvarez
 * <p/>
 * This file is part of Scrum Chatter.
 * <p/>
 * Scrum Chatter is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * <p/>
 * Scrum Chatter is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * <p/>
 * You should have received a copy of the GNU General Public License
 * along with Scrum Chatter. If not, see <http://www.gnu.org/licenses/>.
 */
package ca.rmen.android.scrumchatter.chart;




/**
 * Displays charts for all meetings.
 */
public class MeetingChartActivity extends AppCompatActivity {

    public static void start(Context context, long meetingId) {
        Intent intent = new Intent(context, MeetingChartActivity.class);
// Path: app/src/main/java/ca/rmen/android/scrumchatter/meeting/Meetings.java
// public class Meetings {
//     private static final String TAG = Constants.TAG + "/" + Meetings.class.getSimpleName();
//     public static final String EXTRA_MEETING_ID = "meeting_id";
//     public static final String EXTRA_MEETING_STATE = "meeting_state";
//     private final FragmentActivity mActivity;
// 
//     public Meetings(FragmentActivity activity) {
//         mActivity = activity;
//     }
// 
//     /**
//      * Checks if there are any team members in the given team id. If not, an error dialog is shown. If the team does have members, then we start
//      * the MeetingActivity class for a new meeting.
//      */
//     public Single<Meeting> createMeeting(final int teamId) {
//         Log.v(TAG, "createMeeting in team " + teamId);
//         return Single.fromCallable(() -> {
//             Cursor c = mActivity.getContentResolver().query(MemberColumns.CONTENT_URI, new String[]{"count(*)"},
//                     MemberColumns.TEAM_ID + "=? AND " + MemberColumns.DELETED + "= 0", new String[]{String.valueOf(teamId)}, null);
//             if (c != null) {
//                 try {
//                     c.moveToFirst();
//                     int memberCount = c.getInt(0);
//                     if (memberCount > 0) return Meeting.createNewMeeting(mActivity);
//                 } finally {
//                     c.close();
//                 }
//             }
//             throw new IllegalArgumentException("Can't create meeting for team " + teamId + " because it doesn't exist or has no members");
//         })
//                 .subscribeOn(Schedulers.io())
//                 .observeOn(AndroidSchedulers.mainThread());
//     }
// 
//     public Single<Meeting> readMeeting(long meetingId) {
//         return Single.fromCallable(() -> Meeting.read(mActivity, meetingId))
//                 .subscribeOn(Schedulers.io())
//                 .observeOn(AndroidSchedulers.mainThread());
//     }
// 
//     /**
//      * Shows a confirmation dialog to delete the given meeting.
//      */
//     public void confirmDelete(final Meeting meeting) {
//         Log.v(TAG, "confirm delete meeting: " + meeting);
//         // Let's ask him if he's sure first.
//         Bundle extras = new Bundle(1);
//         extras.putLong(EXTRA_MEETING_ID, meeting.getId());
//         DialogFragmentFactory.showConfirmDialog(mActivity, mActivity.getString(R.string.action_delete_meeting),
//                 mActivity.getString(R.string.dialog_message_delete_meeting_confirm, TextUtils.formatDateTime(mActivity, meeting.getStartDate())),
//                 R.id.action_delete_meeting, extras);
//     }
// 
//     /**
//      * Deletes the given meeting from the DB.
//      */
//     public void delete(final long meetingId) {
//         Log.v(TAG, "delete meeting " + meetingId);
//         // Delete the meeting in a background thread.
//         Single.fromCallable(() -> Meeting.read(mActivity, meetingId))
//                 .subscribeOn(Schedulers.io())
//                 .observeOn(Schedulers.io())
//                 .subscribe(Meeting::delete,
//                         throwable -> Log.v(TAG, "couldn't delete meeting " + meetingId, throwable));
//     }
// 
//     /**
//      * Read the data for the given meeting, then show an intent chooser to export this data as text.
//      */
//     public void export(long meetingId) {
//         Log.v(TAG, "export meeting " + meetingId);
//         // Export the meeting in a background thread.
//         Single.fromCallable(() -> new MeetingExport(mActivity).exportMeeting(meetingId))
//                 .subscribeOn(Schedulers.io())
//                 .observeOn(AndroidSchedulers.mainThread())
//                 .subscribe(success -> {
//                     if (!success) Snackbar.make(mActivity.getWindow().getDecorView().getRootView(), R.string.error_sharing_meeting, Snackbar.LENGTH_LONG).show();
//                 });
//     }
// }


// Path: app/src/main/java/ca/rmen/android/scrumchatter/chart/MeetingChartActivity.java
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import ca.rmen.android.scrumchatter.R;
import ca.rmen.android.scrumchatter.meeting.Meetings;

/*
 * Copyright 2016 Carmen Alvarez
 * <p/>
 * This file is part of Scrum Chatter.
 * <p/>
 * Scrum Chatter is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * <p/>
 * Scrum Chatter is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * <p/>
 * You should have received a copy of the GNU General Public License
 * along with Scrum Chatter. If not, see <http://www.gnu.org/licenses/>.
 */
package ca.rmen.android.scrumchatter.chart;




/**
 * Displays charts for all meetings.
 */
public class MeetingChartActivity extends AppCompatActivity {

    public static void start(Context context, long meetingId) {
        Intent intent = new Intent(context, MeetingChartActivity.class);
        intent.putExtra(Meetings.EXTRA_MEETING_ID, meetingId);