From 0ae481ee4ac790e39f325582033e247341c4cae9 Mon Sep 17 00:00:00 2001 From: Sergio De la torre Date: Mon, 15 Apr 2024 08:56:31 +0200 Subject: [PATCH] refs #6921 feat:deliveryNotes --- .../delivery/adapters/TicketAdapter.kt | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/adapters/TicketAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/adapters/TicketAdapter.kt index 7ff73474..badb9833 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/adapters/TicketAdapter.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/adapters/TicketAdapter.kt @@ -1,5 +1,7 @@ package es.verdnatura.presentation.view.feature.delivery.adapters +import android.graphics.Color +import android.graphics.PorterDuff import android.view.LayoutInflater import android.view.View.INVISIBLE import android.view.ViewGroup @@ -75,23 +77,23 @@ class TicketAdapter( binding.apply { if (!item.ticketObservation.isNullOrEmpty()) { - note.setColorFilter( - ContextCompat.getColor( - note.context, R.color.verdnatura_dark_sky_blue - ) - ) - } else { note.setColorFilter( ContextCompat.getColor( note.context, R.color.verdnatura_white ) ) + note.setOnClickListener { + onItemButtonTicketRowClickListener.onItemButtonTicketRowClickListener( + item, "note" + ) + } + } else { + note.alpha = 0.5f + note.setColorFilter(Color.GRAY, PorterDuff.Mode.MULTIPLY) + note.isClickable = false + } - note.setOnClickListener { - onItemButtonTicketRowClickListener.onItemButtonTicketRowClickListener( - item, "note" - ) - } + addNote.setOnClickListener { onItemButtonTicketRowClickListener.onItemButtonTicketRowClickListener( item, "addNote"