From 56ee296be300dd3b45b79b536e5471313c51798c Mon Sep 17 00:00:00 2001 From: stom79 Date: Thu, 3 Jan 2019 10:42:44 +0100 Subject: [PATCH] Fix avatar issue in quick menu switcher #689 --- .../main/java/fr/gouv/etalab/mastodon/helper/Helper.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java b/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java index 18048085b..311c3d753 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java @@ -1502,6 +1502,8 @@ public class Helper { SharedPreferences mSharedPreferences = activity.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE); String currrentUserId = mSharedPreferences.getString(Helper.PREF_KEY_ID, null); for(final Account accountChoice: accounts) { + if( !accountChoice.getAvatar().startsWith("http")) + accountChoice.setAvatar("https://" + accountChoice.getInstance() + accountChoice.getAvatar()); if (currrentUserId != null && !currrentUserId.equals(accountChoice.getId())) { icon = new ImageView(activity); ImageView finalIcon = icon; @@ -1552,7 +1554,9 @@ public class Helper { for(final Account accountChoice: accounts) { if (currrentUserId != null && !currrentUserId.equals(accountChoice.getId())) { SubActionButton.Builder itemBuilderAcc = new SubActionButton.Builder(activity); - + if( !accountChoice.getAvatar().startsWith("http")) + accountChoice.setAvatar("https://" + accountChoice.getInstance() + accountChoice.getAvatar()); + Log.v(Helper.TAG,"avatar: " + accountChoice.getAvatar()); ImageView itemIconAcc = new ImageView(activity); Glide.with(activity.getApplicationContext()) .asBitmap()