diff --git a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerBodyAdapter.java b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerBodyAdapter.java index 35ebefd5..7bd52ace 100644 --- a/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerBodyAdapter.java +++ b/component/viewer/src/main/java/one/nem/lacerta/component/viewer/ViewerBodyAdapter.java @@ -1,33 +1,48 @@ package one.nem.lacerta.component.viewer; +import android.graphics.Bitmap; +import android.media.Image; import android.view.View; import android.view.ViewGroup; +import android.widget.ImageView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; +import java.util.ArrayList; + public class ViewerBodyAdapter extends RecyclerView.Adapter{ + ArrayList images; + + public ViewerBodyAdapter(ArrayList images){ + this.images = images; + } + @NonNull @Override public ViewerBodyAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { - return null; + View view = View.inflate(parent.getContext(), R.layout.viewer_body_list_item, null); + return new ViewHolder(view); } @Override public void onBindViewHolder(@NonNull ViewerBodyAdapter.ViewHolder holder, int position) { - + holder.image.setImageBitmap(images.get(position)); } @Override public int getItemCount() { - return 0; + return images.size(); } public class ViewHolder extends RecyclerView.ViewHolder{ + ImageView image; + public ViewHolder(@NonNull View itemView) { super(itemView); + image = itemView.findViewById(R.id.imageView); } } }