Commit 60db57a4 authored by Thomas's avatar Thomas
Browse files

remove weak references

parent 2ff3e103
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1290,7 +1290,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
                if (!isFinishing()) {
                    headerMainBinding.accountName.setText(
                            Helper.getCurrentAccount(BaseMainActivity.this).mastodon_account.getSpanDisplayNameEmoji(BaseMainActivity.this,
                                    new WeakReference<>(headerMainBinding.accountName)),
                                    headerMainBinding.accountName),
                            TextView.BufferType.SPANNABLE);
                }
                float scale = sharedpreferences.getFloat(getString(R.string.SET_FONT_SCALE), 1.1f);
+2 −2
Original line number Diff line number Diff line
@@ -523,7 +523,7 @@ public class ProfileActivity extends BaseActivity {

        binding.accountDn.setText(
                account.getSpanDisplayNameEmoji(ProfileActivity.this,
                        new WeakReference<>(binding.accountDn)),
                        binding.accountDn),
                TextView.BufferType.SPANNABLE);

        binding.accountUn.setText(String.format("@%s", account.acct));
@@ -540,7 +540,7 @@ public class ProfileActivity extends BaseActivity {
        });
        binding.accountNote.setText(
                account.getSpanNote(ProfileActivity.this,
                        new WeakReference<>(binding.accountNote)),
                        binding.accountNote),
                TextView.BufferType.SPANNABLE);

        binding.accountNote.setMovementMethod(LinkMovementMethod.getInstance());
+1 −1
Original line number Diff line number Diff line
@@ -324,7 +324,7 @@ public class AdminAccountActivity extends BaseActivity {

        binding.accountDn.setText(
                adminAccount.account.getSpanDisplayNameEmoji(AdminAccountActivity.this,
                        new WeakReference<>(binding.accountDn)),
                        binding.accountDn),
                TextView.BufferType.SPANNABLE);
        binding.accountUn.setText(String.format("@%s", adminAccount.account.acct));
        binding.accountUn.setOnLongClickListener(v -> {
+1 −1
Original line number Diff line number Diff line
@@ -337,7 +337,7 @@ public class AdminReportActivity extends BaseBarActivity {

        binding.accountDn.setText(
                account.getSpanDisplayNameEmoji(AdminReportActivity.this,
                        new WeakReference<>(binding.accountDn)),
                        binding.accountDn),
                TextView.BufferType.SPANNABLE);
        binding.accountUn.setText(String.format("@%s", account.acct));
        binding.accountUn.setOnLongClickListener(v -> {
+8 −8
Original line number Diff line number Diff line
@@ -91,26 +91,26 @@ public class Account implements Serializable {
    public transient String pronouns = null;


    public synchronized Spannable getSpanDisplayName(Context context, WeakReference<View> viewWeakReference) {
    public synchronized Spannable getSpanDisplayName(Context context, View view) {
        if (display_name == null || display_name.isEmpty()) {
            display_name = username;
        }
        return SpannableHelper.convert(context, display_name, null, this, null, viewWeakReference,  true, false);
        return SpannableHelper.convert(context, display_name, null, this, null, view,  true, false);
    }

    public synchronized Spannable getSpanDisplayNameEmoji(Activity activity, WeakReference<View> viewWeakReference) {
    public synchronized Spannable getSpanDisplayNameEmoji(Activity activity, View view) {
        if (display_name == null || display_name.isEmpty()) {
            display_name = username;
        }
        return SpannableHelper.convertEmoji(activity, display_name, this, viewWeakReference);
        return SpannableHelper.convertEmoji(activity, display_name, this, view);
    }

    public synchronized Spannable getSpanDisplayNameTitle(Context context, WeakReference<View> viewWeakReference, String title) {
        return SpannableHelper.convert(context, title, null, this, null, viewWeakReference,  true, false);
    public synchronized Spannable getSpanDisplayNameTitle(Context context, View view, String title) {
        return SpannableHelper.convert(context, title, null, this, null, view,  true, false);
    }

    public synchronized Spannable getSpanNote(Context context, WeakReference<View> viewWeakReference) {
        return SpannableHelper.convert(context, note, null, this, null, viewWeakReference,  true, false);
    public synchronized Spannable getSpanNote(Context context, View view) {
        return SpannableHelper.convert(context, note, null, this, null, view,  true, false);
    }


Loading