Skip to content

Commit 2638c6f

Browse files
[Switch] Documentation and tester update for switch on Android (#2443)
### Platforms Impacted - [ ] iOS - [ ] macOS - [ ] win32 (Office) - [ ] windows - [x] android ### Description of changes Updates the documentation and tester app for Link for android. ### Verification Visual Verification on Android ### Pull request checklist This PR has considered (when applicable): - [ ] Automated Tests - [x] Documentation and examples - [ ] Keyboard Accessibility - [ ] Voiceover - [ ] Internationalization and Right-to-left Layouts
1 parent 15359b6 commit 2638c6f

File tree

6 files changed

+30
-6
lines changed

6 files changed

+30
-6
lines changed

apps/fluent-tester/src/TestComponents/Switch/Switch.tsx renamed to apps/fluent-tester/src/TestComponents/Switch/SwitchTest.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,13 @@ const toggleSections: TestSection[] = [
125125
component: () => <OnOffText />,
126126
},
127127
}),
128-
{
129-
name: 'Customized Tokens',
130-
component: () => <CustomizedSwitch />,
131-
},
128+
Platform.select({
129+
android: null,
130+
default: {
131+
name: 'Customized Tokens',
132+
component: () => <CustomizedSwitch />,
133+
},
134+
}),
132135
{
133136
name: 'Switch E2E Testing',
134137
component: () => <E2ESwitchTest />,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export * from './Switch';
1+
export * from './SwitchTest';
22
export * from './consts';
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "doc update for switch - android",
4+
"packageName": "@fluentui-react-native/switch",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "minor",
3+
"comment": "doc update for switch - android",
4+
"packageName": "@fluentui-react-native/tester",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/experimental/Switch/SPEC.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,21 @@ export interface SwitchProps extends Omit<PressablePropsExtended 'onPress'> {
7979

8080
/**
8181
* The Switch's text that shows when it is in a false state
82+
* Note: Not supported for Android
8283
*/
8384
offText?: string;
8485

8586
/**
8687
* The Switch's text that shows when it is in a true state
88+
* Note: Not supported for Android
8789
*/
8890
onText?: string;
8991

9092
/**
9193
* Sets the position of the Switch's label. The position value 'after' is mutually
9294
* exclusive with the onText and offText props. This is due to variable width
9395
* of the text props causing the Switch's position to change when it shouldn't.
94-
* For Android : 'above' is not supported
96+
* Note : 'before' , 'above' are not supported on Android
9597
*/
9698
labelPosition?: 'before' | 'above' | 'after';
9799
}
@@ -205,6 +207,7 @@ export interface SwitchTokens extends LayoutTokens, FontTokens, IBorderTokens, I
205207

206208
/**
207209
* States that can be applied to a switch
210+
* Note: 'hovered','focused','before','beforeContent','above' are not supported for Android
208211
*/
209212
hovered?: SwitchTokens;
210213
focused?: SwitchTokens;

packages/experimental/Switch/src/Switch.types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export interface SwitchTokens extends LayoutTokens, FontTokens, IBorderTokens, I
110110

111111
/**
112112
* States that can be applied to a switch
113+
* Note: 'hovered','focused','before','beforeContent','above' are not supported for Android
113114
*/
114115
hovered?: SwitchTokens;
115116
focused?: SwitchTokens;
@@ -155,18 +156,21 @@ export interface SwitchProps extends Omit<PressablePropsExtended, 'onPress'> {
155156

156157
/**
157158
* The Switch's text that shows when it is in a false state
159+
* Note: Not supported for Android
158160
*/
159161
offText?: string;
160162

161163
/**
162164
* The Switch's text that shows when it is in a true state
165+
* Note: Not supported for Android
163166
*/
164167
onText?: string;
165168

166169
/**
167170
* The position of the label relative to the Switch. The position value 'after' is mutually
168171
* exclusive with the onText and offText props. This is due to variable width
169172
* of the text props causing the Switch's position to change when it shouldn't.
173+
* Note :'before', 'above' are not supported on Android
170174
*/
171175
labelPosition?: 'before' | 'above' | 'after';
172176
}

0 commit comments

Comments
 (0)