Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fix-issue-3518' into fix-issue-3518
Browse files Browse the repository at this point in the history
  • Loading branch information
paulolima18 committed Sep 19, 2024
2 parents b23d144 + 89ad89a commit 248bd4b
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 17 deletions.
8 changes: 4 additions & 4 deletions screen/home/src/main/java/com/ivy/home/HomeMoreMenu.kt
Original file line number Diff line number Diff line change
Expand Up @@ -445,25 +445,25 @@ private fun QuickAccess(
icon = when (theme) {
Theme.LIGHT -> R.drawable.home_more_menu_light_mode
Theme.DARK -> R.drawable.home_more_menu_dark_mode
Theme.TRUE_BLACK -> R.drawable.home_more_menu_dark_mode
Theme.AMOLED_DARK -> R.drawable.home_more_menu_amoled_dark_mode
Theme.AUTO -> R.drawable.home_more_menu_auto_mode
},
label = when (theme) {
Theme.LIGHT -> stringResource(R.string.light_mode)
Theme.DARK -> stringResource(R.string.dark_mode)
Theme.TRUE_BLACK -> stringResource(R.string.amoled_mode)
Theme.AMOLED_DARK -> stringResource(R.string.amoled_mode)
Theme.AUTO -> stringResource(R.string.auto_mode)
},
backgroundColor = when (theme) {
Theme.LIGHT -> UI.colors.pure
Theme.DARK -> UI.colors.pureInverse
Theme.TRUE_BLACK -> UI.colors.pureInverse
Theme.AMOLED_DARK -> UI.colors.pureInverse
Theme.AUTO -> UI.colors.pure
},
tint = when (theme) {
Theme.LIGHT -> UI.colors.pureInverse
Theme.DARK -> UI.colors.pure
Theme.TRUE_BLACK -> UI.colors.pure
Theme.AMOLED_DARK -> UI.colors.pure
Theme.AUTO -> UI.colors.pureInverse
}
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,13 @@ private fun BoxWithConstraintsScope.UI(
icon = when (theme) {
Theme.LIGHT -> R.drawable.home_more_menu_light_mode
Theme.DARK -> R.drawable.home_more_menu_dark_mode
Theme.TRUE_BLACK -> R.drawable.home_more_menu_dark_mode
Theme.AMOLED_DARK -> R.drawable.home_more_menu_amoled_dark_mode
Theme.AUTO -> R.drawable.home_more_menu_auto_mode
},
label = when (theme) {
Theme.LIGHT -> stringResource(R.string.light_mode)
Theme.DARK -> stringResource(R.string.dark_mode)
Theme.TRUE_BLACK -> stringResource(R.string.amoled_mode)
Theme.AMOLED_DARK -> stringResource(R.string.amoled_mode)
Theme.AUTO -> stringResource(R.string.auto_mode)
}
) {
Expand Down
2 changes: 1 addition & 1 deletion shared/base/src/main/java/com/ivy/base/legacy/Theme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import androidx.compose.runtime.Immutable
@Deprecated("Old design system. Use `:ivy-design` and Material3")
@Immutable
enum class Theme {
LIGHT, DARK, AUTO, TRUE_BLACK
LIGHT, DARK, AUTO, AMOLED_DARK
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ private fun ivyDarkColorScheme(isTrueBlack: Boolean): ColorScheme = ColorScheme(
errorContainer = IvyColors.Red.light,
onErrorContainer = IvyColors.White,

background = if(isTrueBlack) IvyColors.TrueBlack else IvyColors.Black,
background = if (isTrueBlack) IvyColors.TrueBlack else IvyColors.Black,
onBackground = IvyColors.White,
surface = if(isTrueBlack) IvyColors.TrueBlack else IvyColors.Black,
surface = if (isTrueBlack) IvyColors.TrueBlack else IvyColors.Black,
onSurface = IvyColors.White,
surfaceVariant = IvyColors.ExtraDarkGray,
onSurfaceVariant = IvyColors.White,
surfaceTint = IvyColors.White,
inverseSurface = IvyColors.LightGray,
inverseOnSurface = if(isTrueBlack) IvyColors.TrueBlack else IvyColors.Black,
inverseOnSurface = if (isTrueBlack) IvyColors.TrueBlack else IvyColors.Black,

outline = IvyColors.Gray,
outlineVariant = IvyColors.LightGray,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M3.0238,12.38C3.3398,17.0138 7.1752,20.7838 11.7654,20.9907C15.004,21.1347 17.9003,19.5871 19.638,17.1487C20.3577,16.15 19.9716,15.4842 18.7692,15.7091C18.1811,15.8171 17.5755,15.8621 16.9436,15.8351C12.6518,15.6551 9.1412,11.9751 9.1236,7.6292C9.1148,6.4595 9.3518,5.3528 9.7819,4.345C10.2558,3.2293 9.6853,2.6984 8.5882,3.1753C5.1127,4.6779 2.7342,8.268 3.0238,12.38Z"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#292D32"
android:strokeColor="#292D32"
android:strokeLineCap="round" />
</vector>
2 changes: 1 addition & 1 deletion shared/ui/core/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<string name="settings">Settings</string>
<string name="light_mode">Light mode</string>
<string name="dark_mode">Dark mode</string>
<string name="amoled_mode">Black mode</string>
<string name="amoled_mode">Amoled Dark mode</string>
<string name="auto_mode">Auto mode</string>
<string name="planned_payments">Planned\nPayments</string>
<string name="share_ivy">Share Ivy</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ open class PaparazziScreenshotTest {
dark = when (theme) {
PaparazziTheme.Light -> false
PaparazziTheme.Dark -> true
}
},
isTrueBlack = false
) {
content()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ open class PaparazziScreenshotTest {
dark = when (theme) {
PaparazziTheme.Light -> false
PaparazziTheme.Dark -> true
}
},
isTrueBlack = false
) {
content()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class SettingsAct @Inject constructor(
val currentSettings = this(Unit)
val newTheme = when (currentSettings.theme) {
Theme.LIGHT -> Theme.DARK
Theme.DARK -> Theme.TRUE_BLACK
Theme.TRUE_BLACK -> Theme.AUTO
Theme.DARK -> Theme.AMOLED_DARK
Theme.AMOLED_DARK -> Theme.AUTO
Theme.AUTO -> Theme.LIGHT
}
return currentSettings.copy(theme = newTheme)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ abstract class IvyWalletDesign : IvyDesign {
override val isLight = false
}

Theme.TRUE_BLACK -> object : IvyColors {
Theme.AMOLED_DARK -> object : IvyColors {
override val pure = TrueBlack
override val pureInverse = White
override val gray = Gray
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ fun IvyTheme(

IvyMaterial3Theme(
dark = !colors.isLight,
isTrueBlack = theme == Theme.TRUE_BLACK,
isTrueBlack = theme == Theme.AMOLED_DARK,
content = content,
)
}
Expand Down

0 comments on commit 248bd4b

Please sign in to comment.