package org.keyscience.models;

import java.util.ArrayList;

import org.keyscience.R;
import org.keyscience.app.Constants;


public class HomePageItem {
    private int imageID;
    private String title;
    private String subTitle;


    public static ArrayList<HomePageItem> getData() {
        ArrayList<HomePageItem> dataList = new ArrayList<>();
        int[] images = getImages();
        String[] subTitles = getSubTitles();
        String[] titles = getTitles();
        for (int i = 0; i < images.length; i++) {
            HomePageItem homePageItem = new HomePageItem();
            homePageItem.setImageID(images[i]);
            homePageItem.setSubTitle(subTitles[i]);
            homePageItem.setTitle(titles[i]);
            dataList.add(homePageItem);
        }
        return dataList;
    }

    // order in which items are stored in this array must match the subTitles and titles array order as well.
    private static int[] getImages() {
        int[] images = {
                R.drawable.key_challenge_home, R.drawable.reef_restoration_home, R.drawable.water_watch_home,
                R.drawable.sea_level_home, R.drawable.lectures_home, R.drawable.field_activities_home,
                R.drawable.partners_home, R.drawable.contact_home
        };
        return images;
    }

    private static String[] getSubTitles() {
        String[] titles = {Constants.KEY_CHALLENGE, Constants.REEF_RESTORATION, Constants.WATER_WATCH,
                Constants.SEA_LEVEL_RISE, Constants.LECTURE_SERIES, Constants.FIELD_ACTIVITIES,
                Constants.OUR_PARTNERS, Constants.CONTACT_US
        };
        return titles;
    }

    private static String[] getTitles() {
        String[] titles = {Constants.CSP, Constants.KEY_BISCAYNE, Constants.KEY_BISCAYNE,
                Constants.KEY_BISCAYNE, Constants.CITIZEN_SCIENTIST_PROJECT, Constants.CITIZEN_SCIENTIST_PROJECT,
                Constants.CITIZEN_SCIENTIST_PROJECT, Constants.CITIZEN_SCIENTIST_PROJECT};
        return titles;
    }


    public int getImageID() {
        return imageID;
    }

    public void setImageID(int imageID) {
        this.imageID = imageID;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getSubTitle() {
        return subTitle;
    }

    public void setSubTitle(String subTitle) {
        this.subTitle = subTitle;
    }

}
