-
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.
ADD provide Ripple, Indication, default text style and content color
- Loading branch information
1 parent
0d2e89e
commit fc3494e
Showing
8 changed files
with
83 additions
and
6 deletions.
There are no files selected for viewing
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
26 changes: 26 additions & 0 deletions
26
core/ui/src/main/kotlin/nl/q42/template/ui/compose/composables/widgets/AppSurface.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,26 @@ | ||
package nl.q42.template.ui.compose.composables.widgets | ||
|
||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.material3.Surface | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import nl.q42.template.ui.theme.AppTheme | ||
import nl.q42.template.ui.theme.PreviewLightDark | ||
|
||
@Composable | ||
fun AppSurface(modifier: Modifier = Modifier, content: @Composable () -> Unit) { | ||
Surface( | ||
modifier = modifier, | ||
color = AppTheme.colors.surface, | ||
contentColor = AppTheme.colors.textPrimary, | ||
content = content | ||
) | ||
} | ||
|
||
@Composable | ||
@PreviewLightDark | ||
private fun AppSurfacePreview() { | ||
AppTheme { | ||
AppSurface(Modifier.fillMaxSize()) {} | ||
} | ||
} |
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
31 changes: 31 additions & 0 deletions
31
core/ui/src/main/kotlin/nl/q42/template/ui/theme/AppRipples.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,31 @@ | ||
package nl.q42.template.ui.theme | ||
|
||
import androidx.compose.foundation.Indication | ||
import androidx.compose.material.ripple.RippleAlpha | ||
import androidx.compose.material3.RippleConfiguration | ||
import androidx.compose.material3.ripple | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.ReadOnlyComposable | ||
import androidx.compose.ui.graphics.Color | ||
|
||
val AppRippleConfiguration: RippleConfiguration | ||
@Composable | ||
@ReadOnlyComposable | ||
get() = RippleConfiguration( | ||
color = AppTheme.colors.surfaceSelected | ||
) | ||
|
||
val NoRippleConfiguration: RippleConfiguration | ||
@Composable | ||
@ReadOnlyComposable | ||
get() = RippleConfiguration( | ||
color = Color.Transparent, | ||
rippleAlpha = RippleAlpha(0.0f, 0.0f, 0.0f, 0.0f) | ||
) | ||
|
||
val AppRipple: Indication | ||
@Composable | ||
@ReadOnlyComposable | ||
get() = ripple( | ||
color = AppTheme.colors.surfaceSelected | ||
) |
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