Include Delete/Edit Buttons in Concert List

This commit is contained in:
sebastian 2024-11-01 15:13:20 +01:00
parent 38e4ca2eed
commit c9b41c9c7e
6 changed files with 53 additions and 4 deletions

View File

@ -30,6 +30,7 @@ public class ConcertAdapter extends RecyclerView.Adapter<ConcertAdapter.ConcertV
@Override
public void onBindViewHolder(@NonNull ConcertViewHolder holder, int position) {
holder.concertTitleView.setText(concertList.get(position).getTitle());
holder.dateHolder.setText(concertList.get(position).getConcertDate());
}
@Override
@ -54,10 +55,12 @@ public class ConcertAdapter extends RecyclerView.Adapter<ConcertAdapter.ConcertV
public class ConcertViewHolder extends RecyclerView.ViewHolder {
TextView concertTitleView;
TextView dateHolder;
public ConcertViewHolder(@NonNull @NotNull View itemView) {
super(itemView);
concertTitleView = itemView.findViewById(R.id.concert_title);
dateHolder = itemView.findViewById(R.id.concert_date);
}
}

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:pathData="M280,840q-33,0 -56.5,-23.5T200,760v-520h-40v-80h200v-40h240v40h200v80h-40v520q0,33 -23.5,56.5T680,840L280,840ZM680,240L280,240v520h400v-520ZM360,680h80v-360h-80v360ZM520,680h80v-360h-80v360ZM280,240v520,-520Z"
android:fillColor="#e8eaed"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:pathData="M200,760h57l391,-391 -57,-57 -391,391v57ZM120,840v-170l528,-527q12,-11 26.5,-17t30.5,-6q16,0 31,6t26,18l55,56q12,11 17.5,26t5.5,30q0,16 -5.5,30.5T817,313L290,840L120,840ZM760,256 L704,200 760,256ZM619,341 L591,312 648,369 619,341Z"
android:fillColor="#e8eaed"/>
</vector>

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed"><path d="M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"/></svg>

Before

Width:  |  Height:  |  Size: 182 B

View File

@ -6,8 +6,37 @@
android:padding="16dp">
<TextView
android:id="@+id/concert_title"
android:layout_width="match_parent"
android:id="@+id/concert_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="@android:color/darker_gray"
android:text="Concert Date" />
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content">
<TextView
android:id="@+id/concert_title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textSize="18sp" />
<!-- Action Buttons -->
<ImageButton
android:id="@+id/edit_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/edit_24dp_e8eaed_fill0_wght400_grad0_opsz24"
android:contentDescription="Edit Concert"
android:padding="8dp"
android:background="?android:selectableItemBackgroundBorderless" />
<ImageButton
android:id="@+id/delete_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/delete"
android:contentDescription="Delete Concert"
android:padding="8dp"
android:background="?android:selectableItemBackgroundBorderless" />
</LinearLayout>
</LinearLayout>

Binary file not shown.