// Path: app/src/main/java/pt/passarola/services/rest/RestApi.java
// @Singleton
// public class RestApi {
// 
//     public static boolean DEBUG = true;
//     private ApiServices apiServices;
// 
//     @Inject
//     public RestApi() {
//         RestAdapter restAdapter = build(Endpoints.baseUrl);
//         apiServices = restAdapter.create(ApiServices.class);
//     }
// 
//     public RestAdapter build(String baseUrl) {
//         RestAdapter adapter = new RestAdapter.Builder()
//                 .setEndpoint(baseUrl)
//                 .build();
// 
//         if (DEBUG) {
//             adapter.setLogLevel(RestAdapter.LogLevel.FULL);
//         }
// 
//         return adapter;
//     }
// 
//     public ApiServices getApiServices() {
//         return apiServices;
//     }
// }
// 
// Path: app/src/main/java/pt/passarola/services/tracker/TrackerManager.java
// public class TrackerManager {
// 
//     public static final String EVENT_CLICK_TAB_BEERS = "event-click-tab-beers";
//     public static final String EVENT_CLICK_TAB_PLACES = "event-click-tab-places";
//     public static final String EVENT_CLICK_TAB_CLOSEST = "event-click-tab-closest";
//     public static final String EVENT_CLICK_PLACE_CLOSEST = "event-click-place-close";
//     public static final String EVENT_CLICK_MARKER = "event-click-marker";
//     public static final String EVENT_CLICK_INFO_WINDOW = "event-click-info-window";
//     public static final String EVENT_CLICK_PLACE_PHONE = "event-click-place-phone";
//     public static final String EVENT_CLICK_PLACE_FACEBOOK = "event-click-place-facebook";
//     public static final String EVENT_CLICK_PLACE_ZOMATO = "event-click-place-zomato";
//     public static final String EVENT_CLICK_PLACE_TRIPADVISOR = "event-click-tripadvisor";
//     public static final String EVENT_CLICK_ALL_PLACES_FACEBOOK = "event-click-all-places-facebook";
//     public static final String EVENT_CLICK_ALL_PLACES_ZOMATO = "event-click-all-places-zomato";
//     public static final String EVENT_CLICK_ALL_PLACES_TRIPADVISOR = "event-click-all-places-tripadvisor";
//     public static final String EVENT_CLICK_BEER_RATEBEER = "event-click-beer-ratebeer";
//     public static final String EVENT_CLICK_BEER_UNTAPPD = "event-click-beer-untappd";
//     public static final String EVENT_CLICK_ABOUT_EMAIL = "event-click-about-email";
//     public static final String EVENT_CLICK_ABOUT_FACEBOOK = "event-click-about-facebook";
// 
//     public void trackEvent(String eventName){
//         Answers.getInstance().logCustom(new CustomEvent(eventName));
//     }
// 
//     public void trackEvent(String eventName, String key, String value){
// 
//         //truncate value to 100 chars
//         if(value.length() > 100) {
//             value = value.substring(0, 99);
//         }
// 
//         CustomEvent customEvent = new CustomEvent(eventName);
//         customEvent.putCustomAttribute(key, value);
// 
//         Answers.getInstance().logCustom(customEvent);
//     }
// 
//     public void trackEvent(String eventName, HashMap<String, String> attributes){
//         CustomEvent customEvent = new CustomEvent(eventName);
//         for(Map.Entry<String, String> entry : attributes.entrySet()){
//             customEvent.putCustomAttribute(entry.getKey(), entry.getValue());
//         }
// 
//         Answers.getInstance().logCustom(customEvent);
//     }
// }


import android.content.Context;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import pt.passarola.services.rest.RestApi;
import pt.passarola.services.tracker.TrackerManager;
package pt.passarola.services;





/**
 * Created by ruigoncalo on 22/10/15.
 */
@Module(library = true, complete = false)
public class ServicesModule {

    @Provides
    @Singleton
    BusProvider provideBus() {
        return new BusProvider();
    }

    @Provides
    @Singleton
    WebApiService provideWebApiService(RestApi restApi) {
        return new WebApiService(restApi);
    }

    @Provides
    @Singleton
    PlaceProvider providePlaceProvider(BusProvider busProvider, WebApiService webApiService) {
        return new PlaceProvider(busProvider, webApiService);
    }

// Path: app/src/main/java/pt/passarola/services/rest/RestApi.java
// @Singleton
// public class RestApi {
// 
//     public static boolean DEBUG = true;
//     private ApiServices apiServices;
// 
//     @Inject
//     public RestApi() {
//         RestAdapter restAdapter = build(Endpoints.baseUrl);
//         apiServices = restAdapter.create(ApiServices.class);
//     }
// 
//     public RestAdapter build(String baseUrl) {
//         RestAdapter adapter = new RestAdapter.Builder()
//                 .setEndpoint(baseUrl)
//                 .build();
// 
//         if (DEBUG) {
//             adapter.setLogLevel(RestAdapter.LogLevel.FULL);
//         }
// 
//         return adapter;
//     }
// 
//     public ApiServices getApiServices() {
//         return apiServices;
//     }
// }
// 
// Path: app/src/main/java/pt/passarola/services/tracker/TrackerManager.java
// public class TrackerManager {
// 
//     public static final String EVENT_CLICK_TAB_BEERS = "event-click-tab-beers";
//     public static final String EVENT_CLICK_TAB_PLACES = "event-click-tab-places";
//     public static final String EVENT_CLICK_TAB_CLOSEST = "event-click-tab-closest";
//     public static final String EVENT_CLICK_PLACE_CLOSEST = "event-click-place-close";
//     public static final String EVENT_CLICK_MARKER = "event-click-marker";
//     public static final String EVENT_CLICK_INFO_WINDOW = "event-click-info-window";
//     public static final String EVENT_CLICK_PLACE_PHONE = "event-click-place-phone";
//     public static final String EVENT_CLICK_PLACE_FACEBOOK = "event-click-place-facebook";
//     public static final String EVENT_CLICK_PLACE_ZOMATO = "event-click-place-zomato";
//     public static final String EVENT_CLICK_PLACE_TRIPADVISOR = "event-click-tripadvisor";
//     public static final String EVENT_CLICK_ALL_PLACES_FACEBOOK = "event-click-all-places-facebook";
//     public static final String EVENT_CLICK_ALL_PLACES_ZOMATO = "event-click-all-places-zomato";
//     public static final String EVENT_CLICK_ALL_PLACES_TRIPADVISOR = "event-click-all-places-tripadvisor";
//     public static final String EVENT_CLICK_BEER_RATEBEER = "event-click-beer-ratebeer";
//     public static final String EVENT_CLICK_BEER_UNTAPPD = "event-click-beer-untappd";
//     public static final String EVENT_CLICK_ABOUT_EMAIL = "event-click-about-email";
//     public static final String EVENT_CLICK_ABOUT_FACEBOOK = "event-click-about-facebook";
// 
//     public void trackEvent(String eventName){
//         Answers.getInstance().logCustom(new CustomEvent(eventName));
//     }
// 
//     public void trackEvent(String eventName, String key, String value){
// 
//         //truncate value to 100 chars
//         if(value.length() > 100) {
//             value = value.substring(0, 99);
//         }
// 
//         CustomEvent customEvent = new CustomEvent(eventName);
//         customEvent.putCustomAttribute(key, value);
// 
//         Answers.getInstance().logCustom(customEvent);
//     }
// 
//     public void trackEvent(String eventName, HashMap<String, String> attributes){
//         CustomEvent customEvent = new CustomEvent(eventName);
//         for(Map.Entry<String, String> entry : attributes.entrySet()){
//             customEvent.putCustomAttribute(entry.getKey(), entry.getValue());
//         }
// 
//         Answers.getInstance().logCustom(customEvent);
//     }
// }


// Path: app/src/main/java/pt/passarola/services/ServicesModule.java
import android.content.Context;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import pt.passarola.services.rest.RestApi;
import pt.passarola.services.tracker.TrackerManager;

package pt.passarola.services;





/**
 * Created by ruigoncalo on 22/10/15.
 */
@Module(library = true, complete = false)
public class ServicesModule {

    @Provides
    @Singleton
    BusProvider provideBus() {
        return new BusProvider();
    }

    @Provides
    @Singleton
    WebApiService provideWebApiService(RestApi restApi) {
        return new WebApiService(restApi);
    }

    @Provides
    @Singleton
    PlaceProvider providePlaceProvider(BusProvider busProvider, WebApiService webApiService) {
        return new PlaceProvider(busProvider, webApiService);
    }

    @Provides