Show Title and Date in ConcertDetails

This commit is contained in:
sebastian 2024-11-01 19:23:58 +01:00
parent 252320d07b
commit 2ca805134c
2 changed files with 64 additions and 9 deletions

View File

@ -1,6 +1,29 @@
package core.notevault.ui.gallery.detail;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import core.notevault.data.Concert;
import core.notevault.databinding.FragmentConcertDetailBinding;
public class ConcertDetailFragment extends Fragment {
private FragmentConcertDetailBinding binding;
private Concert concert;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
binding = FragmentConcertDetailBinding.inflate(inflater, container, false);
int concertId = getArguments().getInt("concertID");
String concertTitle = getArguments().getString("concertTitle");
String concertDate = getArguments().getString("concertDate");
concert = new Concert(concertId, concertTitle, concertDate);
binding.textConcertDetailsTitle.setText(concertTitle);
binding.textConcertDetailsDate.setText(concertDate);
return binding.getRoot();
}
}

View File

@ -1,11 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
app:cardCornerRadius="8dp"
app:cardElevation="4dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="16dp">
<TextView
android:text="TextView"
android:id="@+id/text_concert_details_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Konzerttitel"
android:textSize="18sp"
android:textStyle="bold"/>
<TextView
android:id="@+id/text_concert_details_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/textView2" tools:layout_editor_absoluteY="313dp"
tools:layout_editor_absoluteX="372dp"/>
</androidx.constraintlayout.widget.ConstraintLayout>
android:layout_height="wrap_content"
android:text="01.01.2024"
android:textSize="16sp"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
<!-- Hier können weitere Details hinzugefügt werden -->
</LinearLayout>