Search in sources :

Example 1 with FilesAdapter

use of com.xabber.android.ui.adapter.FilesAdapter in project xabber-android by redsolution.

the class FileMessageVH method setUpFile.

private void setUpFile(RealmList<Attachment> attachments, Context context) {
    RealmList<Attachment> fileAttachments = new RealmList<>();
    for (Attachment attachment : attachments) {
        if (!attachment.isImage())
            fileAttachments.add(attachment);
    }
    if (fileAttachments.size() > 0) {
        RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(context);
        rvFileList.setLayoutManager(layoutManager);
        FilesAdapter adapter = new FilesAdapter(fileAttachments, this);
        rvFileList.setAdapter(adapter);
        fileLayout.setVisibility(View.VISIBLE);
    }
}
Also used : FilesAdapter(com.xabber.android.ui.adapter.FilesAdapter) RealmList(io.realm.RealmList) Attachment(com.xabber.android.data.database.messagerealm.Attachment) RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager)

Aggregations

LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)1 RecyclerView (androidx.recyclerview.widget.RecyclerView)1 Attachment (com.xabber.android.data.database.messagerealm.Attachment)1 FilesAdapter (com.xabber.android.ui.adapter.FilesAdapter)1 RealmList (io.realm.RealmList)1