From ba1dc82e1bf92a8dec04d747d2e567650f20dd2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joris=20Pelgr=C3=B6m?= Date: Sat, 28 Sep 2024 14:57:55 +0200 Subject: [PATCH] Make ImprovDevice name nullable --- app/src/main/java/com/wifi/improv/demo/MainActivity.kt | 2 +- library/src/main/java/com/wifi/improv/ImprovDevice.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/wifi/improv/demo/MainActivity.kt b/app/src/main/java/com/wifi/improv/demo/MainActivity.kt index c606b7b..fdc85b3 100644 --- a/app/src/main/java/com/wifi/improv/demo/MainActivity.kt +++ b/app/src/main/java/com/wifi/improv/demo/MainActivity.kt @@ -165,7 +165,7 @@ fun ImprovDeviceList( onClick = { connect(it) } ) { Column { - Text(it.name) + Text(it.name ?: it.address) Text( text = it.address, style = MaterialTheme.typography.caption diff --git a/library/src/main/java/com/wifi/improv/ImprovDevice.kt b/library/src/main/java/com/wifi/improv/ImprovDevice.kt index bbea9fb..ecf1e85 100644 --- a/library/src/main/java/com/wifi/improv/ImprovDevice.kt +++ b/library/src/main/java/com/wifi/improv/ImprovDevice.kt @@ -1,7 +1,7 @@ package com.wifi.improv data class ImprovDevice( - val name: String, + val name: String?, val address: String ) { override fun equals(other: Any?): Boolean {