From 2ca805134c4d5aaa72ae572221ac292677888469 Mon Sep 17 00:00:00 2001 From: sebastian Date: Fri, 1 Nov 2024 19:23:58 +0100 Subject: [PATCH] Show Title and Date in ConcertDetails --- .../gallery/detail/ConcertDetailFragment.java | 23 +++++++++ .../res/layout/fragment_concert_detail.xml | 50 +++++++++++++++---- 2 files changed, 64 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/core/notevault/ui/gallery/detail/ConcertDetailFragment.java b/app/src/main/java/core/notevault/ui/gallery/detail/ConcertDetailFragment.java index 72dd339..fe19fda 100644 --- a/app/src/main/java/core/notevault/ui/gallery/detail/ConcertDetailFragment.java +++ b/app/src/main/java/core/notevault/ui/gallery/detail/ConcertDetailFragment.java @@ -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(); + } } diff --git a/app/src/main/res/layout/fragment_concert_detail.xml b/app/src/main/res/layout/fragment_concert_detail.xml index 6dc1d74..a941fdb 100644 --- a/app/src/main/res/layout/fragment_concert_detail.xml +++ b/app/src/main/res/layout/fragment_concert_detail.xml @@ -1,11 +1,43 @@ - + - - \ No newline at end of file + + + + + + + + + + + + + +