Start integration with app: adds Hilt for dep injection, implements a view model
This commit is contained in:
@@ -27,6 +27,11 @@ data class Conversation(
|
||||
@SerializedName("lastMessage")
|
||||
var lastMessage: Message?,
|
||||
) {
|
||||
|
||||
fun formattedDisplayName(): String {
|
||||
return displayName ?: participants.joinToString(", ")
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (other == null || javaClass != other.javaClass) return false
|
||||
|
||||
@@ -39,4 +44,15 @@ data class Conversation(
|
||||
unreadCount == o.unreadCount
|
||||
)
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
var result = guid.hashCode()
|
||||
result = 31 * result + date.hashCode()
|
||||
result = 31 * result + participants.hashCode()
|
||||
result = 31 * result + (displayName?.hashCode() ?: 0)
|
||||
result = 31 * result + unreadCount
|
||||
result = 31 * result + (lastMessagePreview?.hashCode() ?: 0)
|
||||
result = 31 * result + (lastMessage?.hashCode() ?: 0)
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import retrofit2.Response
|
||||
import java.util.Date
|
||||
import java.util.UUID
|
||||
|
||||
@OptIn(ExperimentalStdlibApi::class)
|
||||
class MockServer {
|
||||
val version = "Kordophone-2.0"
|
||||
val conversations: MutableList<Conversation> = mutableListOf()
|
||||
|
||||
Reference in New Issue
Block a user