Repository: thunderbird/thunderbird-android
File: legacy/ui/legacy/src/debug/kotlin/com/fsck/k9/ui/messagelist/item/MessageItemContentPreview.kt (Kotlin)

Code before:
    port = 993,
    connectionSecurity = ConnectionSecurity.SSL_TLS_REQUIRED,
    authenticationType = AuthType.PLAIN,
    username = "username",
    password = "password",
    clientCertificateAlias = null,
)
private val fakeMessageListItem = MessageListItem(
    account = LegacyAccount(
        id = accountId,
        name = "Name",
        email = "test@example.com",
        profile = ProfileDto(
            id = accountId,
            name = "Name",
            color = 0xFF0000FF.toInt(),
            avatar = AvatarDto(
                avatarType = AvatarTypeDto.MONOGRAM,
                avatarMonogram = "AB",
                avatarImageUri = null,
                avatarIconName = null,
            ),
        ),
        incomingServerSettings = serverSettings,
        outgoingServerSettings = serverSettings,
        identities = emptyList(),
    ),
    subject = "Subject",
    threadCount = 0,
    messageDate = 1234456789L,
    internalDate = 1234456789L,
    displayName = "Sender Name",
    displayAddress = null,
    previewText = "This is the preview text.",
    isMessageEncrypted = false,
    isRead = false,
    isStarred = false,
    isAnswered = false,
    isForwarded = false,
    hasAttachments = false,
    uniqueId = 42L,
    folderId = 123L,
    messageUid = "654321",
    databaseId = 1L,
    threadRoot = 1L,
)

private val fakeMessageListAppearance = MessageListAppearance(
    fontSizes = FontSizes(),
    previewLines = 2,
    stars = true,

Review comment (suggestion):
This causes the following exception while trying to preview the component within Android Studio:
```
java.lang.IndexOutOfBoundsException: Empty list doesn't contain element at index 0.
    at _layoutlib_._internal_.kotlin.collections.EmptyList.get(Collections.kt:37)
    at _layoutlib_._internal_.kotlin.collections.EmptyList.get(Collections.kt:25)
    at net.thunderbird.core.android.account.LegacyAccount.<init>(LegacyAccount.kt:109)
```

Just add an empty Identity and the preview will show up:
```suggestion
        identities = listOf(Identity()),
```

Code after:
    host = "imap.example.com",
    port = 993,
    connectionSecurity = ConnectionSecurity.SSL_TLS_REQUIRED,
    authenticationType = AuthType.PLAIN,
    username = "username",
    password = "password",
    clientCertificateAlias = null,
)
private val fakeMessageListItem = MessageListItem(
    account = LegacyAccount(
        id = accountId,
        name = "Name",
        email = "test@example.com",
        profile = ProfileDto(
            id = accountId,
            name = "Name",
            color = 0xFF0000FF.toInt(),
            avatar = AvatarDto(
                avatarType = AvatarTypeDto.MONOGRAM,
                avatarMonogram = "AB",
                avatarImageUri = null,
                avatarIconName = null,
            ),
        ),
        incomingServerSettings = serverSettings,
        outgoingServerSettings = serverSettings,
        identities = listOf(Identity()),
    ),
    subject = "Subject",
    threadCount = 0,
    messageDate = 1234456789L,
    internalDate = 1234456789L,
    displayName = "Sender Name",
    displayAddress = null,
    previewText = "This is the preview text.",
    isMessageEncrypted = false,
    isRead = false,
    isStarred = false,
    isAnswered = false,
    isForwarded = false,
    hasAttachments = false,
    uniqueId = 42L,
    folderId = 123L,
    messageUid = "654321",
    databaseId = 1L,
    threadRoot = 1L,
)

private val fakeMessageListAppearance = MessageListAppearance(
    fontSizes = FontSizes(),
    previewLines = 2,