Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/src/main/java/com/infomaniak/mail/data/LocalSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,11 @@ class LocalSettings private constructor(context: Context) : SharedValues {
@StringRes val localisedNameRes: Int,
@StyleRes val theme: Int,
val introTabIndex: Int,
@StringRes val tabNameRes: Int = localisedNameRes,
) {
PINK(R.string.accentColorPinkTitle, R.style.AppTheme_Pink, 0),
BLUE(R.string.accentColorBlueTitle, R.style.AppTheme_Blue, 1),
SYSTEM(R.string.accentColorSystemTitle, R.style.AppTheme, 2);
SYSTEM(R.string.accentColorSystemTitle, R.style.AppTheme, 2, R.string.settingsOptionSystemTheme);

fun getPrimary(context: Context): Int {
val baseThemeContext = ContextThemeWrapper(context, theme)
Expand Down

This file was deleted.

22 changes: 11 additions & 11 deletions app/src/main/java/com/infomaniak/mail/ui/login/IlluColors.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Infomaniak Mail - Android
* Copyright (C) 2022-2024 Infomaniak Network SA
* Copyright (C) 2022-2025 Infomaniak Network SA
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -60,15 +60,15 @@ object IlluColors {
96.0,
)

fun LottieAnimationView.changeIllustrationColors(position: Int, accentColor: AccentColor) {
updateAccentColorIndependentColors(position)
updateAccentColorDependentColors(accentColor, position)
fun LottieAnimationView.changeIllustrationColors(illustrationId: Int, accentColor: AccentColor) {
updateAccentColorIndependentColors(illustrationId)
updateAccentColorDependentColors(accentColor, illustrationId)
}

//region Accent color independent part
private fun LottieAnimationView.updateAccentColorIndependentColors(position: Int) {
private fun LottieAnimationView.updateAccentColorIndependentColors(illustrationId: Int) {
val pathsToColor = context.getAccentIndependentPathsToColor()
colorPaths(pathsToColor, position)
colorPaths(pathsToColor, illustrationId)
}

private fun computeIlluOnBoardingColors(commonColor1: Int, commonColor2: Int, commonColor3: Int, commonColor4: Int) = listOf(
Expand Down Expand Up @@ -227,10 +227,10 @@ object IlluColors {
//endregion

//region Accent color dependent part
private fun LottieAnimationView.updateAccentColorDependentColors(accentColor: AccentColor, position: Int) {
private fun LottieAnimationView.updateAccentColorDependentColors(accentColor: AccentColor, illustrationId: Int) {
val palette = context.getPaletteFor(accentColor)
val pathsToColor = getPathsToColorFromPalette(palette)
colorPaths(pathsToColor, position)
colorPaths(pathsToColor, illustrationId)
}

@SuppressLint("RestrictedApi")
Expand Down Expand Up @@ -349,14 +349,14 @@ object IlluColors {
//endregion

//region Common
private fun LottieAnimationView.colorPaths(pathToColor: IlluOnBoardingColors, position: Int) = with(pathToColor) {
private fun LottieAnimationView.colorPaths(pathToColor: IlluOnBoardingColors, illustrationId: Int) = with(pathToColor) {
illuAll.forEach(::changePathColor)

when (position) {
when (illustrationId) {
1, 2, 3 -> illu234.forEach(::changePathColor)
}

when (position) {
when (illustrationId) {
0 -> illu1.forEach(::changePathColor)
1 -> illu2.forEach(::changePathColor)
2 -> illu3.forEach(::changePathColor)
Expand Down
198 changes: 0 additions & 198 deletions app/src/main/java/com/infomaniak/mail/ui/login/IntroFragment.kt

This file was deleted.

Loading