From d3f75b4fab74b80a4e58c4206f2a092510617e94 Mon Sep 17 00:00:00 2001 From: Marko Kocic Date: Mon, 3 Feb 2025 13:10:36 +0100 Subject: [PATCH 1/4] Fix aspect ratio; Force dark theme; Adjust background shape sizes; Adjust avatar size; Adjust legend badge size; Fix description padding; --- .../core/compose/UniversalAvatarThumbnail.kt | 5 +- .../compose/dropdown/DropdownPrimalMenu.kt | 4 +- .../premium/legend/card/LegendCardScreen.kt | 49 +++++++++++++------ .../details/ui/ProfileDetailsHeader.kt | 12 +++-- 4 files changed, 47 insertions(+), 23 deletions(-) diff --git a/app/src/main/kotlin/net/primal/android/core/compose/UniversalAvatarThumbnail.kt b/app/src/main/kotlin/net/primal/android/core/compose/UniversalAvatarThumbnail.kt index 736666c78..3ab30ff24 100644 --- a/app/src/main/kotlin/net/primal/android/core/compose/UniversalAvatarThumbnail.kt +++ b/app/src/main/kotlin/net/primal/android/core/compose/UniversalAvatarThumbnail.kt @@ -43,13 +43,14 @@ fun UniversalAvatarThumbnail( borderSizeOverride: Dp? = null, backgroundColor: Color = AppTheme.extraColorScheme.surfaceVariantAlt1, onClick: (() -> Unit)? = null, + hasInnerBorderOverride: Boolean = true, defaultAvatar: @Composable () -> Unit = { DefaultAvatarThumbnailPlaceholderListItemImage() }, ) { val hasLegendBorder = legendaryCustomization?.avatarGlow == true && legendaryCustomization.legendaryStyle != LegendaryStyle.NO_CUSTOMIZATION val borderBrush = if (hasLegendBorder) { - legendaryCustomization?.legendaryStyle?.primaryBrush + legendaryCustomization.legendaryStyle?.primaryBrush } else { null } @@ -65,7 +66,7 @@ fun UniversalAvatarThumbnail( cdnVariantUrl = variant?.mediaUrl, sourceUrl = avatarCdnImage?.sourceUrl, hasOuterBorder = hasBorder && avatarSize > 0.dp, - hasInnerBorder = hasLegendBorder && avatarSize > 0.dp, + hasInnerBorder = hasLegendBorder && avatarSize > 0.dp && hasInnerBorderOverride, borderBrush = borderBrush ?: Brush.linearGradient( colors = listOf( fallbackBorderColor, diff --git a/app/src/main/kotlin/net/primal/android/core/compose/dropdown/DropdownPrimalMenu.kt b/app/src/main/kotlin/net/primal/android/core/compose/dropdown/DropdownPrimalMenu.kt index 053b3ef00..e8328784c 100644 --- a/app/src/main/kotlin/net/primal/android/core/compose/dropdown/DropdownPrimalMenu.kt +++ b/app/src/main/kotlin/net/primal/android/core/compose/dropdown/DropdownPrimalMenu.kt @@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.ColumnScope import androidx.compose.material3.DropdownMenu import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.dp import androidx.compose.ui.window.PopupProperties @@ -16,12 +17,13 @@ fun DropdownPrimalMenu( onDismissRequest: () -> Unit, offset: DpOffset = DpOffset(0.dp, 0.dp), properties: PopupProperties = PopupProperties(focusable = true), + backgroundColor: Color = AppTheme.extraColorScheme.surfaceVariantAlt1, content: @Composable ColumnScope.() -> Unit, ) { DropdownMenu( modifier = Modifier .background( - color = AppTheme.extraColorScheme.surfaceVariantAlt1, + color = backgroundColor, shape = AppTheme.shapes.small, ), expanded = expanded, diff --git a/app/src/main/kotlin/net/primal/android/premium/legend/card/LegendCardScreen.kt b/app/src/main/kotlin/net/primal/android/premium/legend/card/LegendCardScreen.kt index 607d0892d..186d880c9 100644 --- a/app/src/main/kotlin/net/primal/android/premium/legend/card/LegendCardScreen.kt +++ b/app/src/main/kotlin/net/primal/android/premium/legend/card/LegendCardScreen.kt @@ -19,6 +19,8 @@ import androidx.compose.foundation.layout.ColumnScope import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.aspectRatio +import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding @@ -30,6 +32,7 @@ import androidx.compose.material3.Button import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.Icon import androidx.compose.material3.IconButton +import androidx.compose.material3.MenuDefaults import androidx.compose.material3.Text import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable @@ -81,6 +84,10 @@ import net.primal.android.theme.AppTheme private val TOP_ICON_COLOR = Color(0xFF1E1E1E) private val GLOW_RECT_COLOR = Color(0xFFCCCCCC) +private val CARD_BACKGROUND_COLOR = Color(0xFF222222) +private val DROPDOWN_BACKGROUND_COLOR = Color(0xFF282828) +private val PRIMARY_TEXT_COLOR = Color(0xFFFFFFFF) +private val SECONDARY_TEXT_COLOR = Color(0xFFAAAAAA) private const val PRIMAL_2_0_RELEASE_DATE_IN_SECONDS = 1732147200L @@ -126,18 +133,20 @@ fun LegendCardScreen( .padding(20.dp) .fillMaxWidth() .clip(AppTheme.shapes.medium) - .background(AppTheme.extraColorScheme.surfaceVariantAlt1) + .background(CARD_BACKGROUND_COLOR) .drawAnimatedBackgroundAndGlow( brush = state.profile?.premiumDetails?.legendaryCustomization?.legendaryStyle?.secondaryBrush, backgroundProgress = animationProgress, glowProgress = glowProgress, ) .padding(bottom = 16.dp) - .padding(4.dp), + .padding(4.dp) + .aspectRatio(ratio = 0.56f), ) { Column( + modifier = Modifier.fillMaxSize(), horizontalAlignment = Alignment.CenterHorizontally, - verticalArrangement = Arrangement.spacedBy(28.dp, Alignment.CenterVertically), + verticalArrangement = Arrangement.SpaceBetween, ) { if (state.isActiveAccountCard) { OptionsDropdownMenu( @@ -256,7 +265,7 @@ private fun ButtonsColumn( private fun ContentDrawScope.drawGlowRectangle(glowProgress: AnimationState) = rotate(degrees = 45f) { drawRect( - topLeft = Offset(x = -440f, y = 1740f - glowProgress.value * 2180f), + topLeft = Offset(x = -440f, y = 1840f - glowProgress.value * 2280f), alpha = .05f + glowProgress.value * .25f, color = GLOW_RECT_COLOR, size = Size(width = 2000f, height = 300f), @@ -268,8 +277,8 @@ private fun DrawScope.makeEdgePaths( animationProgress: AnimationState, ): Triple { val topStart = Path().apply { - moveTo(0f, animationProgress.value * size.height * 0.30f) - lineTo(animationProgress.value * size.height * 0.30f, 0f) + moveTo(0f, animationProgress.value * size.height * .31f) + lineTo(animationProgress.value * size.width * .6f, 0f) lineTo(-10f, 0f) close() } @@ -277,17 +286,17 @@ private fun DrawScope.makeEdgePaths( val bottomStart = Path().apply { moveTo( x = 0f, - y = size.height * 0.70f + (1 - animationProgress.value) * size.height * .3f, + y = size.height * 0.745f + (1 - animationProgress.value) * size.height * .255f, ) lineTo(0f, size.height) - lineTo(animationProgress.value * size.height * 0.30f, size.height) + lineTo(animationProgress.value * size.width * 0.49f, size.height) close() } val topEnd = Path().apply { moveTo(size.width - 10f - animationProgress.value * size.width, 0f) lineTo(size.width, 0f) - lineTo(size.width, animationProgress.value * size.height * .45f) + lineTo(size.width, animationProgress.value * size.height * .5f) close() } @@ -328,7 +337,9 @@ private fun LegendDescription(modifier: Modifier = Modifier, profile: ProfileDet enter = makeEnterTransition(delayMillis = 583), ) { Column( - modifier = modifier.fillMaxWidth(), + modifier = modifier + .padding(horizontal = 20.dp) + .fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.spacedBy(16.dp, Alignment.CenterVertically), ) { @@ -336,14 +347,14 @@ private fun LegendDescription(modifier: Modifier = Modifier, profile: ProfileDet text = stringResource(id = R.string.premium_legend_card_legend_since) + " " + legendSince.formatToDefaultDateFormat(FormatStyle.LONG), style = AppTheme.typography.bodyMedium, - color = AppTheme.colorScheme.onPrimary, + color = PRIMARY_TEXT_COLOR, fontSize = 15.sp, fontWeight = FontWeight.SemiBold, ) Text( text = profile.premiumDetails?.legendaryCustomization?.currentShoutout ?: "", style = AppTheme.typography.bodyMedium, - color = AppTheme.extraColorScheme.onSurfaceVariantAlt2, + color = SECONDARY_TEXT_COLOR, fontSize = 14.sp, textAlign = TextAlign.Center, ) @@ -388,16 +399,17 @@ private fun ProfileSummary(modifier: Modifier = Modifier, profile: ProfileDetail verticalArrangement = Arrangement.spacedBy(10.dp, Alignment.CenterVertically), ) { Box( - modifier = Modifier.size(100.dp), + modifier = Modifier.size(145.dp), contentAlignment = Alignment.Center, ) { UniversalAvatarThumbnail( modifier = Modifier .alpha(avatarSizeAndAlphaProgress.value) .rotate(avatarRotation.value), - avatarSize = (avatarSizeAndAlphaProgress.value * 100).dp, + avatarSize = (avatarSizeAndAlphaProgress.value * 145).dp, avatarCdnImage = profile.avatarCdnImage, legendaryCustomization = profile.premiumDetails?.legendaryCustomization, + hasInnerBorderOverride = false, ) } Spacer(modifier = Modifier.height(10.dp)) @@ -414,7 +426,7 @@ private fun ProfileSummary(modifier: Modifier = Modifier, profile: ProfileDetail style = AppTheme.typography.bodyMedium.copy( lineHeight = 12.sp, ), - color = AppTheme.colorScheme.onPrimary, + color = PRIMARY_TEXT_COLOR, ) } } @@ -427,6 +439,8 @@ private fun ProfileSummary(modifier: Modifier = Modifier, profile: ProfileDetail firstCohort = profile.premiumDetails.cohort1 ?: "", secondCohort = profile.premiumDetails.cohort2 ?: "", legendaryStyle = profile.premiumDetails.legendaryCustomization?.legendaryStyle, + firstCohortFontSize = 14.sp, + secondCohortFontSize = 14.sp, ) } } @@ -442,6 +456,7 @@ private fun ColumnScope.AnimatedDisplayName(showContent: Boolean, profile: Profi Box { NostrUserText( displayName = profile.authorDisplayName, + displayNameColor = PRIMARY_TEXT_COLOR, internetIdentifier = profile.internetIdentifier, internetIdentifierBadgeSize = 26.dp, internetIdentifierBadgeAlign = PlaceholderVerticalAlign.Center, @@ -479,6 +494,7 @@ private fun OptionsDropdownMenu( onLegendSettingsClick: () -> Unit, ) { var menuVisible by remember { mutableStateOf(false) } + val itemColors = MenuDefaults.itemColors(textColor = PRIMARY_TEXT_COLOR, trailingIconColor = PRIMARY_TEXT_COLOR) Box( modifier = modifier .fillMaxWidth() @@ -496,16 +512,19 @@ private fun OptionsDropdownMenu( DropdownPrimalMenu( expanded = menuVisible, onDismissRequest = { menuVisible = false }, + backgroundColor = DROPDOWN_BACKGROUND_COLOR, ) { DropdownPrimalMenuItem( trailingIconVector = Icons.Default.Close, text = stringResource(id = R.string.premium_legend_card_dropdown_close), onClick = onBackClick, + colors = itemColors, ) DropdownPrimalMenuItem( trailingIconVector = PrimalIcons.Settings, text = stringResource(id = R.string.premium_legend_card_dropdown_legend_settings), onClick = onLegendSettingsClick, + colors = itemColors, ) } } diff --git a/app/src/main/kotlin/net/primal/android/profile/details/ui/ProfileDetailsHeader.kt b/app/src/main/kotlin/net/primal/android/profile/details/ui/ProfileDetailsHeader.kt index c6b1c5784..2785c753f 100644 --- a/app/src/main/kotlin/net/primal/android/profile/details/ui/ProfileDetailsHeader.kt +++ b/app/src/main/kotlin/net/primal/android/profile/details/ui/ProfileDetailsHeader.kt @@ -31,6 +31,7 @@ import androidx.compose.ui.text.buildAnnotatedString import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.TextUnit import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import java.text.NumberFormat @@ -376,6 +377,8 @@ fun ProfilePremiumBadge( firstCohort: String, secondCohort: String, legendaryStyle: LegendaryStyle?, + firstCohortFontSize: TextUnit = 12.sp, + secondCohortFontSize: TextUnit = 12.sp, ) { val density = LocalDensity.current val shadowOffset = with(density) { 0.5.dp.toPx() } @@ -383,7 +386,6 @@ fun ProfilePremiumBadge( modifier = modifier .padding(bottom = 1.dp) .shadow(elevation = 1.dp, shape = AppTheme.shapes.extraLarge) - .height(20.dp) .clip(AppTheme.shapes.extraLarge) .background( brush = if (legendaryStyle != null && legendaryStyle != LegendaryStyle.NO_CUSTOMIZATION) { @@ -392,7 +394,8 @@ fun ProfilePremiumBadge( Brush.linearGradient(listOf(AppTheme.colorScheme.tertiary, AppTheme.colorScheme.tertiary)) }, ) - .padding(start = 10.dp, end = 2.dp), + .padding(start = 10.dp, end = 2.dp) + .padding(vertical = 2.dp), horizontalArrangement = Arrangement.spacedBy(6.dp, Alignment.CenterHorizontally), verticalAlignment = Alignment.CenterVertically, ) { @@ -406,12 +409,11 @@ fun ProfilePremiumBadge( offset = Offset(x = shadowOffset, y = shadowOffset), ), ), - fontSize = 12.sp, + fontSize = firstCohortFontSize, color = Color.White, ) Box( modifier = Modifier - .height(16.dp) .clip(AppTheme.shapes.extraLarge) .background(Color.Black.copy(alpha = 0.4f)), ) { @@ -421,7 +423,7 @@ fun ProfilePremiumBadge( .padding(top = 0.75.dp), text = secondCohort, style = AppTheme.typography.bodySmall, - fontSize = 12.sp, + fontSize = secondCohortFontSize, fontWeight = FontWeight.Normal, color = Color.White, ) From 9847257a138f2dbf0b934f12ea6e5c839bff8d6a Mon Sep 17 00:00:00 2001 From: Marko Kocic Date: Mon, 3 Feb 2025 13:22:48 +0100 Subject: [PATCH 2/4] Fix detekt LongMethod --- .../premium/legend/card/LegendCardScreen.kt | 62 +++++++++++-------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/app/src/main/kotlin/net/primal/android/premium/legend/card/LegendCardScreen.kt b/app/src/main/kotlin/net/primal/android/premium/legend/card/LegendCardScreen.kt index 186d880c9..9ebdf63bd 100644 --- a/app/src/main/kotlin/net/primal/android/premium/legend/card/LegendCardScreen.kt +++ b/app/src/main/kotlin/net/primal/android/premium/legend/card/LegendCardScreen.kt @@ -79,6 +79,7 @@ import net.primal.android.core.utils.formatToDefaultDateFormat import net.primal.android.premium.legend.domain.LegendaryCustomization import net.primal.android.premium.legend.domain.LegendaryStyle import net.primal.android.profile.details.ui.ProfilePremiumBadge +import net.primal.android.profile.details.ui.model.PremiumProfileDataUi import net.primal.android.profile.details.ui.model.shouldShowPremiumBadge import net.primal.android.theme.AppTheme @@ -416,37 +417,48 @@ private fun ProfileSummary(modifier: Modifier = Modifier, profile: ProfileDetail AnimatedDisplayName(showContent = showContent, profile = profile) profile.internetIdentifier?.let { internetIdentifier -> - AnimatedVisibility( - visible = showContent, - enter = makeEnterTransition(delayMillis = 416), - ) { - Text( - modifier = Modifier, - text = internetIdentifier.formatNip05Identifier(), - style = AppTheme.typography.bodyMedium.copy( - lineHeight = 12.sp, - ), - color = PRIMARY_TEXT_COLOR, - ) - } + AnimatedInternetIdentifier(showContent = showContent, internetIdentifier = internetIdentifier) } + if (profile.premiumDetails?.shouldShowPremiumBadge() == true) { - AnimatedVisibility( - visible = showContent, - enter = makeEnterTransition(delayMillis = 500), - ) { - ProfilePremiumBadge( - firstCohort = profile.premiumDetails.cohort1 ?: "", - secondCohort = profile.premiumDetails.cohort2 ?: "", - legendaryStyle = profile.premiumDetails.legendaryCustomization?.legendaryStyle, - firstCohortFontSize = 14.sp, - secondCohortFontSize = 14.sp, - ) - } + AnimatedPremiumBadge(showContent = showContent, premiumDetails = profile.premiumDetails) } } } +@Composable +private fun ColumnScope.AnimatedPremiumBadge(showContent: Boolean, premiumDetails: PremiumProfileDataUi) { + AnimatedVisibility( + visible = showContent, + enter = makeEnterTransition(delayMillis = 500), + ) { + ProfilePremiumBadge( + firstCohort = premiumDetails.cohort1 ?: "", + secondCohort = premiumDetails.cohort2 ?: "", + legendaryStyle = premiumDetails.legendaryCustomization?.legendaryStyle, + firstCohortFontSize = 14.sp, + secondCohortFontSize = 14.sp, + ) + } +} + +@Composable +private fun ColumnScope.AnimatedInternetIdentifier(showContent: Boolean, internetIdentifier: String) { + AnimatedVisibility( + visible = showContent, + enter = makeEnterTransition(delayMillis = 416), + ) { + Text( + modifier = Modifier, + text = internetIdentifier.formatNip05Identifier(), + style = AppTheme.typography.bodyMedium.copy( + lineHeight = 12.sp, + ), + color = PRIMARY_TEXT_COLOR, + ) + } +} + @Composable private fun ColumnScope.AnimatedDisplayName(showContent: Boolean, profile: ProfileDetailsUi) { AnimatedVisibility( From c070fe60c33e353127fed1c39190947c5926e84f Mon Sep 17 00:00:00 2001 From: Marko Kocic Date: Mon, 3 Feb 2025 15:43:55 +0100 Subject: [PATCH 3/4] Fix cannot set no customization because backend responds with null --- .../android/premium/legend/domain/LegendaryCustomization.kt | 2 +- .../net/primal/android/profile/domain/PrimalLegendProfile.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/net/primal/android/premium/legend/domain/LegendaryCustomization.kt b/app/src/main/kotlin/net/primal/android/premium/legend/domain/LegendaryCustomization.kt index a766621be..032a9e5e5 100644 --- a/app/src/main/kotlin/net/primal/android/premium/legend/domain/LegendaryCustomization.kt +++ b/app/src/main/kotlin/net/primal/android/premium/legend/domain/LegendaryCustomization.kt @@ -15,7 +15,7 @@ fun PrimalLegendProfile.asLegendaryCustomization() = LegendaryCustomization( avatarGlow = avatarGlow, customBadge = customBadge, - legendaryStyle = LegendaryStyle.valueById(id = styleId), + legendaryStyle = LegendaryStyle.valueById(id = styleId ?: ""), legendSince = legendSince, currentShoutout = currentShoutout, inLeaderboard = inLeaderboard, diff --git a/app/src/main/kotlin/net/primal/android/profile/domain/PrimalLegendProfile.kt b/app/src/main/kotlin/net/primal/android/profile/domain/PrimalLegendProfile.kt index ff4967dad..a6de71950 100644 --- a/app/src/main/kotlin/net/primal/android/profile/domain/PrimalLegendProfile.kt +++ b/app/src/main/kotlin/net/primal/android/profile/domain/PrimalLegendProfile.kt @@ -5,7 +5,7 @@ import kotlinx.serialization.Serializable @Serializable data class PrimalLegendProfile( - @SerialName("style") val styleId: String, + @SerialName("style") val styleId: String?, @SerialName("custom_badge") val customBadge: Boolean, @SerialName("avatar_glow") val avatarGlow: Boolean, @SerialName("legend_since") val legendSince: Long? = null, From faf364eb7d4aa0ee32253484d8e99739160ec7c4 Mon Sep 17 00:00:00 2001 From: Marko Kocic Date: Mon, 3 Feb 2025 15:45:00 +0100 Subject: [PATCH 4/4] Handle no customization legend cards --- .../premium/legend/card/LegendCardScreen.kt | 19 ++++++++++--------- .../premium/legend/domain/LegendaryStyle.kt | 5 ++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/src/main/kotlin/net/primal/android/premium/legend/card/LegendCardScreen.kt b/app/src/main/kotlin/net/primal/android/premium/legend/card/LegendCardScreen.kt index 9ebdf63bd..244d1d7e8 100644 --- a/app/src/main/kotlin/net/primal/android/premium/legend/card/LegendCardScreen.kt +++ b/app/src/main/kotlin/net/primal/android/premium/legend/card/LegendCardScreen.kt @@ -53,6 +53,7 @@ import androidx.compose.ui.geometry.Size import androidx.compose.ui.graphics.Brush import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Path +import androidx.compose.ui.graphics.SolidColor import androidx.compose.ui.graphics.drawscope.ContentDrawScope import androidx.compose.ui.graphics.drawscope.DrawScope import androidx.compose.ui.graphics.drawscope.rotate @@ -89,6 +90,7 @@ private val CARD_BACKGROUND_COLOR = Color(0xFF222222) private val DROPDOWN_BACKGROUND_COLOR = Color(0xFF282828) private val PRIMARY_TEXT_COLOR = Color(0xFFFFFFFF) private val SECONDARY_TEXT_COLOR = Color(0xFFAAAAAA) +private val FALLBACK_BACKGROUND_ELEMENT_COLOR = Color(0xFF444444) private const val PRIMAL_2_0_RELEASE_DATE_IN_SECONDS = 1732147200L @@ -136,7 +138,8 @@ fun LegendCardScreen( .clip(AppTheme.shapes.medium) .background(CARD_BACKGROUND_COLOR) .drawAnimatedBackgroundAndGlow( - brush = state.profile?.premiumDetails?.legendaryCustomization?.legendaryStyle?.secondaryBrush, + brush = state.profile?.premiumDetails?.legendaryCustomization?.legendaryStyle?.secondaryBrush + ?: SolidColor(FALLBACK_BACKGROUND_ELEMENT_COLOR), backgroundProgress = animationProgress, glowProgress = glowProgress, ) @@ -188,17 +191,15 @@ private suspend fun AnimationState.startAnimation(dela ) private fun Modifier.drawAnimatedBackgroundAndGlow( - brush: Brush?, + brush: Brush, backgroundProgress: AnimationState, glowProgress: AnimationState, ) = drawWithContent { val (topStart, bottomStart, topEnd) = makeEdgePaths(animationProgress = backgroundProgress) - brush?.let { - drawPath(alpha = 0.25f, path = topStart, brush = brush) - drawPath(alpha = 0.25f, path = bottomStart, brush = brush) - drawPath(path = topEnd, brush = brush) - } + drawPath(alpha = 0.25f, path = topStart, brush = brush) + drawPath(alpha = 0.15f, path = bottomStart, brush = brush) + drawPath(path = topEnd, brush = brush) drawContent() drawGlowRectangle(glowProgress = glowProgress) @@ -315,11 +316,11 @@ private fun LegendaryStyle?.resolveNoCustomizationAndNull(): Color = private fun LegendaryStyle?.resolveButtonColor(): Color = when (this) { - LegendaryStyle.NO_CUSTOMIZATION, LegendaryStyle.GOLD, LegendaryStyle.AQUA, + LegendaryStyle.GOLD, LegendaryStyle.AQUA, LegendaryStyle.SILVER, LegendaryStyle.TEAL, LegendaryStyle.BROWN, null, -> Color.Black - LegendaryStyle.PURPLE, LegendaryStyle.PURPLE_HAZE, + LegendaryStyle.NO_CUSTOMIZATION, LegendaryStyle.PURPLE, LegendaryStyle.PURPLE_HAZE, LegendaryStyle.BLUE, LegendaryStyle.SUN_FIRE, -> Color.White } diff --git a/app/src/main/kotlin/net/primal/android/premium/legend/domain/LegendaryStyle.kt b/app/src/main/kotlin/net/primal/android/premium/legend/domain/LegendaryStyle.kt index d0435f7d6..48fdf45f5 100644 --- a/app/src/main/kotlin/net/primal/android/premium/legend/domain/LegendaryStyle.kt +++ b/app/src/main/kotlin/net/primal/android/premium/legend/domain/LegendaryStyle.kt @@ -3,6 +3,7 @@ package net.primal.android.premium.legend.domain import androidx.compose.ui.geometry.Offset import androidx.compose.ui.graphics.Brush import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor @Suppress("MagicNumber") enum class LegendaryStyle( @@ -17,9 +18,7 @@ enum class LegendaryStyle( primaryBrush = Brush.linearGradient( listOf(Color.Transparent, Color.Transparent), ), - secondaryBrush = Brush.linearGradient( - listOf(Color.Transparent, Color.Transparent), - ), + secondaryBrush = SolidColor(Color(0xFF444444)), ), GOLD( id = "GOLD",