// Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// public static class DayEntry {
//     final static int EMPTY = 0;
//     final static int PERIOD_START = 1;
//     final static int PERIOD_CONFIRMED = 2;
//     final static int PERIOD_PREDICTED = 3;
//     final static int FERTILITY_PREDICTED = 4;
//     final static int OVULATION_PREDICTED = 5;
//     final static int FERTILITY_FUTURE = 6;
//     final static int OVULATION_FUTURE = 7;
//     final static int INFERTILE_PREDICTED = 8;
//     final static int INFERTILE_FUTURE = 9;
//     int type;
//     final GregorianCalendarExt date;
//     int dayofcycle;
//     int intensity;
//     String notes;
//     List<Integer> symptoms;
// 
//     /**
//      * Construct a new day entry with parameters
//      *
//      * @param type       Entry type (DayEntry.EMPTY, DayEntry.PERIOD_START, DayEntry.PERIOD_CONFIRMED, ...)
//      * @param date       Entry date
//      * @param dayofcycle Day within current cycle (beginning with 1)
//      * @param intensity  Intensity of the period (1-4)
//      */
//     DayEntry(int type, GregorianCalendar date, int dayofcycle, int intensity) {
//         this.type = type;
//         this.date = new GregorianCalendarExt();
//         this.date.setTime(date.getTime());
//         this.dayofcycle = dayofcycle;
//         this.intensity = intensity;
//         this.notes = "";
//         this.symptoms = new ArrayList<>();
//     }
// 
//     /**
//      * Construct a new day entry
//      */
//     DayEntry() {
//         this.type = EMPTY;
//         this.date = new GregorianCalendarExt();
//         this.dayofcycle = 0;
//         this.intensity = 1;
//         this.notes = "";
//         this.symptoms = new ArrayList<>();
//     }
// }


import java.util.Calendar;
import java.util.Iterator;
import de.arnowelzel.android.periodical.PeriodicalDatabase.DayEntry;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import java.util.ArrayList;
/*
 * Periodical list with details activity
 * Copyright (C) 2012-2020 Arno Welzel
 *
 * This code 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.
 *
 * This program 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.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package de.arnowelzel.android.periodical;




/**
 * Activity to handle the "List, details" command
 */
public class ListDetailsActivity extends AppCompatActivity implements AdapterView.OnItemClickListener {
    /**
     * Database for calendar data
     */
    private PeriodicalDatabase dbMain;

    /**
     * Called when activity starts
     */
    @SuppressLint("NewApi")
    @Override
    public void onCreate(Bundle savedInstanceState) {
        final Context context = getApplicationContext();
        assert context != null;
        super.onCreate(savedInstanceState);

        // Set up database and string array for the list
        dbMain = new PeriodicalDatabase(context);
        dbMain.loadRawDataWithDetails();

// Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// public static class DayEntry {
//     final static int EMPTY = 0;
//     final static int PERIOD_START = 1;
//     final static int PERIOD_CONFIRMED = 2;
//     final static int PERIOD_PREDICTED = 3;
//     final static int FERTILITY_PREDICTED = 4;
//     final static int OVULATION_PREDICTED = 5;
//     final static int FERTILITY_FUTURE = 6;
//     final static int OVULATION_FUTURE = 7;
//     final static int INFERTILE_PREDICTED = 8;
//     final static int INFERTILE_FUTURE = 9;
//     int type;
//     final GregorianCalendarExt date;
//     int dayofcycle;
//     int intensity;
//     String notes;
//     List<Integer> symptoms;
// 
//     /**
//      * Construct a new day entry with parameters
//      *
//      * @param type       Entry type (DayEntry.EMPTY, DayEntry.PERIOD_START, DayEntry.PERIOD_CONFIRMED, ...)
//      * @param date       Entry date
//      * @param dayofcycle Day within current cycle (beginning with 1)
//      * @param intensity  Intensity of the period (1-4)
//      */
//     DayEntry(int type, GregorianCalendar date, int dayofcycle, int intensity) {
//         this.type = type;
//         this.date = new GregorianCalendarExt();
//         this.date.setTime(date.getTime());
//         this.dayofcycle = dayofcycle;
//         this.intensity = intensity;
//         this.notes = "";
//         this.symptoms = new ArrayList<>();
//     }
// 
//     /**
//      * Construct a new day entry
//      */
//     DayEntry() {
//         this.type = EMPTY;
//         this.date = new GregorianCalendarExt();
//         this.dayofcycle = 0;
//         this.intensity = 1;
//         this.notes = "";
//         this.symptoms = new ArrayList<>();
//     }
// }


// Path: app/src/main/java/de/arnowelzel/android/periodical/ListDetailsActivity.java
import java.util.Calendar;
import java.util.Iterator;
import de.arnowelzel.android.periodical.PeriodicalDatabase.DayEntry;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import java.util.ArrayList;

/*
 * Periodical list with details activity
 * Copyright (C) 2012-2020 Arno Welzel
 *
 * This code 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.
 *
 * This program 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.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package de.arnowelzel.android.periodical;




/**
 * Activity to handle the "List, details" command
 */
public class ListDetailsActivity extends AppCompatActivity implements AdapterView.OnItemClickListener {
    /**
     * Database for calendar data
     */
    private PeriodicalDatabase dbMain;

    /**
     * Called when activity starts
     */
    @SuppressLint("NewApi")
    @Override
    public void onCreate(Bundle savedInstanceState) {
        final Context context = getApplicationContext();
        assert context != null;
        super.onCreate(savedInstanceState);

        // Set up database and string array for the list
        dbMain = new PeriodicalDatabase(context);
        dbMain.loadRawDataWithDetails();

        ArrayList<DayEntry> dayList = new ArrayList<>();