Using blurred avatar as background. (#532)

Fixing NullPointerException when image isn't loaded yet.

Display country instead of raw language code.

Minor improvements and contrasting color.

First changes.

Co-authored-by: opyale <opyale@noreply.gitea.io>
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
This commit is contained in:
opyale
2020-06-06 22:04:07 +02:00
committed by M M Arif
parent e267aa5100
commit acc55e3433
12 changed files with 371 additions and 225 deletions

View File

@@ -14,16 +14,18 @@ import javax.net.ssl.X509TrustManager;
import okhttp3.OkHttpClient;
/**
* Author anonTree1417
* Author opyale
*/
public class PicassoService {
private static PicassoService picassoService;
private static File cachePath;
private Picasso picasso;
private PicassoService(Context context) {
cachePath = new File(context.getCacheDir() + "/picasso_cache/");
Picasso.Builder builder = new Picasso.Builder(context);
try {
@@ -45,10 +47,6 @@ public class PicassoService {
});
File cachePath = new File(context.getCacheDir() + "/picasso_cache/");
//noinspection ResultOfMethodCallIgnored
cachePath.mkdirs();
picasso = builder.memoryCache(new PicassoCache(cachePath, context)).build();
}
@@ -61,7 +59,9 @@ public class PicassoService {
public Picasso get() {
cachePath.mkdirs();
return picasso;
}
public static synchronized PicassoService getInstance(Context context) {