-
Notifications
You must be signed in to change notification settings - Fork 27
[#603] Refactor to use Material3 #605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ryan-conway
merged 1 commit into
develop
from
chore/603-update-to-use-material-3-library-instead-of-old-material-library
Jun 6, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
27 changes: 15 additions & 12 deletions
27
sample-compose/app/src/main/java/co/nimblehq/sample/compose/ui/theme/AppColors.kt
This file contains hidden or 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,28 +1,31 @@ | ||
| package co.nimblehq.sample.compose.ui.theme | ||
|
|
||
| import androidx.compose.material.* | ||
| import androidx.compose.material3.ColorScheme | ||
| import androidx.compose.material3.darkColorScheme | ||
| import androidx.compose.material3.lightColorScheme | ||
| import androidx.compose.runtime.staticCompositionLocalOf | ||
| import androidx.compose.ui.graphics.Color | ||
|
|
||
| // Base colors here | ||
| internal val GreenCitrus = Color(0xFF99CC00) | ||
|
|
||
| /** | ||
| * Expand the final [Colors] class to provide more custom app colors. | ||
| * Expand the final [ColorScheme] class to provide more custom app colors. | ||
| */ | ||
| data class AppColors( | ||
| val themeColors: Colors, | ||
| abstract class AppColors( | ||
| var colorScheme: ColorScheme = LightColorPalette, | ||
|
|
||
| // Custom colors here | ||
| val topAppBarBackground: Color = GreenCitrus | ||
| ) | ||
| ) { | ||
| open val themeColors: ColorScheme | ||
| get() = colorScheme | ||
| } | ||
|
|
||
| internal val LightColorPalette = AppColors( | ||
| themeColors = lightColors() | ||
| ) | ||
| internal val LightColorPalette: ColorScheme = lightColorScheme() | ||
|
|
||
| internal val DarkColorPalette = AppColors( | ||
| themeColors = darkColors() | ||
| ) | ||
| internal val DarkColorPalette: ColorScheme = darkColorScheme() | ||
|
|
||
| internal val LocalAppColors = staticCompositionLocalOf { LightColorPalette } | ||
| internal object AppColorsImpl : AppColors() | ||
|
|
||
| internal val LocalAppColors = staticCompositionLocalOf<AppColors> { AppColorsImpl } |
15 changes: 10 additions & 5 deletions
15
sample-compose/app/src/main/java/co/nimblehq/sample/compose/ui/theme/AppShapes.kt
This file contains hidden or 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,10 +1,15 @@ | ||
| package co.nimblehq.sample.compose.ui.theme | ||
|
|
||
| import androidx.compose.material.Shapes | ||
| import androidx.compose.material3.Shapes | ||
| import androidx.compose.runtime.staticCompositionLocalOf | ||
|
|
||
| private val Shapes = Shapes( | ||
| // Custom shapes here | ||
| ) | ||
| interface AppShapes { | ||
| val themeShapes: Shapes | ||
| get() = Shapes( | ||
| // Custom shapes here | ||
| ) | ||
| } | ||
|
|
||
| internal val LocalAppShapes = staticCompositionLocalOf { Shapes } | ||
| object AppShapesImpl : AppShapes | ||
|
|
||
| internal val LocalAppShapes = staticCompositionLocalOf<AppShapes> { AppShapesImpl } |
12 changes: 8 additions & 4 deletions
12
sample-compose/app/src/main/java/co/nimblehq/sample/compose/ui/theme/AppTypography.kt
This file contains hidden or 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,10 +1,14 @@ | ||
| package co.nimblehq.sample.compose.ui.theme | ||
|
|
||
| import androidx.compose.material.Typography | ||
| import androidx.compose.material3.Typography | ||
| import androidx.compose.runtime.staticCompositionLocalOf | ||
|
|
||
| private val Typography = Typography( | ||
| interface AppTypography { | ||
| // Custom typography here | ||
| ) | ||
| val themeTypography: Typography | ||
| get() = Typography() | ||
| } | ||
|
|
||
| internal val LocalAppTypography = staticCompositionLocalOf { Typography } | ||
| object AppTypographyImpl : AppTypography | ||
|
|
||
| internal val LocalAppTypography = staticCompositionLocalOf<AppTypography> { AppTypographyImpl } |
This file contains hidden or 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 hidden or 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 hidden or 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
28 changes: 16 additions & 12 deletions
28
template-compose/app/src/main/java/co/nimblehq/template/compose/ui/theme/AppColors.kt
This file contains hidden or 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,26 +1,30 @@ | ||
| package co.nimblehq.template.compose.ui.theme | ||
|
|
||
| import androidx.compose.material.* | ||
| import androidx.compose.material3.ColorScheme | ||
| import androidx.compose.material3.darkColorScheme | ||
| import androidx.compose.material3.lightColorScheme | ||
| import androidx.compose.runtime.staticCompositionLocalOf | ||
|
|
||
| // Base colors here | ||
| // e.g. internal val GreenCitrus = Color(0xFF99CC00) | ||
|
|
||
| /** | ||
| * Expand the final [Colors] class to provide more custom app colors. | ||
| * Expand the final [ColorScheme] class to provide more custom app colors. | ||
| */ | ||
| data class AppColors( | ||
| val themeColors: Colors | ||
| abstract class AppColors( | ||
| var colorScheme: ColorScheme = LightColorPalette, | ||
|
|
||
| // Custom colors here | ||
| ) | ||
| ) { | ||
| open val themeColors: ColorScheme | ||
| get() = colorScheme | ||
| } | ||
|
|
||
| internal val LightColorPalette = AppColors( | ||
| themeColors = lightColors() | ||
| ) | ||
| internal val LightColorPalette: ColorScheme = lightColorScheme() | ||
|
|
||
| internal val DarkColorPalette = AppColors( | ||
| themeColors = darkColors() | ||
| ) | ||
| internal val DarkColorPalette: ColorScheme = darkColorScheme() | ||
|
|
||
| internal object AppColorsImpl : AppColors() | ||
|
|
||
| internal val LocalAppColors = staticCompositionLocalOf<AppColors> { AppColorsImpl } | ||
|
|
||
| internal val LocalAppColors = staticCompositionLocalOf { LightColorPalette } |
15 changes: 10 additions & 5 deletions
15
template-compose/app/src/main/java/co/nimblehq/template/compose/ui/theme/AppShapes.kt
This file contains hidden or 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,10 +1,15 @@ | ||
| package co.nimblehq.template.compose.ui.theme | ||
|
|
||
| import androidx.compose.material.Shapes | ||
| import androidx.compose.material3.Shapes | ||
| import androidx.compose.runtime.staticCompositionLocalOf | ||
|
|
||
| private val Shapes = Shapes( | ||
| // Custom shapes here | ||
| ) | ||
| interface AppShapes { | ||
| val themeShapes: Shapes | ||
| get() = Shapes( | ||
| // Custom shapes here | ||
| ) | ||
| } | ||
|
|
||
| internal val LocalAppShapes = staticCompositionLocalOf { Shapes } | ||
| object AppShapesImpl : AppShapes | ||
|
|
||
| internal val LocalAppShapes = staticCompositionLocalOf<AppShapes> { AppShapesImpl } |
13 changes: 9 additions & 4 deletions
13
template-compose/app/src/main/java/co/nimblehq/template/compose/ui/theme/AppTypography.kt
This file contains hidden or 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,10 +1,15 @@ | ||
| package co.nimblehq.template.compose.ui.theme | ||
|
|
||
| import androidx.compose.material.Typography | ||
| import androidx.compose.material3.Typography | ||
| import androidx.compose.runtime.staticCompositionLocalOf | ||
|
|
||
| private val Typography = Typography( | ||
| interface AppTypography { | ||
| // Custom typography here | ||
| ) | ||
| val themeTypography: Typography | ||
| get() = Typography() | ||
| } | ||
|
|
||
| object AppTypographyImpl : AppTypography | ||
|
|
||
| internal val LocalAppTypography = staticCompositionLocalOf<AppTypography> { AppTypographyImpl } | ||
|
|
||
| internal val LocalAppTypography = staticCompositionLocalOf { Typography } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant line