Skip to content
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

[Android] Allow the VMDTextStyleProvider to use Composable functions #222

Merged
merged 5 commits into from
Jun 21, 2024

Conversation

amartellino
Copy link
Contributor

@amartellino amartellino commented Jun 21, 2024

Allow the VMDTextStyleProvider to call Composable functions. This will allow the TextStyle to use colours that change depending on the app theme.

Thi

Description

Make VMDTextStyleProvider functions Composable so we're able to call Composable functions.

Motivation and Context

The current implementation only allows a TextStyle to use static colours. In the Sports (TSN/RDS) app, we want the styles to use colours that change depending on the app theme (like use a light font colour if the app is in dark theme or vice-versa)

How Has This Been Tested?

I made the SampleTextStyleProvider in the sample app use LocalContentColor.current (which is a Composable) when building the TextStyle for SampleTextStyleResource.HIGHLIGHTED.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Note on breaking change: The minor breaking change is that you will have to add @Composable on override function of classes that implements VMDTextStyleProvider.

Copy link
Member

@npresseault npresseault left a comment

Choose a reason for hiding this comment

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

Just dont forget to update the changelog since this will be a breaking change.

@amartellino amartellino merged commit 3e87cd9 into master Jun 21, 2024
1 check passed
@amartellino amartellino deleted the make-vmdtextstyleprovider-functions-composable branch June 21, 2024 15:19
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.

2 participants