Commit f8aeada6 authored by Thomas's avatar Thomas
Browse files

Some fixes

parent 7b3b0a9a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -612,7 +612,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
                binding.profilePicture.setOnClickListener(v -> binding.drawerLayout.openDrawer(GravityCompat.START));
                Helper.loadPP(binding.profilePicture, currentAccount);
                headerMainBinding.accountAcc.setText(String.format("%s@%s", currentAccount.mastodon_account.username, currentAccount.instance));
                if (currentAccount.mastodon_account.display_name.isEmpty()) {
                if (currentAccount.mastodon_account.display_name == null || currentAccount.mastodon_account.display_name.isEmpty()) {
                    currentAccount.mastodon_account.display_name = currentAccount.mastodon_account.acct;
                }
                headerMainBinding.accountName.setText(currentAccount.mastodon_account.display_name);
+1 −1
Original line number Diff line number Diff line
@@ -348,7 +348,7 @@ public class ProfileActivity extends BaseActivity {
            binding.accountMoved.setText(spannableString, TextView.BufferType.SPANNABLE);
            binding.accountMoved.setMovementMethod(LinkMovementMethod.getInstance());
        }
        if (account.acct.contains("@"))
        if (account.acct != null && account.acct.contains("@"))
            binding.warningMessage.setVisibility(View.VISIBLE);
        else
            binding.warningMessage.setVisibility(View.GONE);
+18 −9
Original line number Diff line number Diff line
@@ -1032,6 +1032,7 @@ public class Helper {
        SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context);
        boolean disableGif = sharedpreferences.getBoolean(context.getString(R.string.SET_DISABLE_GIF), false);
        String targetedUrl = disableGif ? account.mastodon_account.avatar_static : account.mastodon_account.avatar;
        if (targetedUrl != null) {
            if (disableGif || (!targetedUrl.endsWith(".gif"))) {
                Glide.with(view.getContext())
                        .asDrawable()
@@ -1047,6 +1048,14 @@ public class Helper {
                        .apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10)))
                        .into(view);
            }
        } else {
            Glide.with(view.getContext())
                    .asDrawable()
                    .load(R.drawable.ic_person)
                    .thumbnail(0.1f)
                    .apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10)))
                    .into(view);
        }
    }