From 7a28f94b3dadccb699bd5312af07a076b13372eb Mon Sep 17 00:00:00 2001 From: tahaalam Date: Thu, 23 Jul 2026 12:00:35 +0300 Subject: [PATCH] WD: handle the visibility of serving token --- .../HMGPatientApp}/live_activity/CustomActiviy.kt | 12 +++++++++++- android/app/src/main/res/layout/live_activity.xml | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) rename android/app/src/main/kotlin/com/{ejada/hmg => cloudsolutions/HMGPatientApp}/live_activity/CustomActiviy.kt (92%) diff --git a/android/app/src/main/kotlin/com/ejada/hmg/live_activity/CustomActiviy.kt b/android/app/src/main/kotlin/com/cloudsolutions/HMGPatientApp/live_activity/CustomActiviy.kt similarity index 92% rename from android/app/src/main/kotlin/com/ejada/hmg/live_activity/CustomActiviy.kt rename to android/app/src/main/kotlin/com/cloudsolutions/HMGPatientApp/live_activity/CustomActiviy.kt index fe1e564c..c95e637c 100644 --- a/android/app/src/main/kotlin/com/ejada/hmg/live_activity/CustomActiviy.kt +++ b/android/app/src/main/kotlin/com/cloudsolutions/HMGPatientApp/live_activity/CustomActiviy.kt @@ -1,4 +1,4 @@ -package com.ejada.hmg.live_activity +package com.cloudsolutions.HMGPatientApp import android.app.Activity import android.app.Notification @@ -77,6 +77,16 @@ class CustomLiveActivityManager(context: Context) : remoteViews.setTextViewText(R.id.status_text, data["nextTicketStatus"] as? String ?: "") remoteViews.setTextViewText(R.id.queue_label, data["yourTicketHeader"] as? String ?: "") remoteViews.setTextViewText(R.id.serving_label, data["currentlyServingTitle"] as? String ?: "") + + // Hide serving_layout if currentlyServingToken is empty + val currentlyServingToken = data["currentlyServingToken"] as? String ?: "" + if (currentlyServingToken.isEmpty()) { + remoteViews.setViewVisibility(R.id.serving_layout, android.view.View.GONE) + } else { + remoteViews.setViewVisibility(R.id.serving_layout, android.view.View.VISIBLE) + } + + } private suspend fun updateCollapsedView(data: Map) { diff --git a/android/app/src/main/res/layout/live_activity.xml b/android/app/src/main/res/layout/live_activity.xml index 12a378ec..06b51931 100644 --- a/android/app/src/main/res/layout/live_activity.xml +++ b/android/app/src/main/res/layout/live_activity.xml @@ -103,6 +103,7 @@