Skip to content

Commit

Permalink
Merge pull request #2340 from HedvigInsurance/ds/shimmer
Browse files Browse the repository at this point in the history
DS shimmer
  • Loading branch information
StylianosGakis authored Dec 4, 2024
2 parents 76441ed + ceede84 commit bf22d0b
Show file tree
Hide file tree
Showing 20 changed files with 173 additions and 853 deletions.
1 change: 0 additions & 1 deletion app/core/core-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ dependencies {
implementation(projects.coreResources)
implementation(projects.coreUiData)
implementation(projects.designSystemHedvig)
implementation(projects.placeholder)
}
1 change: 1 addition & 0 deletions app/design-system/design-system-hedvig/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dependencies {
api(libs.androidx.compose.foundation)
api(libs.coil.coil)
api(projects.designSystemApi)
api(projects.placeholder)

implementation(libs.androidx.activity.compose)
implementation(libs.androidx.compose.foundationLayout)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import coil.ImageLoader
import coil.compose.AsyncImage
import coil.compose.AsyncImagePainter
import coil.request.ImageRequest
import com.hedvig.android.design.system.hedvig.placeholder.PlaceholderHighlight
import com.hedvig.android.design.system.hedvig.placeholder.fade
import com.hedvig.android.design.system.hedvig.placeholder.hedvigPlaceholder
import com.hedvig.android.placeholder.PlaceholderHighlight

@Composable
internal fun FileContainer(
Expand Down Expand Up @@ -62,7 +62,11 @@ internal fun FileContainer(
},
modifier = modifier
.height(109.dp)
.hedvigPlaceholder(visible = loadedImageIntrinsicSize.value == null, highlight = PlaceholderHighlight.fade())
.hedvigPlaceholder(
visible = loadedImageIntrinsicSize.value == null,
shape = HedvigTheme.shapes.cornerMedium,
highlight = PlaceholderHighlight.fade(),
)
.clip(HedvigTheme.shapes.cornerMedium),
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ import com.hedvig.android.design.system.hedvig.HighlightLabelDefaults.HighlightS
import com.hedvig.android.design.system.hedvig.HighlightLabelDefaults.HighlightShade.MEDIUM
import com.hedvig.android.design.system.hedvig.icon.HedvigIcons
import com.hedvig.android.design.system.hedvig.icon.HelipadOutline
import com.hedvig.android.design.system.hedvig.placeholder.PlaceholderHighlight
import com.hedvig.android.design.system.hedvig.placeholder.hedvigPlaceholder
import com.hedvig.android.design.system.hedvig.placeholder.shimmer
import com.hedvig.android.placeholder.PlaceholderHighlight

@Composable
fun HedvigCard(
Expand Down Expand Up @@ -88,7 +88,11 @@ fun InsuranceCard(
painter = ColorPainter(Color.Black.copy(alpha = 0.3f)),
modifier = Modifier
.matchParentSize()
.hedvigPlaceholder(visible = true, highlight = PlaceholderHighlight.shimmer()),
.hedvigPlaceholder(
visible = true,
shape = HedvigTheme.shapes.cornerXLarge,
highlight = PlaceholderHighlight.shimmer(),
),
contentDescription = null,
)
} else {
Expand Down Expand Up @@ -129,14 +133,22 @@ fun InsuranceCard(
HedvigText(
topText,
color = HedvigTheme.colorScheme.textWhite,
modifier = Modifier.hedvigPlaceholder(visible = isLoading, highlight = PlaceholderHighlight.shimmer()),
modifier = Modifier.hedvigPlaceholder(
visible = isLoading,
shape = HedvigTheme.shapes.cornerSmall,
highlight = PlaceholderHighlight.shimmer(),
),
)
Spacer(Modifier.height(4.dp))
HedvigTheme(darkTheme = true) {
HedvigText(
text = bottomText,
color = HedvigTheme.colorScheme.textSecondaryTranslucent,
modifier = Modifier.hedvigPlaceholder(visible = isLoading, highlight = PlaceholderHighlight.shimmer()),
modifier = Modifier.hedvigPlaceholder(
visible = isLoading,
shape = HedvigTheme.shapes.cornerSmall,
highlight = PlaceholderHighlight.shimmer(),
),
)
}
}
Expand Down
Loading

0 comments on commit bf22d0b

Please sign in to comment.