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

Semantics and some structure changes #635

Merged
merged 50 commits into from Apr 6, 2021
Merged

Semantics and some structure changes #635

merged 50 commits into from Apr 6, 2021

Conversation

PureWeen
Copy link
Member

@PureWeen PureWeen commented Apr 1, 2021

Description of Change

This PR adds the Semantics structure to Maui.Core which lets you alter how views are semantically processed by things like screen readers. Because the semantics processing is required at the View level this PR grew into an involved restructuring of the the AbstractViewHandler classes. Currently we are stuffing everything into AbstractViewHandler which causes us to have three different properties for accessing a "NativeView". This PR sets up a generic inheritance structure and via method hiding just consolidates all of that to a single property for the Virtual View and a single property for the Native View. This also let me setup disconnect/connect hooks at the ViewHandler level.

This PR has a large set of changes to some fundamental structures so we will plan on filling out the testing more once we have more UI based tests. None of these changes can reliably be tested in an automated fashion we can really only test that some properties are set

Additions made

  • Adds

    • ViewHandlerOFT: Rename of AbstractViewHandler
    • Renamed TypedNativeView to NativeView and just collapsed all "NativeView" getters (View, TypedNativeView, NativeView) into NativeView
    • Added VirtualView to IViewHandler
    • Changed the NativeView return type on IViewHandler from object? to NativeView?. Everywhere we are currently accessing this property we are casting it to the NativeView or throwing an exception if it's the wrong type. Not sure if there's a use case here for that being of type object?
    • Semantics: Container class for describing the semantic properties of a View
    • Controls.SemanticProperties: Attached Property for setting semantic properties from the controls project
  • Removes
    • NativeView/TypedNativeView

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

Does this PR touch anything that might effect accessibility?

  • APIs that modify focusability?
  • APIs that modify any text property on a control?
  • Does this PR modify view nesting or view arragement in anyway?
  • Is there the smallest possibility that your PR will change accessibility?
  • I'm not sure, please help me

If any of the above checkboxes apply to your PR then the PR will need to provide testing to demonstrate that accessibility still works.

@PureWeen PureWeen requested a review from rachelkang April 1, 2021 15:48
@PureWeen PureWeen requested a review from mattleibow April 2, 2021 15:12
@PureWeen PureWeen requested a review from hartez April 2, 2021 15:26
@PureWeen PureWeen added this to Release Todo in Preview 3 Apr 5, 2021
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.

Still got to look at the exact implementation, but this looks very good. Just have some things on the code itself.

src/Core/src/Handlers/View/ViewHandler.cs Outdated Show resolved Hide resolved
src/Core/src/Handlers/View/ViewHandler.cs Outdated Show resolved Hide resolved
src/Core/src/Handlers/IViewHandler.cs Outdated Show resolved Hide resolved
src/Core/src/Handlers/IViewHandler.cs Outdated Show resolved Hide resolved
src/Core/src/Handlers/View/ViewHandler.cs Outdated Show resolved Hide resolved
src/Core/src/Handlers/View/ViewHandlerOfT.cs Show resolved Hide resolved
src/Core/src/Handlers/View/ViewHandler.cs Outdated Show resolved Hide resolved
@mattleibow
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@PureWeen PureWeen merged commit 62b2452 into main Apr 6, 2021
@PureWeen PureWeen deleted the semantics branch April 6, 2021 21:13
@PureWeen PureWeen moved this from Release Todo to Done in Preview 3 Apr 6, 2021
@rachelkang rachelkang added the area/a11y Relates to accessibility label Aug 9, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/a11y Relates to accessibility
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants