Skip to content

Commit

Permalink
⬆️ bumped compose multiplatform version
Browse files Browse the repository at this point in the history
  • Loading branch information
schachi5000 committed Jun 4, 2024
1 parent 9aa1206 commit 74545f8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ android.useAndroidX=true
#Versions
kotlin.version=1.9.22
agp.version=8.3.0
compose.version=1.6.0
compose.version=1.6.11
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import co.touchlab.kermit.Logger
import marvelchampionscompanion.shared.generated.resources.Res
import marvelchampionscompanion.shared.generated.resources.card_blue_no_image
import marvelchampionscompanion.shared.generated.resources.card_yellow_no_image
import net.schacher.mcc.shared.design.theme.CardShape
import net.schacher.mcc.shared.design.theme.SleeveColors
import net.schacher.mcc.shared.model.Card
Expand All @@ -35,7 +38,6 @@ import net.schacher.mcc.shared.model.CardType.OBLIGATION
import net.schacher.mcc.shared.model.CardType.SIDE_SCHEME
import net.schacher.mcc.shared.model.CardType.TREACHERY
import net.schacher.mcc.shared.model.CardType.VILLAIN
import org.jetbrains.compose.resources.DrawableResource
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.painterResource

Expand Down Expand Up @@ -100,7 +102,7 @@ fun Card(
modifier = Modifier.fillMaxSize()
.background(card.backSideColor, CardShape)
.border(8.dp, card.backSideColor, CardShape),
painter = painterResource(DrawableResource(card.getFailureResource())),
painter = painterResource(card.getFailureResource()),
contentDescription = "Placeholder",
)
})
Expand All @@ -119,7 +121,7 @@ val Card.backSideColor: Color
else -> SleeveColors.Blue
}

private fun Card.getFailureResource(): String = when (this.backSideColor) {
SleeveColors.Yellow -> "drawable/card_yellow_no_image.png"
else -> "drawable/card_blue_no_image.png"
private fun Card.getFailureResource() = when (this.backSideColor) {
SleeveColors.Yellow -> Res.drawable.card_yellow_no_image
else -> Res.drawable.card_blue_no_image
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import co.touchlab.kermit.Logger
import marvelchampionscompanion.shared.generated.resources.Res
import marvelchampionscompanion.shared.generated.resources.ic_cards
import marvelchampionscompanion.shared.generated.resources.ic_deck
import net.schacher.mcc.shared.design.previewablePainterResource
import net.schacher.mcc.shared.design.theme.CardShape
import net.schacher.mcc.shared.design.theme.DeckShape
Expand Down Expand Up @@ -106,12 +109,9 @@ private fun DeckContent(deck: Deck, onClick: () -> Unit = {}) {
verticalArrangement = Arrangement.Center
) {

InfoRow("${deck.cards.size} Karten", DrawableResource("drawable/ic_cards.xml"))
InfoRow("${deck.cards.size} Karten", Res.drawable.ic_cards)
Spacer(Modifier.height(4.dp))
InfoRow(
"${deck.requiredDecks.size} Packs benötigt",
DrawableResource("drawable/ic_deck.xml")
)
InfoRow("${deck.requiredDecks.size} Packs benötigt", Res.drawable.ic_deck)
}
}
}
Expand Down

0 comments on commit 74545f8

Please sign in to comment.