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
14 changes: 6 additions & 8 deletions core/ui/src/main/java/ru/yeahub/core_ui/component/SkillButton.kt
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,9 @@ fun DefaultButton(

val onSurfaceClick: () -> Unit = {
if (fillButton) {
newContainerColor = if (newContainerColor == defaultColor) {
purple
} else {
defaultColor
}
newContentColor = if (newContentColor == black) {
showBorder = !showBorder

newContentColor = if (showBorder) {
defaultColor
} else {
black
Expand All @@ -163,6 +160,7 @@ fun DefaultButton(
}
val border = when {
showBorder && !fillButton && !buttonWithoutBackground -> activeBorder()
fillButton && enabled && activeButton -> activeBorder()
fillButton && enabled -> null
buttonWithoutBackground -> null
else -> defaultsBorder()
Expand All @@ -171,7 +169,7 @@ fun DefaultButton(
if (newContentColor == black && buttonWithoutBackground && activeButton) {
purple
} else if (newContentColor == black && fillButton && activeButton) {
defaultColor
black
} else {
newContentColor
}
Expand All @@ -182,7 +180,7 @@ fun DefaultButton(
enabled = enabled,
shape = shape,
color = if (activeButton && fillButton) {
purple
defaultColor
} else {
if (buttonWithoutBackground) Color.Transparent else newContainerColor
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package ru.yeahub.core_utils.common

import android.content.Context
import androidx.compose.runtime.Immutable

@Immutable
sealed class TextOrResource {
data class Text(val text: String) : TextOrResource()
data class Resource(val resource: Int) : TextOrResource()
Expand Down
4 changes: 4 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jsoup = "1.17.2"
shimmer = "1.3.3"
uiToolingPreviewAndroid = "1.8.3"
runtime = "1.9.0"
immutableCollections = "0.4.0"

[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
Expand Down Expand Up @@ -66,6 +67,9 @@ koin-compose = { module = "io.insert-koin:koin-androidx-compose", version.ref =
#COIL
coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" }

#Immutable Collections
immutable-collections = { module = "org.jetbrains.kotlinx:kotlinx-collections-immutable", version.ref = "immutableCollections" }

#Jsoup
jsoup = { module = "org.jsoup:jsoup", version.ref = "jsoup" }

Expand Down