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

Unverified Commit 88813a9c authored by Wolf-Martell Montwé's avatar Wolf-Martell Montwé
Browse files

refactor(preference): change PreferenceSetting.Color colors to immutable list

parent 9265953d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ internal object FakePreferenceData {
        title = { "Title" },
        description = { "Description" },
        value = 0xFFFF0000.toInt(),
        colors = listOf(
        colors = persistentListOf(
            0xFFFF0000.toInt(),
            0xFF00FF00.toInt(),
            0xFF0000FF.toInt(),
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ sealed interface PreferenceSetting<T> : Preference {
        val description: () -> String? = { null },
        val icon: () -> ImageVector? = { null },
        override val value: Int,
        val colors: List<Int>,
        val colors: ImmutableList<Int>,
    ) : PreferenceSetting<Int> {
        @IgnoredOnParcel
        override val requiresEditView: Boolean = true
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ object FakePreferenceData {
        title = { "Title" },
        description = { "Description" },
        value = 0xFFFF0000.toInt(),
        colors = listOf(
        colors = persistentListOf(
            0xFFFF0000.toInt(),
            0xFF00FF00.toInt(),
            0xFF0000FF.toInt(),
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ internal interface AccountSettingsDomainContract {
            val colorTitle: () -> String
            val colorDescription: () -> String?
            val colorIcon: () -> ImageVector?
            val colors: List<Int>
            val colors: ImmutableList<Int>
        }
    }

+4 −1
Original line number Diff line number Diff line
@@ -5,6 +5,8 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.toImmutableList
import net.thunderbird.feature.account.settings.R
import net.thunderbird.feature.account.settings.impl.domain.AccountSettingsDomainContract.ResourceProvider
import net.thunderbird.feature.account.settings.impl.ui.general.components.GeneralSettingsProfileView
@@ -41,5 +43,6 @@ internal class GeneralResourceProvider(
        context.getString(R.string.account_settings_general_color_description)
    }
    override val colorIcon: () -> ImageVector? = { null }
    override val colors: List<Int> = context.resources.getIntArray(ThunderbirdCommonR.array.account_colors).toList()
    override val colors: ImmutableList<Int> = context.resources.getIntArray(ThunderbirdCommonR.array.account_colors)
        .toList().toImmutableList()
}
Loading