// Path: app/src/main/java/io/petros/posts/app/PostsApplication.java
// @SuppressWarnings("checkstyle:overloadmethodsdeclarationorder")
// public class PostsApplication extends Application {
// 
//     private static ApplicationComponent applicationComponent;
// 
//     static {
//         AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); // NOTE: This enables the "proxy" trick on the vector images.
//     }
// 
//     @Inject AppSnackbarActions appSnackbarActions;
// 
//     // HELPER // ************************************************************************************************************
// 
//     public static ApplicationComponent getApplicationComponent() {
//         return applicationComponent;
//     }
// 
//     public static SnackbarActions snackbar(final Activity activity) {
//         return ((PostsApplication) activity.getApplication()).snackbar();
//     }
// 
//     // APPLICATION // *******************************************************************************************************
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         initDagger();
//         initRealm();
//         initTimber();
//         Timber.i("Posts application created!");
//     }
// 
//     private void initDagger() {
//         applicationComponent = DaggerApplicationComponent.builder()
//                 .appModule(new AppModule(this))
//                 .netModule(new NetModule(BASE_URL))
//                 .dataModule(new DataModule())
//                 .serviceModule(new ServiceModule())
//                 .activityModule(new ActivityModule()).build();
//         applicationComponent.inject(this);
//     }
// 
//     private void initTimber() {
//         Timber.plant(new Timber.DebugTree());
//     }
// 
//     protected void initRealm() {
//         Realm.init(this);
//     }
// 
//     // GET // ***************************************************************************************************************
// 
//     public Realm getDefaultRealmInstance() {
//         return Realm.getDefaultInstance();
//     }
// 
//     // ACTIONS // ***********************************************************************************************************
// 
//     public SnackbarActions snackbar() {
//         return appSnackbarActions;
//     }
// 
// }
// 
// Path: app/src/main/java/io/petros/posts/service/detector/InternetAvailabilityDetector.java
// public class InternetAvailabilityDetector implements AvailabilityDetector {
// 
//     private final ConnectivityManager connectivityManager;
// 
//     public InternetAvailabilityDetector(final PostsApplication application) {
//         this.connectivityManager = (ConnectivityManager) application.getSystemService(Context.CONNECTIVITY_SERVICE);
//     }
// 
//     @Override
//     public boolean isAvailable() {
//         @Nullable final NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
//         if (activeNetworkInfo != null) {
//             if (activeNetworkInfo.getType() == ConnectivityManager.TYPE_WIFI) {
//                 Timber.v("Internet connection is available; Connected to WiFi.");
//                 return true;
//             } else if (activeNetworkInfo.getType() == ConnectivityManager.TYPE_MOBILE) {
//                 Timber.v("Internet connection is available; Connected to the mobile provider's data plan.");
//                 return true;
//             } else {
//                 Timber.v("Internet connection is available. [Network Type: %d]", activeNetworkInfo.getType());
//                 return true;
//             }
//         } else {
//             Timber.d("Internet connection is not available at the moment.");
//             return false;
//         }
//     }
// 
// }


import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import io.petros.posts.app.PostsApplication;
import io.petros.posts.service.detector.InternetAvailabilityDetector;
package io.petros.posts.app.graph.modules;



@Module
public class ServiceModule {

    @Provides
    @Singleton
// Path: app/src/main/java/io/petros/posts/app/PostsApplication.java
// @SuppressWarnings("checkstyle:overloadmethodsdeclarationorder")
// public class PostsApplication extends Application {
// 
//     private static ApplicationComponent applicationComponent;
// 
//     static {
//         AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); // NOTE: This enables the "proxy" trick on the vector images.
//     }
// 
//     @Inject AppSnackbarActions appSnackbarActions;
// 
//     // HELPER // ************************************************************************************************************
// 
//     public static ApplicationComponent getApplicationComponent() {
//         return applicationComponent;
//     }
// 
//     public static SnackbarActions snackbar(final Activity activity) {
//         return ((PostsApplication) activity.getApplication()).snackbar();
//     }
// 
//     // APPLICATION // *******************************************************************************************************
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         initDagger();
//         initRealm();
//         initTimber();
//         Timber.i("Posts application created!");
//     }
// 
//     private void initDagger() {
//         applicationComponent = DaggerApplicationComponent.builder()
//                 .appModule(new AppModule(this))
//                 .netModule(new NetModule(BASE_URL))
//                 .dataModule(new DataModule())
//                 .serviceModule(new ServiceModule())
//                 .activityModule(new ActivityModule()).build();
//         applicationComponent.inject(this);
//     }
// 
//     private void initTimber() {
//         Timber.plant(new Timber.DebugTree());
//     }
// 
//     protected void initRealm() {
//         Realm.init(this);
//     }
// 
//     // GET // ***************************************************************************************************************
// 
//     public Realm getDefaultRealmInstance() {
//         return Realm.getDefaultInstance();
//     }
// 
//     // ACTIONS // ***********************************************************************************************************
// 
//     public SnackbarActions snackbar() {
//         return appSnackbarActions;
//     }
// 
// }
// 
// Path: app/src/main/java/io/petros/posts/service/detector/InternetAvailabilityDetector.java
// public class InternetAvailabilityDetector implements AvailabilityDetector {
// 
//     private final ConnectivityManager connectivityManager;
// 
//     public InternetAvailabilityDetector(final PostsApplication application) {
//         this.connectivityManager = (ConnectivityManager) application.getSystemService(Context.CONNECTIVITY_SERVICE);
//     }
// 
//     @Override
//     public boolean isAvailable() {
//         @Nullable final NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
//         if (activeNetworkInfo != null) {
//             if (activeNetworkInfo.getType() == ConnectivityManager.TYPE_WIFI) {
//                 Timber.v("Internet connection is available; Connected to WiFi.");
//                 return true;
//             } else if (activeNetworkInfo.getType() == ConnectivityManager.TYPE_MOBILE) {
//                 Timber.v("Internet connection is available; Connected to the mobile provider's data plan.");
//                 return true;
//             } else {
//                 Timber.v("Internet connection is available. [Network Type: %d]", activeNetworkInfo.getType());
//                 return true;
//             }
//         } else {
//             Timber.d("Internet connection is not available at the moment.");
//             return false;
//         }
//     }
// 
// }


// Path: app/src/main/java/io/petros/posts/app/graph/modules/ServiceModule.java
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import io.petros.posts.app.PostsApplication;
import io.petros.posts.service.detector.InternetAvailabilityDetector;

package io.petros.posts.app.graph.modules;



@Module
public class ServiceModule {

    @Provides
    @Singleton
    InternetAvailabilityDetector provideInternetAvailabilityDetector(final PostsApplication application) {