WD: handle the visibility of serving token

live_activities
tahaalam 3 weeks ago
parent 02cd542bd9
commit 7a28f94b3d

@ -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<String, Any>) {

@ -103,6 +103,7 @@
<!-- Bottom Section: Current Serving and Role -->
<LinearLayout
android:id="@+id/serving_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="12dp"

Loading…
Cancel
Save