Fix emoji in names

This commit is contained in:
stom79 2018-09-14 19:12:39 +02:00
parent cbf748ea59
commit 0fc70a9413
5 changed files with 16 additions and 23 deletions

View File

@ -537,7 +537,8 @@ public class Account implements Parcelable {
if( noteSpan != null)
account.setNoteSpan(noteSpan);
account.setFieldsSpan(fieldsSpan);
listener.onRetrieveEmojiAccount(account);
if( listener != null)
listener.onRetrieveEmojiAccount(account);
}
}
});

View File

@ -528,7 +528,7 @@ public class Status implements Parcelable{
final List<Emojis> emojis = status.getReblog() != null ? status.getReblog().getEmojis() : status.getEmojis();
final List<Emojis> emojisAccounts = status.getReblog() != null ?status.getReblog().getAccount().getEmojis():status.getAccount().getEmojis();
status.getAccount().makeEmojisAccount(context, null);
String displayName;
if( status.getReblog() != null){
displayName = Helper.shortnameToUnicode(status.getReblog().getAccount().getDisplay_name(), true);
@ -536,7 +536,6 @@ public class Status implements Parcelable{
}else {
displayName = String.format("@%s",status.getAccount().getAcct());
}
Log.v(Helper.TAG,"displayName: " + displayName);
displayNameSpan = new SpannableString(displayName);
if( emojisAccounts != null)

View File

@ -1056,6 +1056,11 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
@Override
public void onRetrieveEmojiAccount(Account account) {
for( Notification notification: notifications){
if( notification.getAccount().equals(account)){
notifyNotificationChanged(notification);
}
}
}
class ViewHolder extends RecyclerView.ViewHolder {

View File

@ -123,7 +123,7 @@ import static fr.gouv.etalab.mastodon.helper.Helper.getLiveInstance;
* Created by Thomas on 24/04/2017.
* Adapter for Status
*/
public class StatusListAdapter extends RecyclerView.Adapter implements OnPostActionInterface, OnRetrieveFeedsInterface, OnRetrieveEmojiInterface, OnRetrieveRepliesInterface, OnRetrieveCardInterface, OnRetrieveEmojiAccountInterface {
public class StatusListAdapter extends RecyclerView.Adapter implements OnPostActionInterface, OnRetrieveFeedsInterface, OnRetrieveEmojiInterface, OnRetrieveRepliesInterface, OnRetrieveCardInterface {
private Context context;
private List<Status> statuses;
@ -215,10 +215,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
notifyStatusChanged(modifiedStatus.get(0));
}
@Override
public void onRetrieveEmojiAccount(Account account) {
}
private class ViewHolderEmpty extends RecyclerView.ViewHolder{
ViewHolderEmpty(View itemView) {
@ -658,7 +654,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
//-------- END -> Manages translations
status.getAccount().makeEmojisAccount(context, StatusListAdapter.this);
//Displays name & emoji in toot header
final String ppurl;
if( status.getReblog() != null){

View File

@ -91,24 +91,17 @@
android:orientation="vertical">
<TextView
android:id="@+id/status_account_displayname"
android:visibility="gone"
android:maxLines="1"
android:drawablePadding="2dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:textSize="12sp"
android:maxLines="1"
android:ellipsize="end"
android:layout_width="0dp"
android:layout_weight="1"
android:id="@+id/status_account_username"
android:layout_height="wrap_content" />
</LinearLayout>
<TextView
android:textSize="12sp"
android:maxLines="1"
android:ellipsize="end"
android:layout_width="wrap_content"
android:id="@+id/status_account_username"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
<LinearLayout