実装テスト

This commit is contained in:
r-ca 2023-12-18 01:29:22 +09:00
parent 8f4ffb4731
commit 81053009e0
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9
2 changed files with 24 additions and 5 deletions

View File

@ -1,18 +1,25 @@
package one.nem.lacerta.feature.debug.common.adapter; package one.nem.lacerta.feature.debug.common.adapter;
import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import java.util.List; import java.util.List;
import one.nem.lacerta.feature.debug.R;
import one.nem.lacerta.feature.debug.common.model.DebugMenuDocumentListItem; import one.nem.lacerta.feature.debug.common.model.DebugMenuDocumentListItem;
public class DebugMenuDocumentListItemAdapter extends RecyclerView.Adapter<DebugMenuDocumentListItemAdapter.DebugMenuDocumentListItemViewHolder> { public class DebugMenuDocumentListItemAdapter extends RecyclerView.Adapter<DebugMenuDocumentListItemAdapter.DebugMenuDocumentListItemViewHolder> {
private List<DebugMenuDocumentListItem> debugMenuDocumentListItems; private List<DebugMenuDocumentListItem> debugMenuDocumentListItems;
public DebugMenuDocumentListItemAdapter(List<DebugMenuDocumentListItem> debugMenuDocumentListItems) {
this.debugMenuDocumentListItems = debugMenuDocumentListItems;
}
@NonNull @NonNull
@Override @Override
public DebugMenuDocumentListItemAdapter.DebugMenuDocumentListItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { public DebugMenuDocumentListItemAdapter.DebugMenuDocumentListItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
@ -30,5 +37,17 @@ public class DebugMenuDocumentListItemAdapter extends RecyclerView.Adapter<Debug
} }
public class DebugMenuDocumentListItemViewHolder extends RecyclerView.ViewHolder { public class DebugMenuDocumentListItemViewHolder extends RecyclerView.ViewHolder {
TextView title;
TextView description;
TextView updatedAt;
public DebugMenuDocumentListItemViewHolder(@NonNull View itemView) {
super(itemView);
title = itemView.findViewById(R.id.document_list_item_title);
description = itemView.findViewById(R.id.document_list_item_description);
updatedAt = itemView.findViewById(R.id.document_list_item_updated_at);
}
} }
} }

View File

@ -6,28 +6,28 @@
android:padding="16dp"> android:padding="16dp">
<TextView <TextView
android:id="@+id/item_title" android:id="@+id/document_list_item_title"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="16sp" android:textSize="16sp"
android:text="TITLE" android:text="TITLE"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/item_updated_at" app:layout_constraintEnd_toStartOf="@id/document_list_item_updated_at"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/item_description" android:id="@+id/document_list_item_description"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="14sp" android:textSize="14sp"
android:text="DESCRIPTION" android:text="DESCRIPTION"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/item_title" /> app:layout_constraintTop_toBottomOf="@+id/document_list_item_title" />
<TextView <TextView
android:id="@+id/item_updated_at" android:id="@+id/document_list_item_updated_at"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="14sp" android:textSize="14sp"