package com.fisheradelakin.vortex;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

/**
 * Created by Fisher on 1/15/15.
 */
public class CurrentWeather {
    private String mIcon;
    private long mTime;
    private double mTemperature;
    private double mHumidity;
    private double mPrecipChance;
    private String mSummary;

    public String getTimeZone() {
        return mTimeZone;
    }

    public void setTimeZone(String timeZone) {
        mTimeZone = timeZone;
    }

    private String mTimeZone;

    public String getIcon() {
        return mIcon;
    }

    public void setIcon(String icon) {
        mIcon = icon;
    }

    public long getTime() {
        return mTime;
    }

    public String getFormattedTime() {
        SimpleDateFormat formatter = new SimpleDateFormat("h:mm a");
        formatter.setTimeZone(TimeZone.getTimeZone(getTimeZone()));
        Date dateTime = new Date(getTime() * 1000);
        String timeString = formatter.format(dateTime);

        return timeString;
    }

    public void setTime(long time) {
        mTime = time;
    }

    public double getTemperature() {
        return mTemperature;
    }

    public void setTemperature(double temperature) {
        mTemperature = temperature;
    }

    public double getHumidity() {
        return mHumidity;
    }

    public void setHumidity(double humidity) {
        mHumidity = humidity;
    }

    public double getPrecipChance() {
        return mPrecipChance;
    }

    public void setPrecipChance(double precipChance) {
        mPrecipChance = precipChance;
    }

    public String getSummary() {
        return mSummary;
    }

    public void setSummary(String summary) {
        mSummary = summary;
    }
}

@@ -664,32 +664,1327 @@
  = icon;%0A    %7D%0A%0A
+    public int getIconId() %7B%0A        // clear-day, clear-night, rain, snow, sleet, wind, fog, cloudy, partly-cloudy-day, or partly-cloudy-night%0A        int iconId;%0A%0A        switch (mIcon) %7B%0A            case %22clear-day%22:%0A                iconId = R.drawable.clear_day;%0A                break;%0A            case %22clear-night%22:%0A                iconId = R.drawable.clear_night;%0A                break;%0A            case %22rain%22:%0A                iconId = R.drawable.rain;%0A                break;%0A            case %22snow%22:%0A                iconId = R.drawable.snow;%0A                break;%0A            case %22sleet%22:%0A                iconId = R.drawable.sleet;%0A                break;%0A            case %22wind%22:%0A                iconId = R.drawable.wind;%0A                break;%0A            case %22fog%22:%0A                iconId = R.drawable.fog;%0A                break;%0A            case %22cloudy%22:%0A                iconId = R.drawable.cloudy;%0A                break;%0A            case %22partly-cloudy-day%22:%0A                iconId = R.drawable.partly_cloudy;%0A                break;%0A            case %22partly-cloudy-night%22:%0A                iconId = R.drawable.cloudy_night;%0A                break;%0A            default:%0A                iconId = R.drawable.clear_day;%0A                break;%0A        %7D%0A%0A        return iconId;%0A    %7D%0A%0A
     public long 
@@ -2252,24 +2252,25 @@
  1000);%0A
+%0A
         
 String t
@@ -2265,27 +2265,14 @@
     
-String timeString =
+return
  for
@@ -2299,36 +2299,8 @@
 me);
-%0A%0A        return timeString;
 %0A   

set weather icon