Search in sources :

Example 1 with ImageGridBuilder

use of com.xabber.android.ui.widget.ImageGridBuilder 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

View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 RecyclerView (androidx.recyclerview.widget.RecyclerView)1 Attachment (com.xabber.android.data.database.messagerealm.Attachment)1 ImageGridBuilder (com.xabber.android.ui.widget.ImageGridBuilder)1 RealmList (io.realm.RealmList)1