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

[GH-473] Port Font to Editor #503

Merged
merged 10 commits into from
Mar 24, 2021
Merged

[GH-473] Port Font to Editor #503

merged 10 commits into from
Mar 24, 2021

Conversation

pictos
Copy link
Contributor

@pictos pictos commented Mar 13, 2021

Description of Change

Implements #473

Additions made

  • Adds Font property map to EditorHandler
  • Adds Font mapping methods to EditorHandlerfor Android and iOS
  • Adds extension methods to apply Font on Android/iOS
  • Adds DeviceTests for initial Font values on iOS and Android

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)
  • Targets a single property for a single control (or intertwined few properties)
  • Adds the property to the appropriate interface
  • Avoids any changes not essential to the handler property
  • Adds the mapping to the PropertyMapper in the handler
  • Adds the mapping method to the Android, iOS, and Standard aspects of the handler
  • Implements the actual property updates (usually in extension methods in the Platform section of Core)
  • Tags ported renderer methods with [PortHandler]
  • Adds an example of the property to the sample project (MainPage)
  • Adds the property to the stub class
  • Implements basic property tests in DeviceTests

Copy link
Member

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

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

Looks almost perfect but maybe also add the tests from Entry that also check the font size and attributes? Namely the FontSizeInitializesCorrectly and FontAttributesInitializeCorrectly tests.

Otherwise this is nice and clean and seems to have all the things.

Thanks!

@mattleibow
Copy link
Member

Also, could you add the entry to the sample MainPage. I know this is now almost impossible to test at this point, but once we got some navigation going this will all be much better.

@dotnet dotnet deleted a comment from azure-pipelines bot Mar 14, 2021
@pictos
Copy link
Contributor Author

pictos commented Mar 14, 2021

@mattleibow when you say Entry you mean Editor right?

@mattleibow
Copy link
Member

I mean copy the 2 tests from entry to editor

@pictos
Copy link
Contributor Author

pictos commented Mar 14, 2021

@mattleibow I see, but when you talk about the MainPage.cs sample, is to add the Editor instead of the entry, right? (Yeah it's a dumb question from me, but just to make sure)

@mattleibow
Copy link
Member

Ah yeah. Editor. 🤦🏻‍♀️ So menu words looking the same.

@pictos pictos force-pushed the pj/editor-font branch 2 times, most recently from 5885db9 to 2c0ffc4 Compare March 17, 2021 23:45
src/Core/src/Handlers/Editor/EditorHandler.cs Outdated Show resolved Hide resolved
public static void MapFont(EditorHandler handler, IEditor editor)
{
var services = App.Current?.Services ??
throw new InvalidOperationException($"Unable to find service provider, the App.Current.Services was null.");
Copy link
Contributor

Choose a reason for hiding this comment

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

Not related with this PR, but we have this message repeated in several places. Maybe we can create some specific exceptions like FontInitializationException or group all the messages etc.

@jsuarezruiz
Copy link
Contributor

Thanks @pictos. Looks nice, just some small changes and I think is ready.

@hartez hartez merged commit 6dffa9b into dotnet:main Mar 24, 2021
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Jul 11, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 27, 2023
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants