// Path: app/src/main/java/com/chernandezgil/farmacias/data/source/MainActivityInteractor.java
// public class MainActivityInteractor {
//     private PreferencesManager mPreferencesManager;
//     private Context mContext;
// 
//     public MainActivityInteractor(PreferencesManager preferencesManager) {
//         mPreferencesManager=preferencesManager;
//         mContext= MyApplication.getContext();
//     }
// 
//     public void loadData(){
//         if(mPreferencesManager.isFirstExecution()) {
//             launchDownloadService();
//             ColorMap colorMap = new ColorMap();
//             colorMap.generate();
//             mPreferencesManager.saveColorMap(colorMap.getColorHashMap());
//             mPreferencesManager.setFirstExecutionFalse();
//         }
//     }
// 
//     private void launchDownloadService() {
//         Intent intent = new Intent(mContext, DownloadFarmacias.class);
//         mContext.startService(intent);
//     }
// }
// 
// Path: app/src/main/java/com/chernandezgil/farmacias/ui/adapter/PreferencesManager.java
// public interface PreferencesManager {
// 
//     SharedPreferences getSharedPreferences();
//     String getLocationKey();
//     int retrieveRadioBusquedaFromSp();
//     boolean isFirstExecution();
//     void setFirstExecutionFalse();
//     int getCurrentItemTabLayout();
//     void setCurrentItemTabLayout(int currentItemTabLayout);
//     void saveLocation(Location location);
//     Location getLocation();
//     int getRadio();
//     void saveFavoriteList(List<Pharmacy> list);
//     List<Pharmacy> getFavorites();
//     void saveColorMap(HashMap<String,Integer> colorMap);
//     HashMap<String,Integer> getColorMap();
//     void saveStreet(String street);
//     String getStreet();
// 
// }
// 
// Path: app/src/main/java/com/chernandezgil/farmacias/view/MainActivityContract.java
// public interface MainActivityContract {
// 
//     interface View {
// 
//     }
//     interface Presenter<V> {
// 
//         void setView(V view);
//         void detachView();
//         void onStart();
// 
// 
//     }
// }


import com.chernandezgil.farmacias.data.source.MainActivityInteractor;
import com.chernandezgil.farmacias.ui.adapter.PreferencesManager;
import com.chernandezgil.farmacias.view.MainActivityContract;
package com.chernandezgil.farmacias.presenter;


/**
 * Created by Carlos on 01/08/2016.
 */
public class MainActivityPresenter implements MainActivityContract.Presenter<MainActivityContract.View> {

    private static final String LOG_TAG=MainActivityPresenter.class.getSimpleName();
    private MainActivityContract.View mMainActivityView;
    private MainActivityInteractor mMainActivityInteractor;
    private PreferencesManager mPreferencesManager;

// Path: app/src/main/java/com/chernandezgil/farmacias/data/source/MainActivityInteractor.java
// public class MainActivityInteractor {
//     private PreferencesManager mPreferencesManager;
//     private Context mContext;
// 
//     public MainActivityInteractor(PreferencesManager preferencesManager) {
//         mPreferencesManager=preferencesManager;
//         mContext= MyApplication.getContext();
//     }
// 
//     public void loadData(){
//         if(mPreferencesManager.isFirstExecution()) {
//             launchDownloadService();
//             ColorMap colorMap = new ColorMap();
//             colorMap.generate();
//             mPreferencesManager.saveColorMap(colorMap.getColorHashMap());
//             mPreferencesManager.setFirstExecutionFalse();
//         }
//     }
// 
//     private void launchDownloadService() {
//         Intent intent = new Intent(mContext, DownloadFarmacias.class);
//         mContext.startService(intent);
//     }
// }
// 
// Path: app/src/main/java/com/chernandezgil/farmacias/ui/adapter/PreferencesManager.java
// public interface PreferencesManager {
// 
//     SharedPreferences getSharedPreferences();
//     String getLocationKey();
//     int retrieveRadioBusquedaFromSp();
//     boolean isFirstExecution();
//     void setFirstExecutionFalse();
//     int getCurrentItemTabLayout();
//     void setCurrentItemTabLayout(int currentItemTabLayout);
//     void saveLocation(Location location);
//     Location getLocation();
//     int getRadio();
//     void saveFavoriteList(List<Pharmacy> list);
//     List<Pharmacy> getFavorites();
//     void saveColorMap(HashMap<String,Integer> colorMap);
//     HashMap<String,Integer> getColorMap();
//     void saveStreet(String street);
//     String getStreet();
// 
// }
// 
// Path: app/src/main/java/com/chernandezgil/farmacias/view/MainActivityContract.java
// public interface MainActivityContract {
// 
//     interface View {
// 
//     }
//     interface Presenter<V> {
// 
//         void setView(V view);
//         void detachView();
//         void onStart();
// 
// 
//     }
// }


// Path: app/src/main/java/com/chernandezgil/farmacias/presenter/MainActivityPresenter.java
import com.chernandezgil.farmacias.data.source.MainActivityInteractor;
import com.chernandezgil.farmacias.ui.adapter.PreferencesManager;
import com.chernandezgil.farmacias.view.MainActivityContract;

package com.chernandezgil.farmacias.presenter;


/**
 * Created by Carlos on 01/08/2016.
 */
public class MainActivityPresenter implements MainActivityContract.Presenter<MainActivityContract.View> {

    private static final String LOG_TAG=MainActivityPresenter.class.getSimpleName();
    private MainActivityContract.View mMainActivityView;
    private MainActivityInteractor mMainActivityInteractor;
    private PreferencesManager mPreferencesManager;

    public MainActivityPresenter(PreferencesManager mPreferencesManager){