Skip to content

Add typography to compose theme#3581

Merged
andreia-ferreira merged 3 commits intomasterfrom
andreia/3441/add-typography
Feb 25, 2026
Merged

Add typography to compose theme#3581
andreia-ferreira merged 3 commits intomasterfrom
andreia/3441/add-typography

Conversation

@andreia-ferreira
Copy link
Collaborator

Fixes #3441

To ensure consistency between XML components and migrated Compose screens, the same typography configuration needs to be applied. Currently styles.xml sets the fontFamily for the entire app. However, the Compose theme does not mirror this setup, which results in Compose components falling back to the default system font (Roboto).

This PR introduces a centralized Typography which adds the expected M3 styles based on the current XML theme and the Figma designs.

The composables which were manually setting the font family were simplified to use the corresponding style where possible. Redundant Text usages explicitly setting the same style as bodyLarge (which is already its default style) have been simplified.

Before:

Screen_recording_20260224_175713.webm

After:

Screen_recording_20260224_175509.webm

@shobhitagarwal1612 PTAL?

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @andreia-ferreira, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses the inconsistency in typography between XML components and Compose screens. It introduces a centralized Typography configuration to ensure that Compose components use the same font family as the rest of the app, as defined in styles.xml. This change aligns the Compose theme with the XML theme and Figma designs, resulting in a more visually consistent user interface.

Highlights

  • Typography Consistency: Ensures consistent typography between XML components and Compose screens by applying a centralized Typography configuration.
  • M3 Styles: Adds expected Material Design 3 (M3) styles based on the current XML theme and Figma designs.
  • Code Simplification: Simplifies composables by using corresponding styles where possible and removing redundant Text usages.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • DataSubmissionConfirmationScreen.kt
    • Replaced manual font configurations with MaterialTheme typography styles.
  • DownloadProgressDialog.kt
    • Removed explicit fontFamily settings, utilizing MaterialTheme typography.
  • HeaderRow.kt
    • Replaced manual font configurations with MaterialTheme typography styles.
  • InstructionTaskFragment.kt
    • Replaced manual font size with MaterialTheme typography style.
  • LocationAccuracyCard.kt
    • Removed explicit font weight and relied on MaterialTheme typography.
  • LoiJobSheet.kt
    • Replaced manual font size with MaterialTheme typography style.
  • OfflineAreaListItem.kt
    • Removed explicit TextStyle and fontFamily, using MaterialTheme typography instead.
  • SectionHeader.kt
    • Replaced manual font configurations with MaterialTheme typography styles.
  • SignInScreen.kt
    • Replaced manual font configurations with MaterialTheme typography styles.
  • SurveyCardItem.kt
    • Replaced manual font configurations with MaterialTheme typography styles.
  • SyncListItem.kt
    • Replaced manual font configurations with MaterialTheme typography styles.
  • Theme.kt
    • Added typography to MaterialTheme.
  • Typography.kt
    • Added new Typography file to define text styles.
  • display_500.xml
    • Removed font resource file.
Activity
  • The PR author, andreia-ferreira, has requested a review from shobhitagarwal1612.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

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

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 introduces a centralized Typography to ensure consistency between XML components and Compose screens by applying M3 styles based on the current XML theme and Figma designs. The changes include removing manual font configurations in composables and utilizing the new Typography definitions. The copyright header in the new file Typography.kt has been updated to the current year.

@codecov
Copy link

codecov bot commented Feb 24, 2026

Codecov Report

❌ Patch coverage is 98.14815% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.12%. Comparing base (6f4620e) to head (d6f855a).

Files with missing lines Patch % Lines
.../org/groundplatform/android/ui/theme/Typography.kt 97.64% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3581      +/-   ##
============================================
+ Coverage     71.02%   71.12%   +0.10%     
  Complexity     1631     1631              
============================================
  Files           331      332       +1     
  Lines          8956     8995      +39     
  Branches        998      998              
============================================
+ Hits           6361     6398      +37     
- Misses         1999     2001       +2     
  Partials        596      596              
Files with missing lines Coverage Δ
...datacollection/DataSubmissionConfirmationScreen.kt 71.11% <100.00%> (-4.37%) ⬇️
...ction/tasks/instruction/InstructionTaskFragment.kt 92.85% <100.00%> (ø)
...acollection/tasks/location/LocationAccuracyCard.kt 97.14% <ø> (-0.08%) ⬇️
...m/android/ui/home/mapcontainer/jobs/LoiJobSheet.kt 68.70% <100.00%> (ø)
...orm/android/ui/offlineareas/OfflineAreaListItem.kt 79.41% <100.00%> (-4.68%) ⬇️
...ui/offlineareas/selector/DownloadProgressDialog.kt 96.77% <100.00%> (-0.37%) ⬇️
...g/groundplatform/android/ui/signin/SignInScreen.kt 65.56% <100.00%> (-0.46%) ⬇️
.../android/ui/surveyselector/components/HeaderRow.kt 80.76% <100.00%> (-0.72%) ⬇️
...roid/ui/surveyselector/components/SectionHeader.kt 94.44% <100.00%> (-1.39%) ⬇️
...oid/ui/surveyselector/components/SurveyCardItem.kt 89.65% <100.00%> (-1.53%) ⬇️
... and 3 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@andreia-ferreira andreia-ferreira merged commit 83b8d5f into master Feb 25, 2026
9 checks passed
@andreia-ferreira andreia-ferreira deleted the andreia/3441/add-typography branch February 25, 2026 09:25
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.

[Code health] Centralize typography in the app theme

2 participants