diff --git a/app/src/main/java/app/fedilab/android/BaseMainActivity.java b/app/src/main/java/app/fedilab/android/BaseMainActivity.java index 26f340980..0c9f6cae1 100644 --- a/app/src/main/java/app/fedilab/android/BaseMainActivity.java +++ b/app/src/main/java/app/fedilab/android/BaseMainActivity.java @@ -112,6 +112,7 @@ import app.fedilab.android.databinding.ActivityMainBinding; import app.fedilab.android.databinding.NavHeaderMainBinding; import app.fedilab.android.exception.DBException; import app.fedilab.android.helper.Helper; +import app.fedilab.android.helper.MastodonHelper; import app.fedilab.android.helper.PinnedTimelineHelper; import app.fedilab.android.helper.PushHelper; import app.fedilab.android.helper.ThemeHelper; @@ -652,20 +653,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt } headerMainBinding.accountName.setText(account.mastodon_account.display_name); Helper.loadPP(headerMainBinding.accountProfilePicture, account); - Glide.with(BaseMainActivity.this) - .load(account.mastodon_account.header) - .apply(new RequestOptions().transform(new CenterCrop())) - .into(new CustomTarget() { - @Override - public void onResourceReady(@NonNull Drawable resource, @Nullable Transition transition) { - headerMainBinding.backGroundImage.setBackground(resource); - } - - @Override - public void onLoadCleared(@Nullable Drawable placeholder) { - - } - }); + MastodonHelper.loadProfileMediaMastodon(headerMainBinding.backgroundImage, account.mastodon_account, MastodonHelper.MediaAccountType.HEADER); /* * Some general data are loaded when the app starts such; * - Instance info (for limits) diff --git a/app/src/main/res/layout/nav_header_main.xml b/app/src/main/res/layout/nav_header_main.xml index 67209766e..276a84b38 100644 --- a/app/src/main/res/layout/nav_header_main.xml +++ b/app/src/main/res/layout/nav_header_main.xml @@ -5,8 +5,6 @@ android:layout_height="@dimen/nav_header_height" android:theme="@style/ThemeOverlay.AppCompat.Dark"> - - + +