Make Concert List more Beautiful
This commit is contained in:
parent
c9b41c9c7e
commit
d21a7499fe
@ -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());
|
||||
|
@ -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">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/concert_date"
|
||||
android:layout_width="wrap_content"
|
||||
<!-- Linke Seite mit Datum und Titel -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@android:color/darker_gray"
|
||||
android:text="Concert Date" />
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/concert_date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Concert Date"
|
||||
android:textColor="@android:color/darker_gray"
|
||||
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>
|
||||
|
||||
<!-- 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">
|
||||
|
||||
<!-- Action Buttons -->
|
||||
<ImageButton
|
||||
android:id="@+id/edit_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
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>
|
||||
|
@ -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>
|
Loading…
Reference in New Issue
Block a user