// Path: app/src/main/java/eu/se_bastiaan/tvnl/TVNLApplication.java
// public class TVNLApplication extends MultiDexApplication {
// 
//     @Nullable
//     private volatile AppInjectionComponent appInjectionComponent;
//     private static TVNLApplication sThis;
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         sThis = this;
// 
//         if(BuildConfig.DEBUG) {
//             Timber.plant(new Timber.DebugTree());
//         } else {
//             //Timber.plant(new CrashlyticsLogTree(Log.INFO));
//         }
// 
//         CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
//                 .setDefaultFontPath("fonts/Regular.ttf")
//                 .setFontAttrId(R.attr.fontPath)
//                 .build()
//         );
// 
//         Intent recommendationIntent = new Intent(this, RecommendationService.class);
//         startService(recommendationIntent);
//     }
// 
//     public static TVNLApplication get() {
//         return sThis;
//     }
// 
//     @NonNull
//     public AppInjectionComponent appComponent() {
//         if (appInjectionComponent == null) {
//             synchronized (Application.class) {
//                 if (appInjectionComponent == null) {
//                     appInjectionComponent = AppInjectionComponent.Initializer.init(this);
//                 }
//             }
//         }
// 
//         //noinspection ConstantConditions
//         return appInjectionComponent;
//     }
// 
// }


import android.content.Context;
import com.bumptech.glide.Glide;
import com.bumptech.glide.GlideBuilder;
import com.bumptech.glide.load.model.GlideUrl;
import com.bumptech.glide.module.GlideModule;
import java.io.InputStream;
import javax.inject.Inject;
import eu.se_bastiaan.tvnl.TVNLApplication;
import okhttp3.OkHttpClient;
package eu.se_bastiaan.tvnl.network.glide;






/**
 * A {@link com.bumptech.glide.module.GlideModule} implementation to replace Glide's default
 * {@link java.net.HttpURLConnection} based {@link com.bumptech.glide.load.model.ModelLoader}
 * with an OkHttp based {@link com.bumptech.glide.load.model.ModelLoader}.
 * <p/>
 * <p> If you're using gradle, you can include this module simply by depending on the aar, the
 * module will be merged in by manifest merger. For other build systems or for more more
 * information, see {@link com.bumptech.glide.module.GlideModule}. </p>
 */
public class OkHttpGlideModule implements GlideModule {
    @Inject
    OkHttpClient okHttpClient;

    @Override
    public void applyOptions(Context context, GlideBuilder builder) {
        // Do nothing.
    }

    @Override
    public void registerComponents(Context context, Glide glide) {
// Path: app/src/main/java/eu/se_bastiaan/tvnl/TVNLApplication.java
// public class TVNLApplication extends MultiDexApplication {
// 
//     @Nullable
//     private volatile AppInjectionComponent appInjectionComponent;
//     private static TVNLApplication sThis;
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         sThis = this;
// 
//         if(BuildConfig.DEBUG) {
//             Timber.plant(new Timber.DebugTree());
//         } else {
//             //Timber.plant(new CrashlyticsLogTree(Log.INFO));
//         }
// 
//         CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
//                 .setDefaultFontPath("fonts/Regular.ttf")
//                 .setFontAttrId(R.attr.fontPath)
//                 .build()
//         );
// 
//         Intent recommendationIntent = new Intent(this, RecommendationService.class);
//         startService(recommendationIntent);
//     }
// 
//     public static TVNLApplication get() {
//         return sThis;
//     }
// 
//     @NonNull
//     public AppInjectionComponent appComponent() {
//         if (appInjectionComponent == null) {
//             synchronized (Application.class) {
//                 if (appInjectionComponent == null) {
//                     appInjectionComponent = AppInjectionComponent.Initializer.init(this);
//                 }
//             }
//         }
// 
//         //noinspection ConstantConditions
//         return appInjectionComponent;
//     }
// 
// }


// Path: app/src/main/java/eu/se_bastiaan/tvnl/network/glide/OkHttpGlideModule.java
import android.content.Context;
import com.bumptech.glide.Glide;
import com.bumptech.glide.GlideBuilder;
import com.bumptech.glide.load.model.GlideUrl;
import com.bumptech.glide.module.GlideModule;
import java.io.InputStream;
import javax.inject.Inject;
import eu.se_bastiaan.tvnl.TVNLApplication;
import okhttp3.OkHttpClient;

package eu.se_bastiaan.tvnl.network.glide;






/**
 * A {@link com.bumptech.glide.module.GlideModule} implementation to replace Glide's default
 * {@link java.net.HttpURLConnection} based {@link com.bumptech.glide.load.model.ModelLoader}
 * with an OkHttp based {@link com.bumptech.glide.load.model.ModelLoader}.
 * <p/>
 * <p> If you're using gradle, you can include this module simply by depending on the aar, the
 * module will be merged in by manifest merger. For other build systems or for more more
 * information, see {@link com.bumptech.glide.module.GlideModule}. </p>
 */
public class OkHttpGlideModule implements GlideModule {
    @Inject
    OkHttpClient okHttpClient;

    @Override
    public void applyOptions(Context context, GlideBuilder builder) {
        // Do nothing.
    }

    @Override
    public void registerComponents(Context context, Glide glide) {
        TVNLApplication.get().appComponent().inject(this);