// Path: app/src/main/java/ca/rmen/android/scrumchatter/provider/MemberCursorWrapper.java
// public class MemberCursorWrapper extends CursorWrapper {
//     private final HashMap<String, Integer> mColumnIndexes = new HashMap<>();
// 
//     public MemberCursorWrapper(Cursor cursor) {
//         super(cursor);
//     }
// 
//     public Long getId() {
//         Integer index = getColumnIndex(MemberColumns._ID);
//         if (isNull(index)) return null;
//         return getLong(index);
//     }
// 
//     public String getName() {
//         Integer index = getIndex(MemberColumns.NAME);
//         return getString(index);
//     }
// 
//     public Integer getAverageDuration() {
//         Integer index = getIndex(MemberStatsColumns.AVG_DURATION);
//         return getInt(index);
//     }
// 
//     public Integer getSumDuration() {
//         Integer index = getIndex(MemberStatsColumns.SUM_DURATION);
//         return getInt(index);
//     }
// 
//     private Integer getIndex(String columnName) {
//         Integer index = mColumnIndexes.get(columnName);
//         if (index == null) {
//             index = getColumnIndexOrThrow(columnName);
//             mColumnIndexes.put(columnName, index);
//         }
//         return index;
//     }
// }
// 
// Path: app/src/main/java/ca/rmen/android/scrumchatter/util/TextUtils.java
// public class TextUtils {
//     public static String formatDateTime(Context context, long dateMillis) {
//         return DateUtils.formatDateTime(context, dateMillis, DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_TIME);
//     }
// 
//     public static String formatDate(Context context, long dateMillis) {
//         return DateUtils.formatDateTime(context, dateMillis, DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_ABBREV_ALL |DateUtils.FORMAT_NUMERIC_DATE);
//     }
// 
// }


import ca.rmen.android.scrumchatter.provider.MemberCursorWrapper;
import ca.rmen.android.scrumchatter.util.TextUtils;
import lecho.lib.hellocharts.gesture.ZoomType;
import lecho.lib.hellocharts.model.PieChartData;
import lecho.lib.hellocharts.model.SliceValue;
import lecho.lib.hellocharts.view.PieChartView;
import android.content.Context;
import android.database.Cursor;
import android.support.annotation.NonNull;
import android.text.format.DateUtils;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import ca.rmen.android.scrumchatter.databinding.PieChartContentBinding;
/*
 * Copyright 2016-2017 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;




/**
 */
final class MemberSpeakingTimePieChart {
    private static final int MAX_VALUES = 10;

    private MemberSpeakingTimePieChart() {
        // prevent instantiation
    }

    /**
     * The library's SliceValue doesn't have a field for what to display in the legend for a slice.
     * So, we create our own class containing both the SliceValue and the legend label for a given slice.
     */
    private static class PieChartSlice {
        final SliceValue sliceValue;
        final String legendLabel;

        public PieChartSlice(SliceValue sliceValue, String legendLabel) {
            this.sliceValue = sliceValue;
            this.legendLabel = legendLabel;
        }
    }

    public static void populateMemberSpeakingTimeChart(Context context, PieChartContentBinding pieChartAvgBinding, PieChartContentBinding pieChartTotalBinding, @NonNull Cursor cursor) {
        List<PieChartSlice> sliceValuesAvgSpeakingTime = new ArrayList<>();
        List<PieChartSlice> sliceValuesTotalSpeakingTime = new ArrayList<>();
// Path: app/src/main/java/ca/rmen/android/scrumchatter/provider/MemberCursorWrapper.java
// public class MemberCursorWrapper extends CursorWrapper {
//     private final HashMap<String, Integer> mColumnIndexes = new HashMap<>();
// 
//     public MemberCursorWrapper(Cursor cursor) {
//         super(cursor);
//     }
// 
//     public Long getId() {
//         Integer index = getColumnIndex(MemberColumns._ID);
//         if (isNull(index)) return null;
//         return getLong(index);
//     }
// 
//     public String getName() {
//         Integer index = getIndex(MemberColumns.NAME);
//         return getString(index);
//     }
// 
//     public Integer getAverageDuration() {
//         Integer index = getIndex(MemberStatsColumns.AVG_DURATION);
//         return getInt(index);
//     }
// 
//     public Integer getSumDuration() {
//         Integer index = getIndex(MemberStatsColumns.SUM_DURATION);
//         return getInt(index);
//     }
// 
//     private Integer getIndex(String columnName) {
//         Integer index = mColumnIndexes.get(columnName);
//         if (index == null) {
//             index = getColumnIndexOrThrow(columnName);
//             mColumnIndexes.put(columnName, index);
//         }
//         return index;
//     }
// }
// 
// Path: app/src/main/java/ca/rmen/android/scrumchatter/util/TextUtils.java
// public class TextUtils {
//     public static String formatDateTime(Context context, long dateMillis) {
//         return DateUtils.formatDateTime(context, dateMillis, DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_TIME);
//     }
// 
//     public static String formatDate(Context context, long dateMillis) {
//         return DateUtils.formatDateTime(context, dateMillis, DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_ABBREV_ALL |DateUtils.FORMAT_NUMERIC_DATE);
//     }
// 
// }


// Path: app/src/main/java/ca/rmen/android/scrumchatter/chart/MemberSpeakingTimePieChart.java
import ca.rmen.android.scrumchatter.provider.MemberCursorWrapper;
import ca.rmen.android.scrumchatter.util.TextUtils;
import lecho.lib.hellocharts.gesture.ZoomType;
import lecho.lib.hellocharts.model.PieChartData;
import lecho.lib.hellocharts.model.SliceValue;
import lecho.lib.hellocharts.view.PieChartView;
import android.content.Context;
import android.database.Cursor;
import android.support.annotation.NonNull;
import android.text.format.DateUtils;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import ca.rmen.android.scrumchatter.databinding.PieChartContentBinding;

/*
 * Copyright 2016-2017 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;




/**
 */
final class MemberSpeakingTimePieChart {
    private static final int MAX_VALUES = 10;

    private MemberSpeakingTimePieChart() {
        // prevent instantiation
    }

    /**
     * The library's SliceValue doesn't have a field for what to display in the legend for a slice.
     * So, we create our own class containing both the SliceValue and the legend label for a given slice.
     */
    private static class PieChartSlice {
        final SliceValue sliceValue;
        final String legendLabel;

        public PieChartSlice(SliceValue sliceValue, String legendLabel) {
            this.sliceValue = sliceValue;
            this.legendLabel = legendLabel;
        }
    }

    public static void populateMemberSpeakingTimeChart(Context context, PieChartContentBinding pieChartAvgBinding, PieChartContentBinding pieChartTotalBinding, @NonNull Cursor cursor) {
        List<PieChartSlice> sliceValuesAvgSpeakingTime = new ArrayList<>();
        List<PieChartSlice> sliceValuesTotalSpeakingTime = new ArrayList<>();
        MemberCursorWrapper cursorWrapper = new MemberCursorWrapper(cursor);