Skip to content

Commit caf015b

Browse files
mkarpiofacebook-github-bot
authored andcommitted
Move Spec related a11y doc to codegen section and promote the one from Mountable Components to top level
Summary: Top level docs should discuss kotlin APIs, so the old a11y doc got moved to codegen section, and replaced with the a11y doc written for Mountable Components (with small adjustments to cover not only Mountable Components, but Style operations in general). Reviewed By: apowolny Differential Revision: D42034502 fbshipit-source-id: 49d9fc919429fce91f3b175037510db026d021a5
1 parent bf12302 commit caf015b

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

docs/mainconcepts/mountablecomponents/accessibility.mdx renamed to docs/accessibility/accessibility.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ This page provides details of the Litho components, methods, nodes, events, and
1313
For information on how Meta is committed to creating a full UI experience for **all** people, see the [Meta Accessibility](https://en-gb.facebook.com/accessibility/) site.
1414
:::
1515

16-
## Implementing Accessibility features for Mountable Components
16+
## Implementing Accessibility features
1717

18-
Accessibility properties and events for mountable components can be implemented by adding them to the `Style` object that will be returned by the `MountableRenderResult` object from the `render()` method.
18+
Accessibility properties and events for components can be implemented by adding them to the `Style` object.
1919

20-
Following is example of how to combine a `Style`, that was passed to a mountable component, with a newly created `Style` object that implements accessibility properties and events:
20+
Following is an example of how to combine a `Style`, that was passed to a mountable component, with a newly created `Style` object that implements accessibility properties and events and will be returned on the `MountableRenderResult` object from the `render()` method:
2121

2222
```kotlin file=sample/src/main/java/com/facebook/samples/litho/kotlin/mountables/SimpleImageViewWithAccessibility.kt start=start_simple_mountable_component_with_a11y_example end=end_simple_mountable_component_with_a11y_example
2323
```
File renamed without changes.

docs/codegen/overview.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The documentation for Codegen APIs includes the following pages:
1212

1313
* [Layout Specs](layout-specs.mdx) - the logical equivalents of composite views on Android.
1414
* [Mount Specs](mount-specs.md) - components that can render views or drawables.
15+
* [Accessibility](accessibility-overview.md) - explains why accessibility is important and how to implement accessibility features, and lists the supported accessibility events of the `Style` object.
1516
* [Sections API](sections/start.mdx) - documentation for the Sections API for writing lists.
1617
* [Props](passing-data-to-components/props.md) and [TreeProps](passing-data-to-components/treeprops.mdx) - the ways you can pass data to components.
1718
* [State in Specs](state-for-specs.md) - data that is encapsulated and managed within the component and is transparent to its parent.

docs/kotlin/cheatsheet.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ The following cheatsheet provides a set of links for the migration of individual
4444
| @OnBoundsDefined | [measure()](../mainconcepts/mountablecomponents/mountable-measuring.mdx) |
4545
| @OnPrepare | [MountableComponentScope.render()](../mainconcepts/mountablecomponents/mountable-component.mdx) |
4646
| @OnLoadStyle | [MountableComponentScope.render()](../mainconcepts/mountablecomponents/mountable-component.mdx) |
47-
| Accessibility | [Accessibility for Mountable Components](../mainconcepts/mountablecomponents/accessibility.mdx) (see: [AccessibilityStyles](https://fburl.com/code/3ikzp6c7))|
47+
| Accessibility | [Accessibility for Mountable Components](../accessibility/accessibility.mdx) (see: [AccessibilityStyles](https://fburl.com/code/3ikzp6c7))|
4848
| hasChildLithoViews | [doesMountRenderTreeHosts()](https://fburl.com/doesmountrendertreehosts)|
4949
| isPureRender | No equivalent. Ignore when converting. |

docs/kotlin/migrating-from-mountspecs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ More information on how to migrate Hooks can be found on the [Hooks](../kotlin/h
4949

5050
### Migrating Accessibility
5151

52-
Accessibility for Mountable Components is implemented using the `Style` object. You can find out more about how to implement A11Y for Mountable Components on the dedicated [Accessibility](../mainconcepts/mountablecomponents/accessibility.mdx) page.
52+
Accessibility for Mountable Components is implemented using the `Style` object. You can find out more about how to implement A11Y for Mountable Components on the dedicated [Accessibility](../accessibility/accessibility.mdx) page.
5353

5454
### Migrating event handling
5555

docs/mainconcepts/mountablecomponents/overview.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ The Mountable Components section contains the following pages:
1515
* [BindTo - Dynamic Values API](mountable-bindto.mdx) - illustrates the use of the BindTo API by implementing a simple `ImageViewComponent` with specific properties, which are animated based on the values of a `SeekBar`.
1616
* [Controllers Pattern](mountable-controllers.mdx) - illustrates the use of controllers by implementing a simple TimePicker that shows an arbitrary time.
1717
* [Content Pooling](mountable-preallocation.mdx) - details a strategy that can be used to populate the content pools to optimise first mount performance.
18-
* [Accessibility](accessibility.mdx) - explains why accessibility is important and how to implement accessibility features, and lists the supported accessibility events of the `Style` object.
1918

2019
Information and step-by-step explanations of how to migrate to Mountable Components from already existing components can be found in the following documents:
2120
* [Migrating from MountSpecs](../../kotlin/migrating-from-mountspecs.mdx) - details the process of migrating from MountSpec API.

website/sidebars.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ module.exports = {
5353
'mainconcepts/mountablecomponents/mountable-bindto',
5454
'mainconcepts/mountablecomponents/mountable-controllers',
5555
'mainconcepts/mountablecomponents/mountable-preallocation',
56-
'mainconcepts/mountablecomponents/accessibility',
5756
]
5857
},
5958
{
@@ -90,7 +89,7 @@ module.exports = {
9089
// TODO: Kotlin-ify
9190
'mainconcepts/coordinate-state-actions/visibility-handling',
9291
],
93-
'Accessibility': ['accessibility/accessibility-overview'],
92+
'Accessibility': ['accessibility/accessibility'],
9493
// TODO: revisit wording to make it clear it's not just the 'kotlin' testing API
9594
'Testing': [
9695
'kotlin/testing-getting-started',
@@ -109,6 +108,7 @@ module.exports = {
109108
'codegen/overview',
110109
'codegen/layout-specs',
111110
'codegen/mount-specs',
111+
'codegen/accessibility-overview',
112112
{
113113
'Sections API': [
114114
'sections/start',

0 commit comments

Comments
 (0)