Make Concert List more Beautiful

This commit is contained in:
sebastian 2024-11-01 15:38:25 +01:00
parent c9b41c9c7e
commit d21a7499fe
3 changed files with 40 additions and 17 deletions

View File

@ -10,6 +10,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
@ -42,6 +43,9 @@ public class GalleryFragment extends Fragment {
recyclerView.setAdapter(concertAdapter);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(), LinearLayoutManager.VERTICAL);
recyclerView.addItemDecoration(dividerItemDecoration);
FloatingActionButton addConcertBtn = root.findViewById(R.id.add_concert_btn);
addConcertBtn.setOnClickListener(v -> onCreateNewConcert());

View File

@ -1,42 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_height="wrap_content" xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal"
android:padding="16dp">
<!-- Linke Seite mit Datum und Titel -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/concert_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:text="Concert Date"
android:textColor="@android:color/darker_gray"
android:text="Concert Date" />
android:textSize="14sp" />
<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:layout_height="wrap_content"
android:text="Concert Title"
android:textSize="18sp" />
</LinearLayout>
<!-- Action Buttons -->
<ImageButton
android:id="@+id/edit_button"
<!-- Abstandshalter, um die Buttons nach rechts zu schieben -->
<Space
android:layout_width="16dp"
android:layout_height="wrap_content" />
<!-- Rechte Seite mit den Buttons -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageButton
android:id="@+id/edit_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:src="@drawable/edit_24dp_e8eaed_fill0_wght400_grad0_opsz24"
app:tint="@color/teal_700"
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:layout_width="48dp"
android:layout_height="48dp"
android:src="@drawable/delete"
app:tint="@color/red"
android:contentDescription="Delete Concert"
android:padding="8dp"
android:background="?android:selectableItemBackgroundBorderless" />
</LinearLayout>
</LinearLayout>

View File

@ -7,4 +7,5 @@
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="red">#FF0000</color>
</resources>