-
Notifications
You must be signed in to change notification settings - Fork 0
feat: refine Android UI with muted pastel expressive design #2
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
Open
olavbg
wants to merge
7
commits into
main
Choose a base branch
from
design/muted-pastel-expressive-background
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6d831df
feat: add reusable animated diagonal background
olavbg 4206419
refactor: refresh JavaZone palette with muted pastel tones
olavbg 5f7d292
feat: apply muted pastel Material 3 theme and animated background
olavbg 966aa4d
refactor: use cleaner restrained component shapes
olavbg c21d66e
fix: let animated theme background show through scaffolds
olavbg 8158f99
refactor: make surfaces subtly translucent over expressive background
olavbg 817d5a0
refactor: clean up animated background imports
olavbg 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
71 changes: 71 additions & 0 deletions
71
app/src/main/java/com/olavbg/javazone/ui/components/AnimatedDiagonalBackground.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 |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| package com.olavbg.javazone.ui.components | ||
|
|
||
| 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.foundation.Canvas | ||
| import androidx.compose.foundation.layout.Box | ||
| import androidx.compose.foundation.layout.fillMaxSize | ||
| import androidx.compose.material3.MaterialTheme | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.runtime.getValue | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.graphics.Path | ||
| import androidx.compose.ui.graphics.drawscope.clipPath | ||
|
|
||
| /** | ||
| * Subtle JavaZone background: two calm tones separated by a slowly moving diagonal. | ||
| * Kept deliberately low contrast so foreground content remains the visual priority. | ||
| */ | ||
| @Composable | ||
| fun AnimatedDiagonalBackground( | ||
| modifier: Modifier = Modifier, | ||
| content: @Composable () -> Unit, | ||
| ) { | ||
| val transition = rememberInfiniteTransition(label = "diagonal-background") | ||
| val sway by transition.animateFloat( | ||
| initialValue = -0.08f, | ||
| targetValue = 0.08f, | ||
| animationSpec = infiniteRepeatable( | ||
| animation = tween(durationMillis = 9000), | ||
| repeatMode = RepeatMode.Reverse, | ||
| ), | ||
| label = "diagonal-sway", | ||
| ) | ||
|
|
||
| val firstTone = MaterialTheme.colorScheme.surfaceContainerLowest | ||
| val secondTone = MaterialTheme.colorScheme.surfaceContainerLow | ||
|
|
||
| Box(modifier = modifier) { | ||
| Canvas(modifier = Modifier.fillMaxSize()) { | ||
| val diagonalX = size.width * (0.52f + sway) | ||
|
|
||
| val firstPath = Path().apply { | ||
| moveTo(0f, 0f) | ||
| lineTo(diagonalX, 0f) | ||
| lineTo(0f, size.height) | ||
| close() | ||
| } | ||
| clipPath(firstPath) { | ||
| drawRect(color = firstTone) | ||
| } | ||
|
|
||
| val secondPath = Path().apply { | ||
| moveTo(diagonalX, 0f) | ||
| lineTo(size.width, 0f) | ||
| lineTo(size.width, size.height) | ||
| lineTo(0f, size.height) | ||
| close() | ||
| } | ||
| clipPath(secondPath) { | ||
| drawRect(color = secondTone) | ||
| } | ||
| } | ||
|
|
||
| Box(modifier = Modifier.fillMaxSize()) { | ||
| content() | ||
| } | ||
| } | ||
| } |
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
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.
In light mode, this makes
colorScheme.backgroundtransparent black rather than the former light color.TimelineStickyTimeHeaderthen callsMaterialTheme.colorScheme.background.copy(alpha = 0.95f)inTimelineScreen.kt:579, which replaces only the alpha and produces an almost opaque black header; its session-count text remains the darkonSurfaceVariantcolor, making that information very difficult to read. Use an opaque light background for this scheme or change the header to derive its scrim from a nontransparent surface color.Useful? React with 👍 / 👎.