diff --git a/app/src/main/java/com/p_vacho/neat_calendar/activities/NotificationsActivity.kt b/app/src/main/java/com/p_vacho/neat_calendar/activities/NotificationsActivity.kt index 8c629d6..fa9ecc7 100644 --- a/app/src/main/java/com/p_vacho/neat_calendar/activities/NotificationsActivity.kt +++ b/app/src/main/java/com/p_vacho/neat_calendar/activities/NotificationsActivity.kt @@ -72,6 +72,9 @@ class NotificationsActivity : AppCompatActivity() { NotificationAdapter.Action.DECLINE -> { //TODO("Handle decline action") } + NotificationAdapter.Action.VIEW_EVENT -> { + //TODO("Handle viewing the event") + } } } diff --git a/app/src/main/java/com/p_vacho/neat_calendar/adapters/NotificationAdapter.kt b/app/src/main/java/com/p_vacho/neat_calendar/adapters/NotificationAdapter.kt index be479fd..d1207f5 100644 --- a/app/src/main/java/com/p_vacho/neat_calendar/adapters/NotificationAdapter.kt +++ b/app/src/main/java/com/p_vacho/neat_calendar/adapters/NotificationAdapter.kt @@ -3,6 +3,7 @@ package com.p_vacho.neat_calendar.adapters import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import android.widget.Button import android.widget.ImageButton import android.widget.TextView import androidx.recyclerview.widget.RecyclerView @@ -16,13 +17,14 @@ class NotificationAdapter( ) : RecyclerView.Adapter() { enum class Action { - ACCEPT, DECLINE + ACCEPT, DECLINE, VIEW_EVENT } inner class NotificationViewHolder(view: View) : RecyclerView.ViewHolder(view) { val message: TextView = view.findViewById(R.id.notificationMessage) val acceptButton: ImageButton = view.findViewById(R.id.acceptButton) val declineButton: ImageButton = view.findViewById(R.id.declineButton) + val viewEventButton: ImageButton = view.findViewById(R.id.viewEventButton) val invitationActions: View = view.findViewById(R.id.invitationActions) val unreadIndicator: View = view.findViewById(R.id.notificationIndicator) } @@ -50,6 +52,9 @@ class NotificationAdapter( holder.declineButton.setOnClickListener { onActionClick(notification, Action.DECLINE, position) } + holder.viewEventButton.setOnClickListener { + onActionClick(notification, Action.VIEW_EVENT, position) + } } else { holder.invitationActions.visibility = View.GONE } diff --git a/app/src/main/res/layout/item_notification.xml b/app/src/main/res/layout/item_notification.xml index 1ddd245..f126b8a 100644 --- a/app/src/main/res/layout/item_notification.xml +++ b/app/src/main/res/layout/item_notification.xml @@ -66,5 +66,15 @@ android:src="@drawable/ic_close" android:contentDescription="@string/decline" app:tint="@android:color/holo_red_dark" /> + +