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

fix: Update Android/iOS button styles to account for dark theme #424

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Youssef1313
Copy link
Member

@Youssef1313 Youssef1313 commented Feb 25, 2023

GitHub Issue (If applicable): The buttons part of #455

PR Type

What kind of change does this PR introduce?

What is the current behavior?

What is the new behavior?

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • Docs have been added/updated which fit documentation template. (for bug fixes / features)
  • Unit Tests and/or UI Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Wasm UI Tests are not showing unexpected any differences. Validate PR Screenshots Compare Test Run results.
  • Contains NO breaking changes
  • Updated the Release Notes
  • Associated with an issue (GitHub or internal)

Other information

Internal Issue (If applicable):

@jeromelaban
Copy link
Member

/cc @agneszitte-nventive

<Color x:Key="Color21">#FF7A7A7A</Color>
<Color x:Key="Color22">#FFE6E6E6</Color>
<ResourceDictionary x:Key="Light">
<Color x:Key="AndroidBlue">#2196F3</Color>
Copy link
Member

Choose a reason for hiding this comment

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

We generally avoid naming keys with their actual color name, this avoids confusion when changed later on. Is it AndroidForeground instead? /cc @agneszitte-nventive

Copy link
Contributor

Choose a reason for hiding this comment

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

@jeromelaban / @Youssef1313 / @kazo0 / @NVLudwig
First, should we not have proper Light/Dark ResourceDictionnary for all the colors for Uno.Playground?

@kazo0 regarding the android/ios buttons here, does it still make sense that we have AndroidButtonStyle, iOSButtonStyle in the Playground DefaultStyles.xaml ?
Should we not use the Themes lib instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

@agneszitte I agree we shouldn't have these styles in Playground.

In this case we will need to update the sample itself (I don't know where those samples are maintained)

Choose a reason for hiding this comment

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

  • +1 for color-name as name; you should describe "what it is used for"(purpose) than "what it is"(color).
    use this syntax: {Qualifier}{Control}{Resource}{State?}
    eg: AndroidButtonBackground, IosButtonBackgroundDisabled // pick your poison: Ios or iOS
  • I would keep them inside DefaultStyles (which houses the control style), those colors are closely related to the specific control style.
  • It is, more or less, fine that Color\d{2} are not theme-dependent. However, I would fear that some shared samples could be relying on these resources to be specific color. I would be hesitant to touch them now.

Choose a reason for hiding this comment

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

on the bright side, the control styles in DefaultStyles or Styles\Controls\* all seem to be x:Key-ed
so changing them should be less of a problem

Copy link
Contributor

@kazo0 kazo0 Apr 26, 2023

Choose a reason for hiding this comment

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

For the AndroidButtonStyle and iOSButtonStyle, they cant necessarily just be replaced with the styles coming from Themes. The default Android button from a vanilla native Android app doesn't match a Material Design 3 Button style. I believe these styles are here to mimic default styles from the native iOS/Android SDKs

Copy link
Member

Choose a reason for hiding this comment

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

@Youssef1313 is there something to adjust here?

Copy link
Member Author

Choose a reason for hiding this comment

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

On a second thought, I think we should really remove all these styles. The expectation should be that code in Playground matches behavior when copied into an Uno Wasm app right? But that is not the case with Playground defining own styles and overriding some control templates, etc.

The real fix would be to remove all these and also update the Playground snippets (needs someone with access to the API).

I'm not sure though if we can merge this PR until we have the proper fix (assuming you agree that it's the proper fix)

Copy link
Member Author

Choose a reason for hiding this comment

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

When updating the snippets, we also don't want to include any explicit colors because that will work on either light or dark but likely not both.

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.

5 participants