fix balance card color

This commit is contained in:
Minecon724 2024-08-01 14:28:24 +02:00
parent 1d24005e5e
commit 38ce999965
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8

View file

@ -19,6 +19,7 @@ import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.TextFieldDefaults
import androidx.compose.material3.pulltorefresh.PullToRefreshBox import androidx.compose.material3.pulltorefresh.PullToRefreshBox
import androidx.compose.material3.pulltorefresh.rememberPullToRefreshState import androidx.compose.material3.pulltorefresh.rememberPullToRefreshState
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
@ -157,12 +158,12 @@ fun DashboardScreen(dashboardViewModel: DashboardViewModel) {
@Composable @Composable
fun balanceCardColor(balance: Double): Color { fun balanceCardColor(balance: Double): Color {
return if (balance > 0) CardDefaults.cardColors().containerColor else MaterialTheme.colorScheme.errorContainer return if (balance > 0) Color.Unspecified else MaterialTheme.colorScheme.errorContainer
} }
@Composable @Composable
fun balanceColor(balance: Double, warningThreshold: Double): Color { fun balanceColor(balance: Double, warningThreshold: Double): Color {
return if (balance > warningThreshold) MaterialTheme.colorScheme.secondary else MaterialTheme.colorScheme.error return if (balance > warningThreshold) Color.Unspecified else MaterialTheme.colorScheme.error
} }
@Composable @Composable