From a825ad6a365f326215cd2f5f779788331049976e Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 20 Jan 2024 17:39:21 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=A2=E3=83=80=E3=83=97=E3=82=BF=E5=AE=9F?= =?UTF-8?q?=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/viewer/ViewerBodyAdapter.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) 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); } } }