-
Notifications
You must be signed in to change notification settings - Fork 61
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 #615 from zsoltk/material-nav
Material navigation helpers
- Loading branch information
Showing
69 changed files
with
1,268 additions
and
107 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
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
22 changes: 22 additions & 0 deletions
22
...mon/src/commonMain/kotlin/com/bumble/appyx/components/spotlight/ui/fader/TargetUiState.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,22 @@ | ||
package com.bumble.appyx.components.spotlight.ui.fader | ||
|
||
import com.bumble.appyx.interactions.core.ui.context.UiContext | ||
import com.bumble.appyx.interactions.core.ui.property.impl.Alpha | ||
import com.bumble.appyx.interactions.core.ui.state.MutableUiStateSpecs | ||
|
||
@MutableUiStateSpecs | ||
class TargetUiState( | ||
val alpha: Alpha.Target, | ||
) { | ||
constructor(base: TargetUiState) : this( | ||
alpha = base.alpha, | ||
) | ||
|
||
fun toMutableState( | ||
uiContext: UiContext, | ||
): MutableUiState = | ||
MutableUiState( | ||
uiContext = uiContext, | ||
alpha = Alpha(uiContext, alpha), | ||
) | ||
} |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
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
2 changes: 1 addition & 1 deletion
2
appyx-interactions/android/src/main/kotlin/com/bumble/appyx/interactions/theme/Shape.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
104 changes: 72 additions & 32 deletions
104
appyx-interactions/android/src/main/kotlin/com/bumble/appyx/interactions/theme/Theme.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 |
---|---|---|
@@ -1,50 +1,90 @@ | ||
package com.bumble.appyx.interactions.theme | ||
|
||
import androidx.compose.foundation.isSystemInDarkTheme | ||
import androidx.compose.material.MaterialTheme | ||
import androidx.compose.material.darkColors | ||
import androidx.compose.material.lightColors | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.lightColorScheme | ||
import androidx.compose.material3.darkColorScheme | ||
import androidx.compose.runtime.Composable | ||
|
||
private val DarkColorPalette = darkColors( | ||
primary = appyx_yellow1, | ||
primaryVariant = appyx_yellow2, | ||
secondary = appyx_yellow2, | ||
background = appyx_dark, | ||
surface = appyx_dark, | ||
onPrimary = appyx_bright, | ||
onSecondary = appyx_bright, | ||
onBackground = appyx_bright, | ||
onSurface = appyx_bright, | ||
|
||
private val LightColors = lightColorScheme( | ||
primary = md_theme_light_primary, | ||
onPrimary = md_theme_light_onPrimary, | ||
primaryContainer = md_theme_light_primaryContainer, | ||
onPrimaryContainer = md_theme_light_onPrimaryContainer, | ||
secondary = md_theme_light_secondary, | ||
onSecondary = md_theme_light_onSecondary, | ||
secondaryContainer = md_theme_light_secondaryContainer, | ||
onSecondaryContainer = md_theme_light_onSecondaryContainer, | ||
tertiary = md_theme_light_tertiary, | ||
onTertiary = md_theme_light_onTertiary, | ||
tertiaryContainer = md_theme_light_tertiaryContainer, | ||
onTertiaryContainer = md_theme_light_onTertiaryContainer, | ||
error = md_theme_light_error, | ||
errorContainer = md_theme_light_errorContainer, | ||
onError = md_theme_light_onError, | ||
onErrorContainer = md_theme_light_onErrorContainer, | ||
background = md_theme_light_background, | ||
onBackground = md_theme_light_onBackground, | ||
surface = md_theme_light_surface, | ||
onSurface = md_theme_light_onSurface, | ||
surfaceVariant = md_theme_light_surfaceVariant, | ||
onSurfaceVariant = md_theme_light_onSurfaceVariant, | ||
outline = md_theme_light_outline, | ||
inverseOnSurface = md_theme_light_inverseOnSurface, | ||
inverseSurface = md_theme_light_inverseSurface, | ||
inversePrimary = md_theme_light_inversePrimary, | ||
surfaceTint = md_theme_light_surfaceTint, | ||
outlineVariant = md_theme_light_outlineVariant, | ||
scrim = md_theme_light_scrim, | ||
) | ||
|
||
private val LightColorPalette = lightColors( | ||
primary = appyx_yellow1, | ||
primaryVariant = appyx_yellow2, | ||
secondary = appyx_yellow2, | ||
background = appyx_bright, | ||
surface = appyx_bright, | ||
onPrimary = appyx_dark, | ||
onSecondary = appyx_dark, | ||
onBackground = appyx_dark, | ||
onSurface = appyx_dark, | ||
|
||
private val DarkColors = darkColorScheme( | ||
primary = md_theme_dark_primary, | ||
onPrimary = md_theme_dark_onPrimary, | ||
primaryContainer = md_theme_dark_primaryContainer, | ||
onPrimaryContainer = md_theme_dark_onPrimaryContainer, | ||
secondary = md_theme_dark_secondary, | ||
onSecondary = md_theme_dark_onSecondary, | ||
secondaryContainer = md_theme_dark_secondaryContainer, | ||
onSecondaryContainer = md_theme_dark_onSecondaryContainer, | ||
tertiary = md_theme_dark_tertiary, | ||
onTertiary = md_theme_dark_onTertiary, | ||
tertiaryContainer = md_theme_dark_tertiaryContainer, | ||
onTertiaryContainer = md_theme_dark_onTertiaryContainer, | ||
error = md_theme_dark_error, | ||
errorContainer = md_theme_dark_errorContainer, | ||
onError = md_theme_dark_onError, | ||
onErrorContainer = md_theme_dark_onErrorContainer, | ||
background = md_theme_dark_background, | ||
onBackground = md_theme_dark_onBackground, | ||
surface = md_theme_dark_surface, | ||
onSurface = md_theme_dark_onSurface, | ||
surfaceVariant = md_theme_dark_surfaceVariant, | ||
onSurfaceVariant = md_theme_dark_onSurfaceVariant, | ||
outline = md_theme_dark_outline, | ||
inverseOnSurface = md_theme_dark_inverseOnSurface, | ||
inverseSurface = md_theme_dark_inverseSurface, | ||
inversePrimary = md_theme_dark_inversePrimary, | ||
surfaceTint = md_theme_dark_surfaceTint, | ||
outlineVariant = md_theme_dark_outlineVariant, | ||
scrim = md_theme_dark_scrim, | ||
) | ||
|
||
@Composable | ||
fun AppyxTheme( | ||
darkTheme: Boolean = isSystemInDarkTheme(), | ||
content: @Composable () -> Unit) | ||
{ | ||
val colors = if (darkTheme) { | ||
DarkColorPalette | ||
useDarkTheme: Boolean = isSystemInDarkTheme(), | ||
content: @Composable() () -> Unit | ||
) { | ||
val colors = if (!useDarkTheme) { | ||
LightColors | ||
} else { | ||
LightColorPalette | ||
DarkColors | ||
} | ||
|
||
MaterialTheme( | ||
colors = colors, | ||
typography = Typography, | ||
shapes = Shapes, | ||
colorScheme = colors, | ||
content = content | ||
) | ||
} |
4 changes: 2 additions & 2 deletions
4
appyx-interactions/android/src/main/kotlin/com/bumble/appyx/interactions/theme/Type.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
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.