Some cleaning
This commit is contained in:
parent
d2e5720e35
commit
328d32237b
|
@ -1,30 +1,26 @@
|
|||
package fr.gouv.etalab.mastodon.client;
|
||||
package fr.gouv.etalab.mastodon.client.Glide;
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
import android.util.Log;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.Priority;
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.data.DataFetcher;
|
||||
import com.bumptech.glide.load.model.GlideUrl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import fr.gouv.etalab.mastodon.helper.Helper;
|
||||
import fr.gouv.etalab.mastodon.client.HttpsConnection;
|
||||
|
||||
/**
|
||||
* Created by Thomas on 13/12/2017.
|
||||
* Custom stream fetcher which will use getPicture from HttpsConnection to get the inputstream
|
||||
*/
|
||||
|
||||
public class CustomStreamFetcher implements DataFetcher<InputStream> {
|
||||
|
||||
private GlideUrl url;
|
||||
|
||||
public CustomStreamFetcher(GlideUrl url) {
|
||||
CustomStreamFetcher(GlideUrl url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
|
@ -1,23 +1,19 @@
|
|||
package fr.gouv.etalab.mastodon.client;
|
||||
package fr.gouv.etalab.mastodon.client.Glide;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.util.Log;
|
||||
|
||||
import com.bumptech.glide.load.Options;
|
||||
import com.bumptech.glide.load.model.GlideUrl;
|
||||
import com.bumptech.glide.load.model.ModelLoader;
|
||||
import com.bumptech.glide.load.model.ModelLoaderFactory;
|
||||
import com.bumptech.glide.load.model.MultiModelLoaderFactory;
|
||||
import com.bumptech.glide.load.model.stream.UrlLoader;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import fr.gouv.etalab.mastodon.helper.Helper;
|
||||
|
||||
|
||||
/**
|
||||
* Created by Thomas on 13/12/2017.
|
||||
* Custom UrlLoader
|
||||
*/
|
||||
|
||||
public class HttpsUrlLoader implements ModelLoader<GlideUrl, InputStream> {
|
||||
|
@ -42,12 +38,10 @@ public class HttpsUrlLoader implements ModelLoader<GlideUrl, InputStream> {
|
|||
|
||||
public static class Factory implements ModelLoaderFactory<GlideUrl, InputStream> {
|
||||
|
||||
|
||||
@Override
|
||||
public ModelLoader<GlideUrl, InputStream> build(MultiModelLoaderFactory multiFactory) {
|
||||
return new HttpsUrlLoader();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void teardown() {
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
package fr.gouv.etalab.mastodon.client;
|
||||
package fr.gouv.etalab.mastodon.client.Glide;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.GlideBuilder;
|
||||
|
@ -12,10 +11,9 @@ import com.bumptech.glide.annotation.GlideModule;
|
|||
|
||||
import java.io.InputStream;
|
||||
|
||||
import fr.gouv.etalab.mastodon.helper.Helper;
|
||||
|
||||
/**
|
||||
* Created by Thomas on 13/12/2017.
|
||||
* Glide Module to handle https connections with TLSSocketFactory
|
||||
*/
|
||||
|
||||
@GlideModule
|
Loading…
Reference in New Issue