mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2025-07-17 17:10:30 +03:00
Fix issue #1164 - Custom emojis in bio do not render
This commit is contained in:
parent
6a238d970f
commit
59c05e35fd
3 changed files with 13 additions and 18 deletions
|
@ -82,9 +82,6 @@ import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.Executors;
|
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
import androidmads.library.qrgenearator.QRGContents;
|
import androidmads.library.qrgenearator.QRGContents;
|
||||||
import androidmads.library.qrgenearator.QRGEncoder;
|
import androidmads.library.qrgenearator.QRGEncoder;
|
||||||
|
@ -103,6 +100,7 @@ import app.fedilab.android.mastodon.client.entities.api.Field;
|
||||||
import app.fedilab.android.mastodon.client.entities.api.IdentityProof;
|
import app.fedilab.android.mastodon.client.entities.api.IdentityProof;
|
||||||
import app.fedilab.android.mastodon.client.entities.api.MastodonList;
|
import app.fedilab.android.mastodon.client.entities.api.MastodonList;
|
||||||
import app.fedilab.android.mastodon.client.entities.api.RelationShip;
|
import app.fedilab.android.mastodon.client.entities.api.RelationShip;
|
||||||
|
import app.fedilab.android.mastodon.client.entities.api.Status;
|
||||||
import app.fedilab.android.mastodon.client.entities.app.CachedBundle;
|
import app.fedilab.android.mastodon.client.entities.app.CachedBundle;
|
||||||
import app.fedilab.android.mastodon.client.entities.app.Languages;
|
import app.fedilab.android.mastodon.client.entities.app.Languages;
|
||||||
import app.fedilab.android.mastodon.client.entities.app.Pinned;
|
import app.fedilab.android.mastodon.client.entities.app.Pinned;
|
||||||
|
@ -132,7 +130,6 @@ public class ProfileActivity extends BaseActivity {
|
||||||
private RelationShip relationship;
|
private RelationShip relationship;
|
||||||
private FamiliarFollowers familiarFollowers;
|
private FamiliarFollowers familiarFollowers;
|
||||||
private Account account;
|
private Account account;
|
||||||
private ScheduledExecutorService scheduledExecutorService;
|
|
||||||
private action doAction;
|
private action doAction;
|
||||||
private AccountsVM accountsVM;
|
private AccountsVM accountsVM;
|
||||||
private RecyclerView identityProofsRecycler;
|
private RecyclerView identityProofsRecycler;
|
||||||
|
@ -357,14 +354,7 @@ public class ProfileActivity extends BaseActivity {
|
||||||
this.identityProofList = identityProofs;
|
this.identityProofList = identityProofs;
|
||||||
updateAccount();
|
updateAccount();
|
||||||
});
|
});
|
||||||
//Animate emojis
|
|
||||||
if (account.emojis != null && !account.emojis.isEmpty()) {
|
|
||||||
boolean disableAnimatedEmoji = sharedpreferences.getBoolean(getString(R.string.SET_DISABLE_ANIMATED_EMOJI), false);
|
|
||||||
if (!disableAnimatedEmoji) {
|
|
||||||
scheduledExecutorService = Executors.newSingleThreadScheduledExecutor();
|
|
||||||
scheduledExecutorService.scheduleAtFixedRate(() -> binding.accountDn.invalidate(), 0, 130, TimeUnit.MILLISECONDS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
binding.accountTabLayout.clearOnTabSelectedListeners();
|
binding.accountTabLayout.clearOnTabSelectedListeners();
|
||||||
binding.accountTabLayout.removeAllTabs();
|
binding.accountTabLayout.removeAllTabs();
|
||||||
//Tablayout for timelines/following/followers
|
//Tablayout for timelines/following/followers
|
||||||
|
@ -550,8 +540,15 @@ public class ProfileActivity extends BaseActivity {
|
||||||
});
|
});
|
||||||
binding.accountNote.setText(
|
binding.accountNote.setText(
|
||||||
account.getSpanNote(ProfileActivity.this,
|
account.getSpanNote(ProfileActivity.this,
|
||||||
new WeakReference<>(binding.accountNote)),
|
new WeakReference<>(binding.accountNote), () -> {
|
||||||
|
//TODO: replace this hack
|
||||||
|
binding.accountNote.setText(
|
||||||
|
account.getSpanNote(ProfileActivity.this,
|
||||||
|
new WeakReference<>(binding.accountNote)), TextView.BufferType.SPANNABLE);
|
||||||
|
|
||||||
|
}),
|
||||||
TextView.BufferType.SPANNABLE);
|
TextView.BufferType.SPANNABLE);
|
||||||
|
|
||||||
binding.accountNote.setMovementMethod(LinkMovementMethod.getInstance());
|
binding.accountNote.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
|
|
||||||
|
|
||||||
|
@ -1370,10 +1367,6 @@ public class ProfileActivity extends BaseActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
if (scheduledExecutorService != null) {
|
|
||||||
scheduledExecutorService.shutdownNow();
|
|
||||||
scheduledExecutorService = null;
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
unregisterReceiver(broadcast_data);
|
unregisterReceiver(broadcast_data);
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
|
|
|
@ -112,6 +112,9 @@ public class Account implements Serializable {
|
||||||
public synchronized Spannable getSpanNote(Context context, WeakReference<View> viewWeakReference) {
|
public synchronized Spannable getSpanNote(Context context, WeakReference<View> viewWeakReference) {
|
||||||
return SpannableHelper.convert(context, note, null, this, null, viewWeakReference, null, true, false);
|
return SpannableHelper.convert(context, note, null, this, null, viewWeakReference, null, true, false);
|
||||||
}
|
}
|
||||||
|
public synchronized Spannable getSpanNote(Context context, WeakReference<View> viewWeakReference, Status.Callback callback) {
|
||||||
|
return SpannableHelper.convert(context, note, null, this, null, viewWeakReference, callback, true, false);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(@Nullable Object obj) {
|
public boolean equals(@Nullable Object obj) {
|
||||||
|
|
|
@ -59,7 +59,6 @@ import android.os.Looper;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
|
|
Loading…
Reference in a new issue