// Path: SimpleWeatherForecast/src/main/java/fr/tvbarthel/apps/simpleweatherforcast/openweathermap/DailyForecastModel.java
// public class DailyForecastModel implements Parcelable {
// 
//     private long mDateTime;
//     private String mDescription;
//     private Double mTemperature;
//     private Double mMinTemperature;
//     private Double mMaxTemperature;
//     private int mHumidity;
// 
//     public DailyForecastModel() {
//     }
// 
//     public DailyForecastModel(Parcel in) {
//         readFromParcel(in);
//     }
// 
//     public String getDescription() {
//         return mDescription;
//     }
// 
//     public void setDescription(String description) {
//         mDescription = description;
//     }
// 
//     public int getHumidity() {
//         return mHumidity;
//     }
// 
//     public void setHumidity(int humidity) {
//         mHumidity = humidity;
//     }
// 
//     public long getDateTime() {
//         return mDateTime;
//     }
// 
//     public void setDateTime(long dateTime) {
//         mDateTime = dateTime;
//     }
// 
//     public Double getTemperature() {
//         return mTemperature;
//     }
// 
//     public void setTemperature(Double temperature) {
//         mTemperature = temperature;
//     }
// 
//     public Double getMinTemperature() {
//         return mMinTemperature;
//     }
// 
//     public void setMinTemperature(Double minTemperature) {
//         mMinTemperature = minTemperature;
//     }
// 
//     public Double getMaxTemperature() {
//         return mMaxTemperature;
//     }
// 
//     public void setMaxTemperature(Double maxTemperature) {
//         mMaxTemperature = maxTemperature;
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeLong(mDateTime);
//         dest.writeString(mDescription);
//         dest.writeInt(mHumidity);
//         dest.writeDouble(mTemperature);
//         dest.writeDouble(mMinTemperature);
//         dest.writeDouble(mMaxTemperature);
//     }
// 
//     private void readFromParcel(Parcel in) {
//         mDateTime = in.readLong();
//         mDescription = in.readString();
//         mHumidity = in.readInt();
//         mTemperature = in.readDouble();
//         mMinTemperature = in.readDouble();
//         mMaxTemperature = in.readDouble();
//     }
// 
//     public static final Parcelable.Creator<DailyForecastModel> CREATOR = new Parcelable.Creator<DailyForecastModel>() {
//         @Override
//         public DailyForecastModel createFromParcel(Parcel source) {
//             return new DailyForecastModel(source);
//         }
// 
//         @Override
//         public DailyForecastModel[] newArray(int size) {
//             return new DailyForecastModel[size];
//         }
//     };
// 
// 
// }
// 
// Path: SimpleWeatherForecast/src/main/java/fr/tvbarthel/apps/simpleweatherforcast/utils/TemperatureUtils.java
// public final class TemperatureUtils {
// 
// 
//     /**
//      * Convert a temperature in Celsius to the requested unit.
//      *
//      * @param context              a {@link android.content.Context}
//      * @param temperatureInCelsius the given temperature in Celsius
//      * @param temperatureUnit      the requested unit
//      * @return the temperature converted
//      */
//     public static long convertTemperature(Context context, double temperatureInCelsius, String temperatureUnit) {
//         double temperatureConverted = temperatureInCelsius;
//         if (temperatureUnit.equals(context.getString(R.string.temperature_unit_fahrenheit_symbol))) {
//             temperatureConverted = temperatureInCelsius * 1.8f + 32f;
//         } else if (temperatureUnit.equals(context.getString(R.string.temperature_unit_kelvin_symbol))) {
//             temperatureConverted = temperatureInCelsius + 273.15f;
//         }
//         return Math.round(temperatureConverted);
//     }
// 
//     // Non-instantiable class.
//     private TemperatureUtils() {
//     }
// }


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import fr.tvbarthel.apps.simpleweatherforcast.R;
import fr.tvbarthel.apps.simpleweatherforcast.openweathermap.DailyForecastModel;
import fr.tvbarthel.apps.simpleweatherforcast.utils.TemperatureUtils;
package fr.tvbarthel.apps.simpleweatherforcast.fragments;



/**
 * A simple {@link android.support.v4.app.Fragment} that displays the weather forecast of one day.
 */
public class ForecastFragment extends Fragment {

    public static String ARGUMENT_MODEL = "ForecastFragment.DailyForecastModel";
    public static String ARGUMENT_TEMPERATURE_UNIT = "ForecastFragment.TemperatureUnit";

    public static ForecastFragment newInstance(DailyForecastModel model, String temperatureUnit) {
        final ForecastFragment instance = new ForecastFragment();
        final Bundle arguments = new Bundle();
        arguments.putParcelable(ARGUMENT_MODEL, model);
        arguments.putString(ARGUMENT_TEMPERATURE_UNIT, temperatureUnit);
        instance.setArguments(arguments);
        return instance;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        final View v = inflater.inflate(R.layout.fragment_forecast, container, false);
        final Bundle arguments = getArguments();
        final DailyForecastModel dailyForecastModel = arguments.getParcelable(ARGUMENT_MODEL);
        final String temperatureUnit = arguments.getString(ARGUMENT_TEMPERATURE_UNIT);
        if (dailyForecastModel != null) {
            final long temperature = TemperatureUtils.convertTemperature(getActivity(),
                    dailyForecastModel.getTemperature(), temperatureUnit);
            final long minTemperature = TemperatureUtils.convertTemperature(getActivity(),
                    dailyForecastModel.getMinTemperature(), temperatureUnit);
// Path: SimpleWeatherForecast/src/main/java/fr/tvbarthel/apps/simpleweatherforcast/openweathermap/DailyForecastModel.java
// public class DailyForecastModel implements Parcelable {
// 
//     private long mDateTime;
//     private String mDescription;
//     private Double mTemperature;
//     private Double mMinTemperature;
//     private Double mMaxTemperature;
//     private int mHumidity;
// 
//     public DailyForecastModel() {
//     }
// 
//     public DailyForecastModel(Parcel in) {
//         readFromParcel(in);
//     }
// 
//     public String getDescription() {
//         return mDescription;
//     }
// 
//     public void setDescription(String description) {
//         mDescription = description;
//     }
// 
//     public int getHumidity() {
//         return mHumidity;
//     }
// 
//     public void setHumidity(int humidity) {
//         mHumidity = humidity;
//     }
// 
//     public long getDateTime() {
//         return mDateTime;
//     }
// 
//     public void setDateTime(long dateTime) {
//         mDateTime = dateTime;
//     }
// 
//     public Double getTemperature() {
//         return mTemperature;
//     }
// 
//     public void setTemperature(Double temperature) {
//         mTemperature = temperature;
//     }
// 
//     public Double getMinTemperature() {
//         return mMinTemperature;
//     }
// 
//     public void setMinTemperature(Double minTemperature) {
//         mMinTemperature = minTemperature;
//     }
// 
//     public Double getMaxTemperature() {
//         return mMaxTemperature;
//     }
// 
//     public void setMaxTemperature(Double maxTemperature) {
//         mMaxTemperature = maxTemperature;
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeLong(mDateTime);
//         dest.writeString(mDescription);
//         dest.writeInt(mHumidity);
//         dest.writeDouble(mTemperature);
//         dest.writeDouble(mMinTemperature);
//         dest.writeDouble(mMaxTemperature);
//     }
// 
//     private void readFromParcel(Parcel in) {
//         mDateTime = in.readLong();
//         mDescription = in.readString();
//         mHumidity = in.readInt();
//         mTemperature = in.readDouble();
//         mMinTemperature = in.readDouble();
//         mMaxTemperature = in.readDouble();
//     }
// 
//     public static final Parcelable.Creator<DailyForecastModel> CREATOR = new Parcelable.Creator<DailyForecastModel>() {
//         @Override
//         public DailyForecastModel createFromParcel(Parcel source) {
//             return new DailyForecastModel(source);
//         }
// 
//         @Override
//         public DailyForecastModel[] newArray(int size) {
//             return new DailyForecastModel[size];
//         }
//     };
// 
// 
// }
// 
// Path: SimpleWeatherForecast/src/main/java/fr/tvbarthel/apps/simpleweatherforcast/utils/TemperatureUtils.java
// public final class TemperatureUtils {
// 
// 
//     /**
//      * Convert a temperature in Celsius to the requested unit.
//      *
//      * @param context              a {@link android.content.Context}
//      * @param temperatureInCelsius the given temperature in Celsius
//      * @param temperatureUnit      the requested unit
//      * @return the temperature converted
//      */
//     public static long convertTemperature(Context context, double temperatureInCelsius, String temperatureUnit) {
//         double temperatureConverted = temperatureInCelsius;
//         if (temperatureUnit.equals(context.getString(R.string.temperature_unit_fahrenheit_symbol))) {
//             temperatureConverted = temperatureInCelsius * 1.8f + 32f;
//         } else if (temperatureUnit.equals(context.getString(R.string.temperature_unit_kelvin_symbol))) {
//             temperatureConverted = temperatureInCelsius + 273.15f;
//         }
//         return Math.round(temperatureConverted);
//     }
// 
//     // Non-instantiable class.
//     private TemperatureUtils() {
//     }
// }


// Path: SimpleWeatherForecast/src/main/java/fr/tvbarthel/apps/simpleweatherforcast/fragments/ForecastFragment.java
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import fr.tvbarthel.apps.simpleweatherforcast.R;
import fr.tvbarthel.apps.simpleweatherforcast.openweathermap.DailyForecastModel;
import fr.tvbarthel.apps.simpleweatherforcast.utils.TemperatureUtils;

package fr.tvbarthel.apps.simpleweatherforcast.fragments;



/**
 * A simple {@link android.support.v4.app.Fragment} that displays the weather forecast of one day.
 */
public class ForecastFragment extends Fragment {

    public static String ARGUMENT_MODEL = "ForecastFragment.DailyForecastModel";
    public static String ARGUMENT_TEMPERATURE_UNIT = "ForecastFragment.TemperatureUnit";

    public static ForecastFragment newInstance(DailyForecastModel model, String temperatureUnit) {
        final ForecastFragment instance = new ForecastFragment();
        final Bundle arguments = new Bundle();
        arguments.putParcelable(ARGUMENT_MODEL, model);
        arguments.putString(ARGUMENT_TEMPERATURE_UNIT, temperatureUnit);
        instance.setArguments(arguments);
        return instance;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        final View v = inflater.inflate(R.layout.fragment_forecast, container, false);
        final Bundle arguments = getArguments();
        final DailyForecastModel dailyForecastModel = arguments.getParcelable(ARGUMENT_MODEL);
        final String temperatureUnit = arguments.getString(ARGUMENT_TEMPERATURE_UNIT);
        if (dailyForecastModel != null) {
            final long temperature = TemperatureUtils.convertTemperature(getActivity(),
                    dailyForecastModel.getTemperature(), temperatureUnit);
            final long minTemperature = TemperatureUtils.convertTemperature(getActivity(),
                    dailyForecastModel.getMinTemperature(), temperatureUnit);
            final long maxTemperature = TemperatureUtils.convertTemperature(getActivity(),