Skip to content

Commit b388c48

Browse files
authored
Export Text for android (#2449)
### Platforms Impacted - [ ] iOS - [ ] macOS - [ ] win32 (Office) - [ ] windows - [x] android ### Description of changes Exported text variants for android, and used in tester. ### Verification Dark: ![DarkText](https://user-images.githubusercontent.com/32593094/209659389-db387c18-9faa-4d88-8754-70cf3acdd819.png) Light: ![LightText](https://user-images.githubusercontent.com/32593094/209659456-8dd3d8a1-7d3a-4fc5-ad57-055d03a82178.png) ### Pull request checklist This PR has considered (when applicable): - [ ] Automated Tests - [ ] Documentation and examples - [ ] Keyboard Accessibility - [ ] Voiceover - [ ] Internationalization and Right-to-left Layouts
1 parent e86f53d commit b388c48

File tree

7 files changed

+116
-53
lines changed

7 files changed

+116
-53
lines changed

apps/fluent-tester/src/TestComponents/TextExperimental/TextExperimentalTest.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const TextExperimentalTest: React.FunctionComponent = () => {
4242
uwpStatus: 'Experimental',
4343
iosStatus: 'Experimental',
4444
macosStatus: 'Experimental',
45-
androidStatus: 'Beta',
45+
androidStatus: 'Experimental',
4646
};
4747

4848
const description = 'Text is a component for displaying text. You can use Text to standardize text across your app.';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { V2Usage } from './V2Usage.mobile';
Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1 @@
1-
import * as React from 'react';
2-
import { View } from 'react-native';
3-
import { Stack } from '@fluentui-react-native/stack';
4-
import { stackStyle } from '../Common/styles';
5-
import {
6-
Body1,
7-
Body1Strong,
8-
Body2,
9-
Body2Strong,
10-
Caption1,
11-
Caption1Strong,
12-
Caption2,
13-
Display,
14-
LargeTitle,
15-
TextV1,
16-
Title1,
17-
Title2,
18-
Title3,
19-
} from '@fluentui-react-native/text';
20-
21-
export const V2Usage: React.FunctionComponent = () => {
22-
return (
23-
<View>
24-
<Stack style={stackStyle} gap={5}>
25-
<TextV1 variant="caption2">Caption2 v1</TextV1>
26-
<Caption2>Caption2 v2</Caption2>
27-
<TextV1 variant="caption1">Caption1 v1</TextV1>
28-
<Caption1>Caption1 v2</Caption1>
29-
<TextV1 variant="caption1Strong">Caption1Strong v1</TextV1>
30-
<Caption1Strong>Caption1Strong v2</Caption1Strong>
31-
<TextV1 variant="body2">Body2 v1</TextV1>
32-
<Body2>Body2 v2</Body2>
33-
<TextV1 variant="body2Strong">Body2Strong v1</TextV1>
34-
<Body2Strong>Body2Strongv2 </Body2Strong>
35-
<TextV1 variant="body1">Body1 v1</TextV1>
36-
<Body1>Body1 v2</Body1>
37-
<TextV1 variant="body1Strong">Body1Strong v1</TextV1>
38-
<Body1Strong>Body1Strong v2</Body1Strong>
39-
<TextV1 variant="title3">Title3 v1</TextV1>
40-
<Title3>Title3 v2</Title3>
41-
<TextV1 variant="title2">Title2 v1</TextV1>
42-
<Title2>Title2 v2</Title2>
43-
<TextV1 variant="title1">Title1 v1</TextV1>
44-
<Title1>Title1 v2</Title1>
45-
<TextV1 variant="largeTitle">LargeTitle v1</TextV1>
46-
<LargeTitle>LargeTitle v2</LargeTitle>
47-
<TextV1 variant="display">Display v1</TextV1>
48-
<Display>Display v2</Display>
49-
</Stack>
50-
</View>
51-
);
52-
};
1+
export { V2Usage } from './V2Usage.mobile';
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import * as React from 'react';
2+
import { View } from 'react-native';
3+
import { Stack } from '@fluentui-react-native/stack';
4+
import { stackStyle } from '../Common/styles';
5+
import {
6+
Body1,
7+
Body1Strong,
8+
Body2,
9+
Body2Strong,
10+
Caption1,
11+
Caption1Strong,
12+
Caption2,
13+
Display,
14+
LargeTitle,
15+
TextV1,
16+
Title1,
17+
Title2,
18+
Title3,
19+
} from '@fluentui-react-native/text';
20+
21+
export const V2Usage: React.FunctionComponent = () => {
22+
return (
23+
<View>
24+
<Stack style={stackStyle} gap={5}>
25+
<TextV1 variant="caption2">Caption2 v1</TextV1>
26+
<Caption2>Caption2 v2</Caption2>
27+
<TextV1 variant="caption1">Caption1 v1</TextV1>
28+
<Caption1>Caption1 v2</Caption1>
29+
<TextV1 variant="caption1Strong">Caption1Strong v1</TextV1>
30+
<Caption1Strong>Caption1Strong v2</Caption1Strong>
31+
<TextV1 variant="body2">Body2 v1</TextV1>
32+
<Body2>Body2 v2</Body2>
33+
<TextV1 variant="body2Strong">Body2Strong v1</TextV1>
34+
<Body2Strong>Body2Strong v2</Body2Strong>
35+
<TextV1 variant="body1">Body1 v1</TextV1>
36+
<Body1>Body1 v2</Body1>
37+
<TextV1 variant="body1Strong">Body1Strong v1</TextV1>
38+
<Body1Strong>Body1Strong v2</Body1Strong>
39+
<TextV1 variant="title3">Title3 v1</TextV1>
40+
<Title3>Title3 v2</Title3>
41+
<TextV1 variant="title2">Title2 v1</TextV1>
42+
<Title2>Title2 v2</Title2>
43+
<TextV1 variant="title1">Title1 v1</TextV1>
44+
<Title1>Title1 v2</Title1>
45+
<TextV1 variant="largeTitle">LargeTitle v1</TextV1>
46+
<LargeTitle>LargeTitle v2</LargeTitle>
47+
<TextV1 variant="display">Display v1</TextV1>
48+
<Display>Display v2</Display>
49+
</Stack>
50+
</View>
51+
);
52+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Add text for android.",
4+
"packageName": "@fluentui-react-native/tester",
5+
"email": "email not defined",
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": "patch",
3+
"comment": "Add text for android.",
4+
"packageName": "@fluentui-react-native/text",
5+
"email": "email not defined",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { Text } from './Text';
2+
3+
export const Caption1 = Text.customize({
4+
variant: 'caption1',
5+
} as any);
6+
export const Caption1Strong = Text.customize({
7+
variant: 'caption1Strong',
8+
} as any);
9+
export const Caption2 = Text.customize({
10+
variant: 'caption2',
11+
} as any);
12+
export const Body1 = Text.customize({
13+
variant: 'body1',
14+
} as any);
15+
export const Body1Strong = Text.customize({
16+
variant: 'body1Strong',
17+
} as any);
18+
export const Body2 = Text.customize({
19+
variant: 'body2',
20+
} as any);
21+
export const Body2Strong = Text.customize({
22+
variant: 'body2Strong',
23+
} as any);
24+
25+
export const Subtitle1 = null; // Not supported
26+
export const Subtitle1Strong = null; // Not supported
27+
export const Subtitle2 = null; // Not supported
28+
export const Subtitle2Strong = null; // Not supported
29+
30+
export const Title1 = Text.customize({
31+
variant: 'title1',
32+
} as any);
33+
34+
export const Title1Strong = null; // Not supported
35+
36+
export const Title2 = Text.customize({
37+
variant: 'title2',
38+
} as any);
39+
export const Title3 = Text.customize({
40+
variant: 'title3',
41+
} as any);
42+
export const LargeTitle = Text.customize({
43+
variant: 'largeTitle',
44+
} as any);
45+
export const Display = Text.customize({
46+
variant: 'display',
47+
} as any);

0 commit comments

Comments
 (0)