Search in sources :

Example 31 with Attachment

use of com.xabber.android.data.database.messagerealm.Attachment in project xabber-android by redsolution.

the class FileMessageVH method setUpImage.

private void setUpImage(RealmList<Attachment> attachments) {
    final ImageGridBuilder gridBuilder = new ImageGridBuilder();
    if (!SettingsManager.connectionLoadImages())
        return;
    RealmList<Attachment> imageAttachments = new RealmList<>();
    for (Attachment attachment : attachments) {
        if (attachment.isImage())
            imageAttachments.add(attachment);
    }
    if (imageAttachments.size() > 0) {
        View imageGridView = gridBuilder.inflateView(imageGridContainer, imageAttachments.size());
        gridBuilder.bindView(imageGridView, imageAttachments, this);
        imageGridContainer.addView(imageGridView);
        imageGridContainer.setVisibility(View.VISIBLE);
    }
}
Also used : RealmList(io.realm.RealmList) Attachment(com.xabber.android.data.database.messagerealm.Attachment) ImageGridBuilder(com.xabber.android.ui.widget.ImageGridBuilder) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView)

Aggregations

Attachment (com.xabber.android.data.database.messagerealm.Attachment)31 RealmList (io.realm.RealmList)8 MessageItem (com.xabber.android.data.database.messagerealm.MessageItem)7 Realm (io.realm.Realm)6 File (java.io.File)5 ImageView (android.widget.ImageView)4 ForwardId (com.xabber.android.data.database.messagerealm.ForwardId)4 UserJid (com.xabber.android.data.entity.UserJid)4 View (android.view.View)3 TextView (android.widget.TextView)3 RecyclerView (androidx.recyclerview.widget.RecyclerView)3 RefUser (com.xabber.android.data.extension.references.RefUser)3 Date (java.util.Date)3 Message (org.jivesoftware.smack.packet.Message)3 Resourcepart (org.jxmpp.jid.parts.Resourcepart)3 Intent (android.content.Intent)2 Drawable (android.graphics.drawable.Drawable)2 AccountJid (com.xabber.android.data.entity.AccountJid)2 MUCUser (org.jivesoftware.smackx.muc.packet.MUCUser)2 ActivityNotFoundException (android.content.ActivityNotFoundException)1