mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 00:59:49 +01:00
Remove thumbnails from the AttachmentDatabase.
Glide can do everything for us now, including video thumbnails.
This commit is contained in:
@@ -14,7 +14,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import org.thoughtcrime.securesms.attachments.Attachment;
|
||||
import org.thoughtcrime.securesms.attachments.AttachmentId;
|
||||
import org.thoughtcrime.securesms.attachments.UriAttachment;
|
||||
import org.thoughtcrime.securesms.blurhash.BlurHash;
|
||||
import org.thoughtcrime.securesms.database.AttachmentDatabase;
|
||||
import org.thoughtcrime.securesms.util.JsonUtils;
|
||||
import org.thoughtcrime.securesms.util.MediaUtil;
|
||||
@@ -648,7 +647,7 @@ public class Contact implements Parcelable {
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeParcelable(attachment != null ? attachment.getDataUri() : null, flags);
|
||||
dest.writeParcelable(attachment != null ? attachment.getUri() : null, flags);
|
||||
dest.writeByte((byte) (isProfile ? 1 : 0));
|
||||
}
|
||||
|
||||
|
||||
@@ -215,7 +215,7 @@ class ContactFieldAdapter extends RecyclerView.Adapter<ContactFieldAdapter.Conta
|
||||
Field(@NonNull Avatar avatar) {
|
||||
this.value = "";
|
||||
this.iconResId = R.drawable.baseline_account_circle_white_24;
|
||||
this.iconUri = avatar.getAttachment() != null ? avatar.getAttachment().getDataUri() : null;
|
||||
this.iconUri = avatar.getAttachment() != null ? avatar.getAttachment().getUri() : null;
|
||||
this.maxLines = 1;
|
||||
this.selectable = avatar;
|
||||
this.label = "";
|
||||
|
||||
@@ -186,11 +186,11 @@ public final class ContactUtil {
|
||||
intent.putExtra(ContactsContract.Intents.Insert.POSTAL_TYPE, getSystemType(contact.getPostalAddresses().get(0).getType()));
|
||||
}
|
||||
|
||||
if (contact.getAvatarAttachment() != null && contact.getAvatarAttachment().getDataUri() != null) {
|
||||
if (contact.getAvatarAttachment() != null && contact.getAvatarAttachment().getUri() != null) {
|
||||
try {
|
||||
ContentValues values = new ContentValues();
|
||||
values.put(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.Photo.CONTENT_ITEM_TYPE);
|
||||
values.put(ContactsContract.CommonDataKinds.Photo.PHOTO, Util.readFully(PartAuthority.getAttachmentStream(context, contact.getAvatarAttachment().getDataUri())));
|
||||
values.put(ContactsContract.CommonDataKinds.Photo.PHOTO, Util.readFully(PartAuthority.getAttachmentStream(context, contact.getAvatarAttachment().getUri())));
|
||||
|
||||
ArrayList<ContentValues> valuesArray = new ArrayList<>(1);
|
||||
valuesArray.add(values);
|
||||
|
||||
@@ -96,7 +96,7 @@ public class SharedContactDetailsActivity extends PassphraseRequiredActivity {
|
||||
|
||||
presentContact(contact);
|
||||
presentActionButtons(ContactUtil.getRecipients(this, contact));
|
||||
presentAvatar(contact.getAvatarAttachment() != null ? contact.getAvatarAttachment().getDataUri() : null);
|
||||
presentAvatar(contact.getAvatarAttachment() != null ? contact.getAvatarAttachment().getUri() : null);
|
||||
|
||||
for (LiveRecipient recipient : activeRecipients.values()) {
|
||||
recipient.observe(this, r -> presentActionButtons(Collections.singletonList(r.getId())));
|
||||
|
||||
Reference in New Issue
Block a user