@@ -110,6 +110,85 @@ function NumberOfLinesTextLayoutExample(): React.Node {
110110 ) ;
111111}
112112
113+ component RtlInlineViewExample (
114+ label : string ,
115+ testID : string ,
116+ children : React . Node ,
117+ ) {
118+ return (
119+ < View testID = { testID } style = { { flexDirection : 'row' , flexGrow : 1 } } >
120+ < RNTesterText variant = "label" style = { { width : 100 , fontSize : 10 } } >
121+ { label }
122+ </ RNTesterText >
123+ < View style = { { flexGrow : 1 } } > { children } </ View >
124+ </ View >
125+ ) ;
126+ }
127+
128+ component RtlAndInlineViewsExample ( ) {
129+ return (
130+ < View style = { { rowGap : 5 } } >
131+ < RtlInlineViewExample
132+ label = "RTL script in LTR Layout with end attachment"
133+ testID = "rtl-inline-view-example-1" >
134+ < RNTesterText style = { { textAlign : 'left' , direction : 'ltr' } } >
135+ مَٰنِ ٱلرَّحِيمِ
136+ < View style = { { width : 10 , height : 10 , backgroundColor : 'red' } } />
137+ </ RNTesterText >
138+ </ RtlInlineViewExample >
139+
140+ < RtlInlineViewExample
141+ label = "LTR script in RTL layout with middle attachment"
142+ testID = "rtl-inline-view-example-2" >
143+ < RNTesterText style = { { textAlign : 'left' , direction : 'rtl' } } >
144+ Hello
145+ < View style = { { width : 10 , height : 10 , backgroundColor : 'red' } } /> { ' ' }
146+ World!
147+ </ RNTesterText >
148+ </ RtlInlineViewExample >
149+
150+ < RtlInlineViewExample
151+ label = "RTL script in LTR layout with start attachment"
152+ testID = "rtl-inline-view-example-3" >
153+ < RNTesterText style = { { textAlign : 'left' , direction : 'ltr' } } >
154+ < View style = { { width : 10 , height : 10 , backgroundColor : 'red' } } />
155+ مَٰنِ ٱلرَّحِيمِ
156+ </ RNTesterText >
157+ </ RtlInlineViewExample >
158+
159+ < RtlInlineViewExample
160+ label = "RTL script in RTL layout with end attachment"
161+ testID = "rtl-inline-view-example-4" >
162+ < RNTesterText style = { { textAlign : 'left' , direction : 'rtl' } } >
163+ مَٰنِ ٱلرَّحِيمِ
164+ < View style = { { width : 10 , height : 10 , backgroundColor : 'red' } } />
165+ </ RNTesterText >
166+ </ RtlInlineViewExample >
167+
168+ < RtlInlineViewExample
169+ label = "RTL dominant BiDi script in RTL layout with end attachments"
170+ testID = "rtl-inline-view-example-5" >
171+ < RNTesterText style = { { textAlign : 'left' , direction : 'rtl' } } >
172+ مَٰنِ ٱلرَّحِيمِ
173+ < View style = { { width : 10 , height : 10 , backgroundColor : 'red' } } /> Hello
174+ < View style = { { width : 10 , height : 10 , backgroundColor : 'blue' } } />
175+ </ RNTesterText >
176+ </ RtlInlineViewExample >
177+
178+ < RtlInlineViewExample
179+ label = "LTR dominant BiDi script in RTL layout with end attachments"
180+ testID = "rtl-inline-view-example-6" >
181+ < RNTesterText style = { { textAlign : 'left' , direction : 'rtl' } } >
182+ Hello
183+ < View style = { { width : 10 , height : 10 , backgroundColor : 'red' } } />
184+ مَٰنِ ٱلرَّحِيمِ
185+ < View style = { { width : 10 , height : 10 , backgroundColor : 'blue' } } />
186+ </ RNTesterText >
187+ </ RtlInlineViewExample >
188+ </ View >
189+ ) ;
190+ }
191+
113192export default [
114193 {
115194 title : 'Empty Text' ,
@@ -124,6 +203,13 @@ export default [
124203 expect : 'The red box should align correctly with the rest of the text.' ,
125204 render : TextInlineViewsExample ,
126205 } ,
206+ {
207+ title : 'RTL and Inline Views' ,
208+ name : 'rtlInlineViews' ,
209+ description : 'RTL Script and Layout Direction, Combined with Inline Views' ,
210+ scrollable : true ,
211+ render : RtlAndInlineViewsExample ,
212+ } ,
127213 {
128214 title : 'numberOfLines with onTextLayout' ,
129215 name : 'numberOfLinesLayout' ,
0 commit comments