feat(eventDetail): Add UI layout

This commit is contained in:
Peter Vacho 2025-01-04 23:28:34 +01:00
parent 8cb1da9e1e
commit bc72deeaf6
Signed by: school
GPG key ID: 8CFC3837052871B4
4 changed files with 189 additions and 2 deletions

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="M480,480q-66,0 -113,-47t-47,-113q0,-66 47,-113t113,-47q66,0 113,47t47,113q0,66 -47,113t-113,47ZM160,800v-112q0,-34 17.5,-62.5T224,582q62,-31 126,-46.5T480,520q66,0 130,15.5T736,582q29,15 46.5,43.5T800,688v112L160,800ZM240,720h480v-32q0,-11 -5.5,-20T700,654q-54,-27 -109,-40.5T480,600q-56,0 -111,13.5T260,654q-9,5 -14.5,14t-5.5,20v32ZM480,400q33,0 56.5,-23.5T560,320q0,-33 -23.5,-56.5T480,240q-33,0 -56.5,23.5T400,320q0,33 23.5,56.5T480,400ZM480,320ZM480,720Z"
android:fillColor="#e8eaed"/>
</vector>

View file

@ -1,10 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
tools:context=".activities.EventDetailsActivity">
<!-- Top Row -->
<LinearLayout
android:id="@+id/topRow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginBottom="8dp"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:background="?android:attr/dividerHorizontal"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<!-- Back Button -->
<ImageButton
android:id="@+id/btnBack"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_arrow_back"
android:contentDescription="@string/back"
app:tint="?android:attr/textColorPrimary" />
<!-- Title -->
<TextView
android:id="@+id/tvTitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="18sp"
android:textStyle="bold"
android:gravity="center"
android:text="@string/event_details"
android:textColor="?android:attr/textColorPrimary" />
</LinearLayout>
<!-- Card View -->
<androidx.cardview.widget.CardView
android:id="@+id/cardEventDetails"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="16dp"
app:cardCornerRadius="8dp"
app:cardElevation="8dp"
app:cardBackgroundColor="?android:attr/colorBackground"
app:layout_constraintTop_toBottomOf="@id/topRow"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintVertical_bias="0.4">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<!-- Event Title -->
<TextView
android:id="@+id/tvEventTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="20sp"
android:textStyle="bold"
android:textColor="?android:attr/textColorPrimary"
android:ellipsize="end"
android:maxLines="2"
tools:text="Event Title" />
<!-- Start Time -->
<TextView
android:id="@+id/tvEventStartTime"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textSize="14sp"
android:textColor="?android:attr/textColorSecondary"
tools:text="Start: 2025-01-04 10:00 AM" />
<!-- End Time -->
<TextView
android:id="@+id/tvEventEndTime"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textSize="14sp"
android:textColor="?android:attr/textColorSecondary"
tools:text="End: 2025-01-04 12:00 PM" />
<!-- Event Description -->
<TextView
android:id="@+id/tvEventDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textSize="14sp"
android:textColor="?android:attr/textColorSecondary"
android:ellipsize="end"
android:maxLines="4"
tools:text="This is a detailed description of the event, including additional information and context." />
<!-- Categories Section -->
<TextView
android:id="@+id/tvEventCategories"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textSize="14sp"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
tools:text="Categories:" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvEventCategories"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
tools:listitem="@layout/item_category_chip"
tools:itemCount="3"
tools:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:orientation="horizontal" />
<!-- Attendees Section -->
<TextView
android:id="@+id/tvEventAttendees"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textSize="14sp"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
tools:text="Attendees:" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvEventAttendees"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
tools:listitem="@layout/item_attendee_chip"
tools:itemCount="3"
tools:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:orientation="horizontal" />
<!-- Created At -->
<TextView
android:id="@+id/tvEventCreatedAt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textSize="12sp"
android:textColor="?android:attr/textColorSecondary"
tools:text="Created on: 2025-01-01 10:00 AM" />
</LinearLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.chip.Chip
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/chipAttendee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:padding="8dp"
android:textColor="?android:attr/textColorPrimary"
app:chipIcon="@drawable/ic_person"
app:chipIconTint="?android:attr/textColorSecondary"
app:closeIconEnabled="false"
app:chipBackgroundColor="@android:color/transparent"
app:chipSurfaceColor="@android:color/transparent"
tools:text="billy" />

View file

@ -84,4 +84,5 @@
<string name="no_categories">No categories found</string>
<string name="categories">Categories</string>
<string name="delete_category">Delete category</string>
<string name="event_details">Event Details</string>
</resources>