Compare commits
No commits in common. "bc72deeaf68a5546600eaa3fac4e469610d83040" and "354e00487a1c2bb3234819e4d3bd1fa023e2a639" have entirely different histories.
bc72deeaf6
...
354e00487a
|
@ -16,9 +16,6 @@
|
|||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.NeatCalendar"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".activities.EventDetailsActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activities.CreateCategoryActivity"
|
||||
android:exported="false" />
|
||||
|
|
|
@ -92,8 +92,7 @@ class DayViewActivity : AppCompatActivity() {
|
|||
rvEvents.layoutManager = LinearLayoutManager(this)
|
||||
rvEvents.adapter = EventCardAdapter(
|
||||
events, userId, this,
|
||||
::onEventEdit, ::onEventDelete, ::onEventLeave,
|
||||
::onEventInvite, ::onEventClick,
|
||||
::onEventEdit, ::onEventDelete, ::onEventLeave, ::onEventInvite,
|
||||
)
|
||||
|
||||
btnBack.setOnClickListener { finish() }
|
||||
|
@ -187,13 +186,6 @@ class DayViewActivity : AppCompatActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is triggered on a click anywhere on the event card.
|
||||
*/
|
||||
private fun onEventClick(event: EventResponse, position: Int) {
|
||||
navigateToEventDetails(event)
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggered with the CreateEventActivity return value.
|
||||
*/
|
||||
|
@ -238,16 +230,4 @@ class DayViewActivity : AppCompatActivity() {
|
|||
}
|
||||
.show()
|
||||
}
|
||||
|
||||
/**
|
||||
* Navigate to the event details activity, passing it over the event data to show.
|
||||
*
|
||||
* This is used to allow user to see all the event details, not just those on the
|
||||
* card, which are often truncated and miss some details.
|
||||
*/
|
||||
private fun navigateToEventDetails(event: EventResponse) {
|
||||
val intent = Intent(this, EventDetailsActivity::class.java)
|
||||
intent.putExtra("event", event)
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
package com.p_vacho.neat_calendar.activities
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import com.p_vacho.neat_calendar.R
|
||||
import com.p_vacho.neat_calendar.api.models.EventResponse
|
||||
|
||||
class EventDetailsActivity : AppCompatActivity() {
|
||||
private lateinit var event: EventResponse
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
enableEdgeToEdge()
|
||||
setContentView(R.layout.activity_event_details)
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
|
||||
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
|
||||
insets
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
event = intent.getParcelableExtra<EventResponse>("event")!!
|
||||
}
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
package com.p_vacho.neat_calendar.activities
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
|
@ -284,28 +283,12 @@ class NotificationsActivity : AppCompatActivity() {
|
|||
}
|
||||
}
|
||||
NotificationAdapter.Action.VIEW_EVENT -> {
|
||||
val invitation = invitations[notification.data]!!
|
||||
val event = events[invitation.event_id]!!
|
||||
|
||||
navigateToEventDetails(event)
|
||||
|
||||
// Also mark the notification as read after the interaction
|
||||
// TODO: Handle viewing the event
|
||||
if (!notification.read) handleNotificationClick(notification, position, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Navigate to the event details activity, passing it over the event data to show.
|
||||
*
|
||||
* This is used to allow user to preview the event they were invited to.
|
||||
*/
|
||||
private fun navigateToEventDetails(event: EventResponse) {
|
||||
val intent = Intent(this, EventDetailsActivity::class.java)
|
||||
intent.putExtra("event", event)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
/**
|
||||
* A callback function passed to the Notification Adapter, triggered by clicking on the notification
|
||||
* itself. This should mark the notification as read.
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.p_vacho.neat_calendar.adapters
|
||||
|
||||
import android.graphics.Color
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
|
|
|
@ -34,7 +34,6 @@ class EventCardAdapter(
|
|||
private val onDeleteEvent: (EventResponse, Int) -> Unit,
|
||||
private val onLeaveEvent: (EventResponse, Int) -> Unit,
|
||||
private val onInviteEvent: (EventResponse, Int) -> Unit,
|
||||
private val onEventClick: (EventResponse, Int) -> Unit,
|
||||
) :
|
||||
RecyclerView.Adapter<EventCardAdapter.EventViewHolder>() {
|
||||
|
||||
|
@ -94,12 +93,6 @@ class EventCardAdapter(
|
|||
// Fetch categories dynamically
|
||||
fetchAndBindCategories(event.id, holder)
|
||||
}
|
||||
|
||||
// Set click listener for the whole event card
|
||||
holder.itemView.isClickable = true
|
||||
holder.itemView.setOnClickListener {
|
||||
onEventClick(event, position)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = events.size
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
<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>
|
|
@ -1,9 +0,0 @@
|
|||
<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="M856,570 L570,856q-12,12 -27,18t-30,6q-15,0 -30,-6t-27,-18L103,503q-11,-11 -17,-25.5T80,447v-287q0,-33 23.5,-56.5T160,80h287q16,0 31,6.5t26,17.5l352,353q12,12 17.5,27t5.5,30q0,15 -5.5,29.5T856,570ZM513,800l286,-286 -353,-354L160,160v286l353,354ZM260,320q25,0 42.5,-17.5T320,260q0,-25 -17.5,-42.5T260,200q-25,0 -42.5,17.5T200,260q0,25 17.5,42.5T260,320ZM480,480Z"
|
||||
android:fillColor="#e8eaed"/>
|
||||
</vector>
|
|
@ -1,170 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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>
|
|
@ -1,17 +0,0 @@
|
|||
<?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" />
|
|
@ -1,59 +1,50 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView
|
||||
<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:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="4dp"
|
||||
app:cardBackgroundColor="?android:attr/colorBackground">
|
||||
android:padding="8dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
<!-- Color Indicator -->
|
||||
<View
|
||||
android:id="@+id/colorIndicator"
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/holo_blue_dark"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!-- Category Name -->
|
||||
<TextView
|
||||
android:id="@+id/tvCategoryName"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp">
|
||||
android:textSize="16sp"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
tools:text="Work"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/colorIndicator"
|
||||
app:layout_constraintEnd_toStartOf="@id/btnDeleteCategory" />
|
||||
|
||||
<!-- Vertical Color Indicator -->
|
||||
<View
|
||||
android:id="@+id/colorIndicator"
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@android:color/holo_blue_dark"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
<!-- Delete Button -->
|
||||
<ImageButton
|
||||
android:id="@+id/btnDeleteCategory"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:src="@drawable/ic_trashbin"
|
||||
android:contentDescription="@string/delete_category"
|
||||
app:tint="?android:attr/textColorSecondary"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<!-- Category Name -->
|
||||
<TextView
|
||||
android:id="@+id/tvCategoryName"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
tools:text="Work"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/colorIndicator"
|
||||
app:layout_constraintEnd_toStartOf="@id/btnDeleteCategory" />
|
||||
|
||||
<!-- Delete Button -->
|
||||
<ImageButton
|
||||
android:id="@+id/btnDeleteCategory"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:src="@drawable/ic_trashbin"
|
||||
android:contentDescription="@string/delete_category"
|
||||
app:tint="?android:attr/textColorSecondary"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
|
@ -1,22 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.chip.Chip
|
||||
<TextView
|
||||
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/chipCategory"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:background="@drawable/bg_category_chip"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:textSize="12sp"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
app:chipIcon="@drawable/ic_tag"
|
||||
app:chipIconTint="?android:attr/textColorSecondary"
|
||||
app:chipBackgroundColor="@android:color/transparent"
|
||||
app:chipSurfaceColor="@android:color/transparent"
|
||||
app:chipStrokeColor="@android:color/holo_blue_dark"
|
||||
app:closeIconEnabled="false"
|
||||
android:backgroundTint="@android:color/holo_blue_dark"
|
||||
tools:text="Work" />
|
||||
|
|
|
@ -84,5 +84,4 @@
|
|||
<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>
|
Loading…
Reference in a new issue