Skip to content

Commit

Permalink
Merge pull request #1247 from gy6543721/fix/#1237-achievements-image-…
Browse files Browse the repository at this point in the history
…size-issue

[fix/#1237] achievements image size issue
  • Loading branch information
takahirom authored Sep 29, 2023
2 parents bc95318 + 33efe29 commit 1a9febb
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package io.github.droidkaigi.confsched2023.achievements.component

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import io.github.droidkaigi.confsched2023.model.AchievementAnimation
Expand All @@ -13,10 +14,12 @@ fun AchievementImage(
achievementAnimation: AchievementAnimation,
modifier: Modifier = Modifier,
) {
val configuration = LocalConfiguration.current
val screenWidth = configuration.screenWidthDp.dp

Image(
painter = painterResource(id = achievementAnimation.getDrawableResId()),
contentDescription = achievementAnimation.contentDescription,
modifier = modifier
.padding(horizontal = 21.dp),
modifier = modifier.size(screenWidth / 3),
)
}

0 comments on commit 1a9febb

Please sign in to comment.