Skip to content

Commit f61a0ff

Browse files
committed
Add Material Symbols import functionality
1 parent bef1056 commit f61a0ff

File tree

42 files changed

+2395
-25
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2395
-25
lines changed

compose/core/api/core.api

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
public final class io/github/composegears/valkyrie/compose/core/ModifierKt {
2+
public static final fun animatedBorder-jIwJxvA (Landroidx/compose/ui/Modifier;Ljava/util/List;Landroidx/compose/ui/graphics/Shape;FILandroidx/compose/animation/core/Easing;Landroidx/compose/runtime/Composer;II)Landroidx/compose/ui/Modifier;
3+
public static final fun applyIf (Landroidx/compose/ui/Modifier;ZLkotlin/jvm/functions/Function1;)Landroidx/compose/ui/Modifier;
4+
}
5+
16
public final class io/github/composegears/valkyrie/compose/core/RememberMutableStateKt {
27
public static final fun rememberMutableIntState (Ljava/lang/Object;Lkotlin/jvm/functions/Function0;Landroidx/compose/runtime/Composer;I)Landroidx/compose/runtime/MutableIntState;
38
public static final fun rememberMutableState (Landroidx/compose/runtime/SnapshotMutationPolicy;Lkotlin/jvm/functions/Function0;Landroidx/compose/runtime/Composer;II)Landroidx/compose/runtime/MutableState;
@@ -9,6 +14,15 @@ public final class io/github/composegears/valkyrie/compose/core/animation/Expand
914
public static final fun ExpandedAnimatedContent (Ljava/lang/Object;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;II)V
1015
}
1116

17+
public final class io/github/composegears/valkyrie/compose/core/animation/RememberShimmerKt {
18+
public static final fun rememberShimmer (FILandroidx/compose/animation/core/Easing;FFLandroidx/compose/runtime/Composer;II)Lio/github/composegears/valkyrie/compose/core/animation/Shimmer;
19+
public static final fun shimmer-TN_CM5M (Landroidx/compose/ui/Modifier;Lio/github/composegears/valkyrie/compose/core/animation/Shimmer;FZLjava/util/List;Landroidx/compose/runtime/Composer;II)Landroidx/compose/ui/Modifier;
20+
}
21+
22+
public final class io/github/composegears/valkyrie/compose/core/animation/Shimmer {
23+
public static final field $stable I
24+
}
25+
1226
public final class io/github/composegears/valkyrie/compose/core/layout/RowKt {
1327
public static final fun CenterVerticalRow (Landroidx/compose/ui/Modifier;Landroidx/compose/foundation/layout/Arrangement$Horizontal;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V
1428
}

compose/core/api/core.klib.api

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,20 @@
66
// - Show declarations: true
77

88
// Library unique name: <valkyrie.compose:core>
9+
final class io.github.composegears.valkyrie.compose.core.animation/Shimmer // io.github.composegears.valkyrie.compose.core.animation/Shimmer|null[0]
10+
11+
final val io.github.composegears.valkyrie.compose.core.animation/io_github_composegears_valkyrie_compose_core_animation_Shimmer$stableprop // io.github.composegears.valkyrie.compose.core.animation/io_github_composegears_valkyrie_compose_core_animation_Shimmer$stableprop|#static{}io_github_composegears_valkyrie_compose_core_animation_Shimmer$stableprop[0]
12+
13+
final fun (androidx.compose.ui/Modifier).io.github.composegears.valkyrie.compose.core.animation/shimmer(io.github.composegears.valkyrie.compose.core.animation/Shimmer, androidx.compose.ui.unit/Dp, kotlin/Boolean, kotlin.collections/List<androidx.compose.ui.graphics/Color>?, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int): androidx.compose.ui/Modifier // io.github.composegears.valkyrie.compose.core.animation/shimmer|[email protected](io.github.composegears.valkyrie.compose.core.animation.Shimmer;androidx.compose.ui.unit.Dp;kotlin.Boolean;kotlin.collections.List<androidx.compose.ui.graphics.Color>?;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
14+
final fun (androidx.compose.ui/Modifier).io.github.composegears.valkyrie.compose.core/animatedBorder(kotlin.collections/List<androidx.compose.ui.graphics/Color>, androidx.compose.ui.graphics/Shape?, androidx.compose.ui.unit/Dp, kotlin/Int, androidx.compose.animation.core/Easing?, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int): androidx.compose.ui/Modifier // io.github.composegears.valkyrie.compose.core/animatedBorder|[email protected](kotlin.collections.List<androidx.compose.ui.graphics.Color>;androidx.compose.ui.graphics.Shape?;androidx.compose.ui.unit.Dp;kotlin.Int;androidx.compose.animation.core.Easing?;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
915
final fun <#A: kotlin/Any?> io.github.composegears.valkyrie.compose.core.animation/ExpandedAnimatedContent(#A, androidx.compose.ui/Modifier?, kotlin/Function4<androidx.compose.animation/AnimatedContentScope, #A, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // io.github.composegears.valkyrie.compose.core.animation/ExpandedAnimatedContent|ExpandedAnimatedContent(0:0;androidx.compose.ui.Modifier?;kotlin.Function4<androidx.compose.animation.AnimatedContentScope,0:0,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){0§<kotlin.Any?>}[0]
16+
final fun io.github.composegears.valkyrie.compose.core.animation/io_github_composegears_valkyrie_compose_core_animation_Shimmer$stableprop_getter(): kotlin/Int // io.github.composegears.valkyrie.compose.core.animation/io_github_composegears_valkyrie_compose_core_animation_Shimmer$stableprop_getter|io_github_composegears_valkyrie_compose_core_animation_Shimmer$stableprop_getter(){}[0]
17+
final fun io.github.composegears.valkyrie.compose.core.animation/rememberShimmer(kotlin/Float, kotlin/Int, androidx.compose.animation.core/Easing?, kotlin/Float, kotlin/Float, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int): io.github.composegears.valkyrie.compose.core.animation/Shimmer // io.github.composegears.valkyrie.compose.core.animation/rememberShimmer|rememberShimmer(kotlin.Float;kotlin.Int;androidx.compose.animation.core.Easing?;kotlin.Float;kotlin.Float;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
1018
final inline fun (androidx.compose.foundation.layout/ColumnScope).io.github.composegears.valkyrie.compose.core.layout/VerticalSpacer(androidx.compose.ui.unit/Dp, androidx.compose.ui/Modifier?, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // io.github.composegears.valkyrie.compose.core.layout/VerticalSpacer|[email protected](androidx.compose.ui.unit.Dp;androidx.compose.ui.Modifier?;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
1119
final inline fun (androidx.compose.foundation.layout/ColumnScope).io.github.composegears.valkyrie.compose.core.layout/WeightSpacer(androidx.compose.ui/Modifier?, kotlin/Float, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // io.github.composegears.valkyrie.compose.core.layout/WeightSpacer|[email protected](androidx.compose.ui.Modifier?;kotlin.Float;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
1220
final inline fun (androidx.compose.foundation.layout/RowScope).io.github.composegears.valkyrie.compose.core.layout/HorizontalSpacer(androidx.compose.ui.unit/Dp, androidx.compose.ui/Modifier?, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // io.github.composegears.valkyrie.compose.core.layout/HorizontalSpacer|[email protected](androidx.compose.ui.unit.Dp;androidx.compose.ui.Modifier?;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
1321
final inline fun (androidx.compose.foundation.layout/RowScope).io.github.composegears.valkyrie.compose.core.layout/WeightSpacer(androidx.compose.ui/Modifier?, kotlin/Float, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // io.github.composegears.valkyrie.compose.core.layout/WeightSpacer|[email protected](androidx.compose.ui.Modifier?;kotlin.Float;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
22+
final inline fun (androidx.compose.ui/Modifier).io.github.composegears.valkyrie.compose.core/applyIf(kotlin/Boolean, kotlin/Function1<androidx.compose.ui/Modifier, androidx.compose.ui/Modifier>): androidx.compose.ui/Modifier // io.github.composegears.valkyrie.compose.core/applyIf|[email protected](kotlin.Boolean;kotlin.Function1<androidx.compose.ui.Modifier,androidx.compose.ui.Modifier>){}[0]
1423
final inline fun <#A: kotlin/Any?> io.github.composegears.valkyrie.compose.core/rememberMutableState(androidx.compose.runtime/SnapshotMutationPolicy<#A>?, crossinline kotlin/Function0<#A>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int): androidx.compose.runtime/MutableState<#A> // io.github.composegears.valkyrie.compose.core/rememberMutableState|rememberMutableState(androidx.compose.runtime.SnapshotMutationPolicy<0:0>?;kotlin.Function0<0:0>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){0§<kotlin.Any?>}[0]
1524
final inline fun <#A: kotlin/Any?> io.github.composegears.valkyrie.compose.core/rememberMutableState(kotlin/Any?, androidx.compose.runtime/SnapshotMutationPolicy<#A>?, crossinline kotlin/Function0<#A>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int): androidx.compose.runtime/MutableState<#A> // io.github.composegears.valkyrie.compose.core/rememberMutableState|rememberMutableState(kotlin.Any?;androidx.compose.runtime.SnapshotMutationPolicy<0:0>?;kotlin.Function0<0:0>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){0§<kotlin.Any?>}[0]
1625
final inline fun <#A: kotlin/Any?> io.github.composegears.valkyrie.compose.core/rememberMutableState(kotlin/Any?, kotlin/Any?, androidx.compose.runtime/SnapshotMutationPolicy<#A>?, crossinline kotlin/Function0<#A>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int): androidx.compose.runtime/MutableState<#A> // io.github.composegears.valkyrie.compose.core/rememberMutableState|rememberMutableState(kotlin.Any?;kotlin.Any?;androidx.compose.runtime.SnapshotMutationPolicy<0:0>?;kotlin.Function0<0:0>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){0§<kotlin.Any?>}[0]
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
package io.github.composegears.valkyrie.compose.core
2+
3+
import androidx.compose.animation.core.Easing
4+
import androidx.compose.animation.core.LinearEasing
5+
import androidx.compose.animation.core.RepeatMode
6+
import androidx.compose.animation.core.animateFloat
7+
import androidx.compose.animation.core.infiniteRepeatable
8+
import androidx.compose.animation.core.rememberInfiniteTransition
9+
import androidx.compose.animation.core.tween
10+
import androidx.compose.foundation.layout.padding
11+
import androidx.compose.runtime.Composable
12+
import androidx.compose.runtime.getValue
13+
import androidx.compose.ui.Modifier
14+
import androidx.compose.ui.draw.clip
15+
import androidx.compose.ui.draw.drawWithContent
16+
import androidx.compose.ui.graphics.Brush
17+
import androidx.compose.ui.graphics.Color
18+
import androidx.compose.ui.graphics.RectangleShape
19+
import androidx.compose.ui.graphics.Shape
20+
import androidx.compose.ui.graphics.drawscope.rotate
21+
import androidx.compose.ui.unit.Dp
22+
import androidx.compose.ui.unit.dp
23+
24+
inline fun Modifier.applyIf(
25+
condition: Boolean,
26+
modifier: Modifier.() -> Modifier,
27+
): Modifier {
28+
return if (condition) modifier() else this
29+
}
30+
31+
@Composable
32+
fun Modifier.animatedBorder(
33+
borderColors: List<Color>,
34+
shape: Shape = RectangleShape,
35+
borderWidth: Dp = 2.dp,
36+
durationInMillis: Int = 1000,
37+
easing: Easing = LinearEasing,
38+
): Modifier {
39+
val brush = Brush.sweepGradient(borderColors)
40+
val infiniteTransition = rememberInfiniteTransition(label = "animatedBorder")
41+
val angle by infiniteTransition.animateFloat(
42+
initialValue = 0f,
43+
targetValue = 360f,
44+
animationSpec = infiniteRepeatable(
45+
animation = tween(durationMillis = durationInMillis, easing = easing),
46+
repeatMode = RepeatMode.Restart,
47+
),
48+
label = "angleAnimation",
49+
)
50+
51+
return this
52+
.clip(shape)
53+
.padding(borderWidth)
54+
.drawWithContent {
55+
rotate(angle) {
56+
drawCircle(
57+
brush = brush,
58+
radius = size.width,
59+
)
60+
}
61+
drawContent()
62+
}
63+
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
package io.github.composegears.valkyrie.compose.core.animation
2+
3+
import androidx.compose.animation.core.Easing
4+
import androidx.compose.animation.core.FastOutSlowInEasing
5+
import androidx.compose.animation.core.animateFloat
6+
import androidx.compose.animation.core.infiniteRepeatable
7+
import androidx.compose.animation.core.rememberInfiniteTransition
8+
import androidx.compose.animation.core.tween
9+
import androidx.compose.runtime.Composable
10+
import androidx.compose.runtime.State
11+
import androidx.compose.ui.Modifier
12+
import androidx.compose.ui.draw.drawWithContent
13+
import androidx.compose.ui.geometry.CornerRadius
14+
import androidx.compose.ui.geometry.Offset
15+
import androidx.compose.ui.graphics.Brush
16+
import androidx.compose.ui.graphics.Color
17+
import androidx.compose.ui.unit.Dp
18+
import androidx.compose.ui.unit.dp
19+
20+
/** Container holding shared shimmer animation state. */
21+
class Shimmer internal constructor(
22+
internal val translateState: State<Float>,
23+
internal val gradientWidthFactor: Float,
24+
)
25+
26+
/**
27+
* Remember a single shimmer animation instance you can pass to many items.
28+
* Usage:
29+
* val shimmer = rememberShimmer()
30+
* LazyColumn { items(data) { Row(Modifier.shimmer(shimmer).height(48.dp)) } }
31+
*/
32+
@Composable
33+
fun rememberShimmer(
34+
gradientWidthFactor: Float = 1.5f,
35+
durationMillis: Int = 2200,
36+
easing: Easing = FastOutSlowInEasing,
37+
initialTranslate: Float = -400f,
38+
targetTranslate: Float = 1200f,
39+
): Shimmer {
40+
val transition = rememberInfiniteTransition(label = "RememberShimmer")
41+
val translateState = transition.animateFloat(
42+
initialValue = initialTranslate,
43+
targetValue = targetTranslate,
44+
animationSpec = infiniteRepeatable(
45+
animation = tween(durationMillis = durationMillis, easing = easing),
46+
),
47+
label = "RememberShimmerTranslate",
48+
)
49+
return Shimmer(translateState, gradientWidthFactor)
50+
}
51+
52+
/** Apply a remembered shimmer to this modifier. */
53+
@Composable
54+
fun Modifier.shimmer(
55+
shimmer: Shimmer,
56+
cornerRadius: Dp = 0.dp,
57+
isLoading: Boolean = true,
58+
colors: List<Color> = listOf(
59+
Color.LightGray.copy(alpha = 0.3f),
60+
Color.White.copy(alpha = 0.8f),
61+
Color.LightGray.copy(alpha = 0.3f),
62+
),
63+
): Modifier {
64+
if (!isLoading) return this
65+
66+
return drawWithContent {
67+
val translate = shimmer.translateState.value
68+
val cornerPx = cornerRadius.toPx()
69+
val brush = Brush.linearGradient(
70+
colors = colors,
71+
start = Offset(translate, 0f),
72+
end = Offset(translate + size.width / shimmer.gradientWidthFactor, size.height),
73+
)
74+
drawRoundRect(
75+
brush = brush,
76+
cornerRadius = CornerRadius(cornerPx, cornerPx),
77+
size = size,
78+
)
79+
}
80+
}

compose/icons/api/icons.api

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ public final class io/github/composegears/valkyrie/compose/icons/idea/SettingsKt
4343
public static final fun getSettings (Lio/github/composegears/valkyrie/compose/icons/ValkyrieIcons$Idea;)Landroidx/compose/ui/graphics/vector/ImageVector;
4444
}
4545

46+
public final class io/github/composegears/valkyrie/compose/icons/outlined/ArrowDownKt {
47+
public static final fun getArrowDown (Lio/github/composegears/valkyrie/compose/icons/ValkyrieIcons$Outlined;)Landroidx/compose/ui/graphics/vector/ImageVector;
48+
}
49+
4650
public final class io/github/composegears/valkyrie/compose/icons/outlined/BackKt {
4751
public static final fun getBack (Lio/github/composegears/valkyrie/compose/icons/ValkyrieIcons$Outlined;)Landroidx/compose/ui/graphics/vector/ImageVector;
4852
}
@@ -67,7 +71,15 @@ public final class io/github/composegears/valkyrie/compose/icons/outlined/LightK
6771
public static final fun getLight (Lio/github/composegears/valkyrie/compose/icons/ValkyrieIcons$Outlined;)Landroidx/compose/ui/graphics/vector/ImageVector;
6872
}
6973

74+
public final class io/github/composegears/valkyrie/compose/icons/outlined/SearchKt {
75+
public static final fun getSearch (Lio/github/composegears/valkyrie/compose/icons/ValkyrieIcons$Outlined;)Landroidx/compose/ui/graphics/vector/ImageVector;
76+
}
77+
7078
public final class io/github/composegears/valkyrie/compose/icons/outlined/SettingsKt {
7179
public static final fun getSettings (Lio/github/composegears/valkyrie/compose/icons/ValkyrieIcons$Outlined;)Landroidx/compose/ui/graphics/vector/ImageVector;
7280
}
7381

82+
public final class io/github/composegears/valkyrie/compose/icons/outlined/TuneKt {
83+
public static final fun getTune (Lio/github/composegears/valkyrie/compose/icons/ValkyrieIcons$Outlined;)Landroidx/compose/ui/graphics/vector/ImageVector;
84+
}
85+

0 commit comments

Comments
 (0)