/*
 * Copyright 2016 Martin Kamp Jensen
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.github.mkjensen.dml.backend;

import android.content.Context;

import com.bumptech.glide.Glide;
import com.bumptech.glide.integration.okhttp3.OkHttpGlideModule;
import com.bumptech.glide.integration.okhttp3.OkHttpUrlLoader;
import com.bumptech.glide.load.model.GlideUrl;
import com.github.mkjensen.dml.DmlApplication;

import okhttp3.OkHttpClient;

import java.io.InputStream;

import javax.inject.Inject;

/**
 * Extension of {@link OkHttpGlideModule} that supplies the {@link OkHttpClient} via injection.
 *
 * <p>Note that this class is configured for use via the Android manifest file.
 */
public final class DmlOkHttpGlideModule extends OkHttpGlideModule {

  @Inject
  OkHttpClient okHttpClient;

  DmlOkHttpGlideModule() {
    DmlApplication.getInstance().getBackendComponent().inject(this);
  }

  @Override
  public void registerComponents(Context context, Glide glide) {
    glide.register(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(okHttpClient));
  }
}

@@ -1145,18 +1145,23 @@
 s class 
-is
+must be
  configu
@@ -1202,16 +1202,503 @@
 st file.
+ Also note that%0A * %7B@link OkHttpGlideModule%7D must be excluded to avoid conflicts.%0A *%0A * %3Cp%3EConfiguration that must be added to the %7B@code application%7D section of %7B@code%0A * AndroidManifest.xml%7D: %3Cpre%3E%3Ccode%3E%0A * &lt;meta-data%0A *     android:name=%22com.bumptech.glide.integration.okhttp3.OkHttpGlideModule%22%0A *     tools:node=%22remove%22 /&gt;%0A *%0A * &lt;meta-data%0A *     android:name=%22com.github.mkjensen.dml.backend.DmlOkHttpGlideModule%22%0A *     android:value=%22GlideModule%22 /&gt;%0A * %3C/code%3E%3C/pre%3E
 %0A */%0Apub

Improve Javadoc