Update blocked contact list item on main thread.

Fixes #3825
// FREEBIE
This commit is contained in:
Moxie Marlinspike 2015-07-28 14:19:28 -07:00
parent 98393ba2e1
commit e88a7c3fd7

View File

@ -8,6 +8,7 @@ import android.widget.TextView;
import org.thoughtcrime.securesms.R; import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.components.AvatarImageView; import org.thoughtcrime.securesms.components.AvatarImageView;
import org.thoughtcrime.securesms.recipients.Recipients; import org.thoughtcrime.securesms.recipients.Recipients;
import org.thoughtcrime.securesms.util.Util;
public class BlockedContactListItem extends RelativeLayout implements Recipients.RecipientsModifiedListener { public class BlockedContactListItem extends RelativeLayout implements Recipients.RecipientsModifiedListener {
@ -42,9 +43,17 @@ public class BlockedContactListItem extends RelativeLayout implements Recipients
} }
@Override @Override
public void onModified(Recipients recipients) { public void onModified(final Recipients recipients) {
this.contactPhotoImage.setAvatar(recipients, false); final AvatarImageView contactPhotoImage = this.contactPhotoImage;
this.nameView.setText(recipients.toShortString()); final TextView nameView = this.nameView;
Util.runOnMain(new Runnable() {
@Override
public void run() {
contactPhotoImage.setAvatar(recipients, false);
nameView.setText(recipients.toShortString());
}
});
} }
public Recipients getRecipients() { public Recipients getRecipients() {