// Path: app/src/main/java/com/weather/byhieg/easyweather/data/bean/HWeather.java
// public class HWeather implements Parcelable,Serializable {
// 
// 
//     private List<Weather> HeWeather5;
// 
//     public List<Weather> getHeWeather5() {
//         return HeWeather5;
//     }
// 
//     public void setHeWeather5(List<Weather> HeWeather5) {
//         this.HeWeather5 = HeWeather5;
//     }
// 
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeList(this.HeWeather5);
//     }
// 
//     public HWeather() {
//     }
// 
//     protected HWeather(Parcel in) {
//         this.HeWeather5 = new ArrayList<Weather>();
//         in.readList(this.HeWeather5, Weather.class.getClassLoader());
//     }
// 
//     public static final Creator<HWeather> CREATOR = new Creator<HWeather>() {
//         @Override
//         public HWeather createFromParcel(Parcel source) {
//             return new HWeather(source);
//         }
// 
//         @Override
//         public HWeather[] newArray(int size) {
//             return new HWeather[size];
//         }
//     };
// }
// 
// Path: app/src/main/java/com/weather/byhieg/easyweather/data/source/WeatherRepository.java
// public class WeatherRepository implements WeatherDataSource {
// 
//     private static final String TAG = "WeatherRepository";
// 
//     private static WeatherRepository sInstance = null;
// 
//     private final WeatherRemoteDataSource mWeatherRemoteDataSource;
//     private final WeatherLocalDataSource mWeatherLocalDataSource;
// 
//     private boolean isCachedDirty = false;
// 
//     private WeatherRepository() {
//         mWeatherLocalDataSource = new WeatherLocalDataSource();
//         mWeatherRemoteDataSource = new WeatherRemoteDataSource();
//     }
// 
//     public static WeatherRepository getInstance() {
//         if (sInstance == null) {
//             sInstance = new WeatherRepository();
//         }
//         return sInstance;
//     }
// 
//     public static void destoryInstance() {
//         sInstance = null;
//     }
// 
// 
//     @Override
//     public String getShowCity() {
//         return mWeatherLocalDataSource.getShowCity();
//     }
// 
//     @Override
//     public void addWeather(WeatherEntity entity) {
//         mWeatherLocalDataSource.addWeather(entity);
//     }
// 
//     @Override
//     public boolean isExistInCityWeather(String cityName) {
//         return mWeatherLocalDataSource.isExistInCityWeather(cityName);
//     }
// 
//     @Override
//     public void getWeatherDataFromCity(String cityName, GetWeatherCallBack callBack) throws Exception {
//         mWeatherRemoteDataSource.getWeatherDataFromCity(cityName, callBack);
//     }
// 
//     @Override
//     public void getWeatherEntity(String cityName, GetWeatherEntityCallBack callBack) {
//         mWeatherLocalDataSource.getWeatherEntity(cityName, callBack);
//     }
// 
//     @Override
//     public WeatherEntity getWeatherEntity(String cityName) {
//         return mWeatherLocalDataSource.getWeatherEntity(cityName);
//     }
// 
//     @Override
//     public void updateCityWeather(final String cityName) throws Exception {
//         if (isExistInCityWeather(cityName)) {
//             WeatherEntity entity = getWeatherEntity(cityName);
//             Date oldTime = entity.getUpdateTime();
//             Date nowDate = convertDate(new Date());
//             if (isNeedUpdate(oldTime, nowDate)) {
//                 isCachedDirty = true;
//                 HWeather weather = getWeatherDataFromCity(cityName);
//                 saveWeather(weather);
//                 LogUtils.e(TAG,"save了");
//             }
//         } else {
//             HWeather weather = getWeatherDataFromCity(cityName);
//             saveWeather(weather);
//         }
// 
//     }
// 
// 
//     @Override
//     public HWeather getLocalWeather(String cityName) {
//         return mWeatherLocalDataSource.getLocalWeather(cityName);
//     }
// 
// 
//     @Override
//     public void saveWeather(HWeather weather) {
//         mWeatherLocalDataSource.saveWeather(weather);
//     }
// 
//     @Override
//     public HWeather getWeatherDataFromCity(String cityName) throws Exception {
//         return mWeatherRemoteDataSource.getWeatherDataFromCity(cityName);
//     }
// 
//     class MyCallBack implements GetWeatherCallBack {
// 
//         @Override
//         public void onSuccess(HWeather weather) {
//             mWeatherLocalDataSource.saveWeather(weather);
//         }
// 
//         @Override
//         public void onFailure(String failureMessage) {
//             Log.e(TAG, failureMessage);
//         }
//     }
// 
// }


import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.DashPathEffect;
import android.graphics.Paint;
import android.graphics.PathEffect;
import android.graphics.Typeface;
import android.support.v4.content.ContextCompat;
import android.util.Log;
import com.orhanobut.logger.Logger;
import com.weather.byhieg.easyweather.R;
import com.weather.byhieg.easyweather.data.bean.HWeather;
import com.weather.byhieg.easyweather.data.source.WeatherRepository;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
package com.weather.byhieg.easyweather.tools;




/**
 * Created by byhieg on 16-10-1.
 * Mail byhieg@gmail.com
 */

public class ImageUtils {


    public static final int BRIEF = 1;
    public static final int DETAIL = 2;
    public static final int FUTURE = 3;
// Path: app/src/main/java/com/weather/byhieg/easyweather/data/bean/HWeather.java
// public class HWeather implements Parcelable,Serializable {
// 
// 
//     private List<Weather> HeWeather5;
// 
//     public List<Weather> getHeWeather5() {
//         return HeWeather5;
//     }
// 
//     public void setHeWeather5(List<Weather> HeWeather5) {
//         this.HeWeather5 = HeWeather5;
//     }
// 
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeList(this.HeWeather5);
//     }
// 
//     public HWeather() {
//     }
// 
//     protected HWeather(Parcel in) {
//         this.HeWeather5 = new ArrayList<Weather>();
//         in.readList(this.HeWeather5, Weather.class.getClassLoader());
//     }
// 
//     public static final Creator<HWeather> CREATOR = new Creator<HWeather>() {
//         @Override
//         public HWeather createFromParcel(Parcel source) {
//             return new HWeather(source);
//         }
// 
//         @Override
//         public HWeather[] newArray(int size) {
//             return new HWeather[size];
//         }
//     };
// }
// 
// Path: app/src/main/java/com/weather/byhieg/easyweather/data/source/WeatherRepository.java
// public class WeatherRepository implements WeatherDataSource {
// 
//     private static final String TAG = "WeatherRepository";
// 
//     private static WeatherRepository sInstance = null;
// 
//     private final WeatherRemoteDataSource mWeatherRemoteDataSource;
//     private final WeatherLocalDataSource mWeatherLocalDataSource;
// 
//     private boolean isCachedDirty = false;
// 
//     private WeatherRepository() {
//         mWeatherLocalDataSource = new WeatherLocalDataSource();
//         mWeatherRemoteDataSource = new WeatherRemoteDataSource();
//     }
// 
//     public static WeatherRepository getInstance() {
//         if (sInstance == null) {
//             sInstance = new WeatherRepository();
//         }
//         return sInstance;
//     }
// 
//     public static void destoryInstance() {
//         sInstance = null;
//     }
// 
// 
//     @Override
//     public String getShowCity() {
//         return mWeatherLocalDataSource.getShowCity();
//     }
// 
//     @Override
//     public void addWeather(WeatherEntity entity) {
//         mWeatherLocalDataSource.addWeather(entity);
//     }
// 
//     @Override
//     public boolean isExistInCityWeather(String cityName) {
//         return mWeatherLocalDataSource.isExistInCityWeather(cityName);
//     }
// 
//     @Override
//     public void getWeatherDataFromCity(String cityName, GetWeatherCallBack callBack) throws Exception {
//         mWeatherRemoteDataSource.getWeatherDataFromCity(cityName, callBack);
//     }
// 
//     @Override
//     public void getWeatherEntity(String cityName, GetWeatherEntityCallBack callBack) {
//         mWeatherLocalDataSource.getWeatherEntity(cityName, callBack);
//     }
// 
//     @Override
//     public WeatherEntity getWeatherEntity(String cityName) {
//         return mWeatherLocalDataSource.getWeatherEntity(cityName);
//     }
// 
//     @Override
//     public void updateCityWeather(final String cityName) throws Exception {
//         if (isExistInCityWeather(cityName)) {
//             WeatherEntity entity = getWeatherEntity(cityName);
//             Date oldTime = entity.getUpdateTime();
//             Date nowDate = convertDate(new Date());
//             if (isNeedUpdate(oldTime, nowDate)) {
//                 isCachedDirty = true;
//                 HWeather weather = getWeatherDataFromCity(cityName);
//                 saveWeather(weather);
//                 LogUtils.e(TAG,"save了");
//             }
//         } else {
//             HWeather weather = getWeatherDataFromCity(cityName);
//             saveWeather(weather);
//         }
// 
//     }
// 
// 
//     @Override
//     public HWeather getLocalWeather(String cityName) {
//         return mWeatherLocalDataSource.getLocalWeather(cityName);
//     }
// 
// 
//     @Override
//     public void saveWeather(HWeather weather) {
//         mWeatherLocalDataSource.saveWeather(weather);
//     }
// 
//     @Override
//     public HWeather getWeatherDataFromCity(String cityName) throws Exception {
//         return mWeatherRemoteDataSource.getWeatherDataFromCity(cityName);
//     }
// 
//     class MyCallBack implements GetWeatherCallBack {
// 
//         @Override
//         public void onSuccess(HWeather weather) {
//             mWeatherLocalDataSource.saveWeather(weather);
//         }
// 
//         @Override
//         public void onFailure(String failureMessage) {
//             Log.e(TAG, failureMessage);
//         }
//     }
// 
// }


// Path: app/src/main/java/com/weather/byhieg/easyweather/tools/ImageUtils.java
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.DashPathEffect;
import android.graphics.Paint;
import android.graphics.PathEffect;
import android.graphics.Typeface;
import android.support.v4.content.ContextCompat;
import android.util.Log;
import com.orhanobut.logger.Logger;
import com.weather.byhieg.easyweather.R;
import com.weather.byhieg.easyweather.data.bean.HWeather;
import com.weather.byhieg.easyweather.data.source.WeatherRepository;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

package com.weather.byhieg.easyweather.tools;




/**
 * Created by byhieg on 16-10-1.
 * Mail byhieg@gmail.com
 */

public class ImageUtils {


    public static final int BRIEF = 1;
    public static final int DETAIL = 2;
    public static final int FUTURE = 3;
    private static WeatherRepository mWeatherRepository = WeatherRepository.getInstance();