Commit 9ba09c31 authored by Thomas's avatar Thomas
Browse files

Add callback

parent 60db57a4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ dependencies {
    implementation "org.conscrypt:conscrypt-android:2.5.2"
    implementation 'com.vanniktech:emoji-one:0.6.0'
    implementation 'com.github.GrenderG:Toasty:1.5.2'
    implementation "com.github.bumptech.glide:glide:4.14.2"
    implementation "com.github.bumptech.glide:glide:4.16.0"
    implementation "com.github.bumptech.glide:okhttp3-integration:4.14.2"
    implementation("com.github.bumptech.glide:recyclerview-integration:4.14.2") {
        // Excludes the support library because it's already included by Glide.
+6 −1
Original line number Diff line number Diff line
@@ -540,7 +540,12 @@ public class ProfileActivity extends BaseActivity {
        });
        binding.accountNote.setText(
                account.getSpanNote(ProfileActivity.this,
                        binding.accountNote),
                        binding.accountNote, () -> {
                            //TODO: replace this hack
                            binding.accountNote.setText(
                                    account.getSpanNote(ProfileActivity.this, binding.accountNote, null), TextView.BufferType.SPANNABLE);

                        }),
                TextView.BufferType.SPANNABLE);

        binding.accountNote.setMovementMethod(LinkMovementMethod.getInstance());
+4 −4
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ public class Account implements Serializable {
        if (display_name == null || display_name.isEmpty()) {
            display_name = username;
        }
        return SpannableHelper.convert(context, display_name, null, this, null, view,  true, false);
        return SpannableHelper.convert(context, display_name, null, this, null, view,  true, false, null);
    }

    public synchronized Spannable getSpanDisplayNameEmoji(Activity activity, View view) {
@@ -106,11 +106,11 @@ public class Account implements Serializable {
    }

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

    public synchronized Spannable getSpanNote(Context context, View view) {
        return SpannableHelper.convert(context, note, null, this, null, view,  true, false);
    public synchronized Spannable getSpanNote(Context context, View view, SpannableHelper.Callback callback) {
        return SpannableHelper.convert(context, note, null, this, null, view,  true, false, callback);
    }


+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ public class Announcement {


    public synchronized Spannable getSpanContent(Context context, View view) {
        return SpannableHelper.convert(context, content, null, null, this, view,  true, false);
        return SpannableHelper.convert(context, content, null, null, this, view,  true, false, null);
    }

}
+2 −2
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ public class Field implements Serializable {
        if (verified_at != null && value != null) {
            value_span = new ForegroundColorSpan(ContextCompat.getColor(context, R.color.verified_text));
        }
        Spannable spannable = SpannableHelper.convert(context, value, null, account, null, view,  true, false);
        Spannable spannable = SpannableHelper.convert(context, value, null, account, null, view,  true, false, null);
        if (value_span != null && spannable != null) {
            spannable.setSpan(value_span, 0, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
        }
@@ -57,7 +57,7 @@ public class Field implements Serializable {

    public synchronized Spannable getLabelSpan(Context context, Account account, View view) {

        Spannable spannable = SpannableHelper.convert(context, name, null, account, null, view,  true, false);
        Spannable spannable = SpannableHelper.convert(context, name, null, account, null, view,  true, false, null);
        if (name_span != null && spannable != null) {
            spannable.setSpan(name_span, 0, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
        }
Loading