-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from team-haribo/feature/48-creating-skeleton-…
…loading 🔀 :: (#48) - creating skeleton loading
- Loading branch information
Showing
21 changed files
with
685 additions
and
346 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...omponent/modifier/MultipleEventsCutter.kt → ...mponent/clickable/MultipleEventsCutter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ystem/component/modifier/gomsClickable.kt → ...stem/component/clickable/gomsClickable.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
core/design-system/src/main/java/com/goms/design_system/component/shimmer/ShimmerBrush.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.goms.design_system.component.shimmer | ||
|
||
import androidx.compose.animation.core.FastOutSlowInEasing | ||
import androidx.compose.animation.core.RepeatMode | ||
import androidx.compose.animation.core.animateFloat | ||
import androidx.compose.animation.core.infiniteRepeatable | ||
import androidx.compose.animation.core.rememberInfiniteTransition | ||
import androidx.compose.animation.core.tween | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.geometry.Offset | ||
import androidx.compose.ui.graphics.Brush | ||
import androidx.compose.ui.graphics.Color | ||
|
||
@Composable | ||
fun ShimmerBrush( | ||
color: Color = Color.LightGray, | ||
targetValue: Float = 1300f | ||
): Brush { | ||
val shimmerColors = listOf( | ||
color.copy(alpha = 0.15f), | ||
color.copy(alpha = 0.13f), | ||
color.copy(alpha = 0.1f), | ||
color.copy(alpha = 0.13f), | ||
color.copy(alpha = 0.15f), | ||
) | ||
|
||
val transition = rememberInfiniteTransition() | ||
val translateAnimation = transition.animateFloat( | ||
initialValue = 0f, | ||
targetValue = targetValue, | ||
animationSpec = infiniteRepeatable( | ||
animation = tween( | ||
durationMillis = 1000, | ||
easing = FastOutSlowInEasing | ||
), repeatMode = RepeatMode.Restart | ||
) | ||
) | ||
|
||
return Brush.linearGradient( | ||
colors = shimmerColors, | ||
start = Offset.Zero, | ||
end = Offset(x = translateAnimation.value, y = translateAnimation.value) | ||
) | ||
} |
20 changes: 20 additions & 0 deletions
20
core/design-system/src/main/java/com/goms/design_system/component/shimmer/shimmerEffect.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.goms.design_system.component.shimmer | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.shape.CircleShape | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.composed | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.graphics.Shape | ||
|
||
fun Modifier.shimmerEffect( | ||
color: Color = Color.LightGray, | ||
targetValue: Float = 1300f, | ||
shape: Shape = CircleShape | ||
) = composed { | ||
val brush = ShimmerBrush( | ||
color = color, | ||
targetValue = targetValue | ||
) | ||
this.then(background(brush, shape)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.