Skip to content

Refactor UI to strict Material Design 3#12

Open
Max97k wants to merge 1 commit into
mainfrom
m3-ui-refactoring-1238639963804352306
Open

Refactor UI to strict Material Design 3#12
Max97k wants to merge 1 commit into
mainfrom
m3-ui-refactoring-1238639963804352306

Conversation

@Max97k

@Max97k Max97k commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Refactors the entire application UI to strictly comply with Jetpack Compose Material Design 3 guidelines. Replaces raw column groupings with standard Card components implementing tonalElevation (via surfaceVariant background color). Replaces all hardcoded colors with MaterialTheme.colorScheme variants, effectively supporting dynamic color correctly everywhere. Fixes empty Typography and Shapes implementations with standard M3 values.


PR created automatically by Jules for task 1238639963804352306 started by @Max97k

- Add standard Material 3 Typography and Shape definitions.
- Hook up Typography and Shapes to the root MaterialTheme.
- Migrate TrackingScreen to standard M3 Cards and remove legacy text colors.
- Migrate HistoryScreen to M3 Cards with surfaceVariant coloration for tonal elevation.
- Migrate SettingsScreen grouped sections to M3 Cards.
- Migrate RoutineAnalysisScreen to M3 Cards.
- Migrate PermissionScreen elements to M3 Cards.
- Clean up unused string/variables triggered during cleanup.

Co-authored-by: Max97k <14903047+Max97k@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors several screens (History, Permission, Routine Analysis, Settings, and Tracking) to wrap UI components in Cards with a surfaceVariant background and apply Material 3 compliant colors. It also integrates custom shapes and typography into the application theme. The review feedback suggests improving performance by replacing an inefficient Surface with a lightweight Box for drawing simple shapes, and recommends moving several hardcoded user-facing strings, labels, and units into resource files to support proper localization.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

}
Row(verticalAlignment = Alignment.CenterVertically) {
// Color block
Surface(color = color, modifier = Modifier.size(16.dp), shape = MaterialTheme.shapes.small) {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using Surface just to draw a simple colored shape is inefficient because Surface is a relatively heavy composable that handles elevation, borders, and input interception. Instead, use a lightweight Box with background and clip modifiers.

Suggested change
Surface(color = color, modifier = Modifier.size(16.dp), shape = MaterialTheme.shapes.small) {}
Box(modifier = Modifier.size(16.dp).background(color, MaterialTheme.shapes.small))

Surface(color = color, modifier = Modifier.size(16.dp), shape = MaterialTheme.shapes.small) {}
Spacer(modifier = Modifier.width(8.dp))
Text(
text = "${state.name}: $hours h $minutes min",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Avoid hardcoding user-facing strings and time unit labels like 'h' and 'min'. These should be defined as a plural or formatted string resource in strings.xml to support proper localization and internationalization (i18n).

Suggested change
text = "${state.name}: $hours h $minutes min",
text = stringResource(R.string.routine_state_duration, state.name, hours, minutes),

)
} else {
Box(modifier = Modifier.fillMaxWidth().height(250.dp), contentAlignment = Alignment.Center) {
Text("No tracking time accumulated", style = MaterialTheme.typography.titleMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Avoid hardcoding user-facing text. Use stringResource to load the string from strings.xml to ensure the application can be localized.

Suggested change
Text("No tracking time accumulated", style = MaterialTheme.typography.titleMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)
Text(stringResource(R.string.routine_no_tracking_time), style = MaterialTheme.typography.titleMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)

}
} else {
Box(modifier = Modifier.fillMaxWidth().height(250.dp), contentAlignment = Alignment.Center) {
Text("No data for this day", style = MaterialTheme.typography.titleMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Avoid hardcoding user-facing text. Use stringResource to load the string from strings.xml to ensure the application can be localized.

Suggested change
Text("No data for this day", style = MaterialTheme.typography.titleMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)
Text(stringResource(R.string.routine_no_data), style = MaterialTheme.typography.titleMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)

Comment on lines +161 to +162
Text(text = "Lat: ${currentLocation?.latitude}, Lon: ${currentLocation?.longitude}", style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)
Text(text = "Alt: ${currentLocation?.altitude}m, Speed: ${currentLocation?.speed}m/s", style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Avoid hardcoding labels ('Lat:', 'Lon:', 'Alt:', 'Speed:') and units ('m', 'm/s') directly in the code. These should be defined as formatted string resources in strings.xml to support localization.

Suggested change
Text(text = "Lat: ${currentLocation?.latitude}, Lon: ${currentLocation?.longitude}", style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)
Text(text = "Alt: ${currentLocation?.altitude}m, Speed: ${currentLocation?.speed}m/s", style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)
Text(text = stringResource(R.string.track_lat_lon, currentLocation?.latitude ?: 0.0, currentLocation?.longitude ?: 0.0), style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)\n Text(text = stringResource(R.string.track_alt_speed, currentLocation?.altitude ?: 0.0, currentLocation?.speed ?: 0f), style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant