|
| 1 | +/* |
| 2 | + * Infomaniak Authenticator - Android |
| 3 | + * Copyright (C) 2026 Infomaniak Network SA |
| 4 | + * |
| 5 | + * This program is free software: you can redistribute it and/or modify |
| 6 | + * it under the terms of the GNU General Public License as published by |
| 7 | + * the Free Software Foundation, either version 3 of the License, or |
| 8 | + * (at your option) any later version. |
| 9 | + * |
| 10 | + * This program is distributed in the hope that it will be useful, |
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | + * GNU General Public License for more details. |
| 14 | + * |
| 15 | + * You should have received a copy of the GNU General Public License |
| 16 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | + */ |
| 18 | +package com.infomaniak.auth.ui.images.illus.personKAuthAuthenticator |
| 19 | + |
| 20 | +import androidx.compose.foundation.Image |
| 21 | +import androidx.compose.foundation.layout.Box |
| 22 | +import androidx.compose.foundation.layout.size |
| 23 | +import androidx.compose.runtime.Composable |
| 24 | +import androidx.compose.ui.Modifier |
| 25 | +import com.infomaniak.auth.ui.images.AppImages |
| 26 | +import com.infomaniak.auth.ui.images.AppImages.AppIllus |
| 27 | +import com.infomaniak.auth.ui.theme.AuthenticatorTheme |
| 28 | +import com.infomaniak.core.ui.compose.preview.PreviewLightAndDark |
| 29 | +import com.infomaniak.core.ui.compose.theme.ThemedImage |
| 30 | + |
| 31 | +@Suppress("UnusedReceiverParameter") |
| 32 | +val AppIllus.PersonKAuthAuthenticator: ThemedImage |
| 33 | + get() = _personKAuthAuthenticator ?: object : ThemedImage { |
| 34 | + override val light = AppIllus.PersonKAuthAuthenticatorLight |
| 35 | + override val dark = AppIllus.PersonKAuthAuthenticatorDark |
| 36 | + }.also { _personKAuthAuthenticator = it } |
| 37 | + |
| 38 | +private var _personKAuthAuthenticator: ThemedImage? = null |
| 39 | + |
| 40 | +@PreviewLightAndDark |
| 41 | +@Composable |
| 42 | +private fun Preview() { |
| 43 | + AuthenticatorTheme { |
| 44 | + Box { |
| 45 | + Image( |
| 46 | + imageVector = AppIllus.PersonKAuthAuthenticator.image(), |
| 47 | + contentDescription = null, |
| 48 | + modifier = Modifier.size(AppImages.previewSize), |
| 49 | + ) |
| 50 | + } |
| 51 | + } |
| 52 | +} |
0 commit comments