Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 654070ca authored by Wolf-Martell Montwé's avatar Wolf-Martell Montwé
Browse files

Add color to account settings screen

parent 6d9987a6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ dependencies {
    implementation(projects.core.ui.compose.designsystem)
    implementation(projects.core.ui.compose.navigation)
    implementation(projects.core.ui.compose.preference)
    implementation(projects.core.ui.legacy.theme2.common)

    testImplementation(projects.core.ui.compose.testing)
}
+34 −0
Original line number Diff line number Diff line
package net.thunderbird.feature.account.settings.impl.ui.fake

import app.k9mail.core.ui.compose.designsystem.atom.icon.Icons
import kotlinx.collections.immutable.persistentListOf
import net.thunderbird.core.ui.compose.preference.api.PreferenceSetting

object FakePreferenceData {

    val textPreference = PreferenceSetting.Text(
        id = "text",
        icon = { Icons.Outlined.Delete },
        title = { "Title" },
        description = { "Description" },
        value = "Value",
    )

    val colorPreference = PreferenceSetting.Color(
        id = "color",
        icon = { Icons.Outlined.Delete },
        title = { "Title" },
        description = { "Description" },
        value = 0xFFFF0000.toInt(),
        colors = listOf(
            0xFFFF0000.toInt(),
            0xFF00FF00.toInt(),
            0xFF0000FF.toInt(),
        ),
    )

    val preferences = persistentListOf(
        textPreference,
        colorPreference,
    )
}
+20 −0
Original line number Diff line number Diff line
package net.thunderbird.feature.account.settings.impl.ui.general

import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import app.k9mail.core.ui.compose.designsystem.PreviewWithTheme
import net.thunderbird.feature.account.settings.impl.ui.fake.FakePreferenceData

@Composable
@Preview(showBackground = true)
internal fun GeneralSettingsContentPreview() {
    PreviewWithTheme {
        GeneralSettingsContent(
            state = GeneralSettingsContract.State(
                subtitle = "Subtitle",
                preferences = FakePreferenceData.preferences,
            ),
            onEvent = {},
        )
    }
}
+5 −0
Original line number Diff line number Diff line
@@ -32,6 +32,11 @@ internal interface AccountSettingsDomainContract {
            val nameTitle: () -> String
            val nameDescription: () -> String?
            val nameIcon: () -> ImageVector?

            val colorTitle: () -> String
            val colorDescription: () -> String?
            val colorIcon: () -> ImageVector?
            val colors: List<Int>
        }
    }

+1 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ import net.thunderbird.feature.account.api.AccountId

internal enum class GeneralPreference {
    NAME,
    COLOR,
}

internal fun GeneralPreference.generateId(accountId: AccountId): String {
Loading