Skip to content

Commit 709ea1f

Browse files
committed
Add support for more View props.
1 parent 3927959 commit 709ea1f

File tree

16 files changed

+690
-465
lines changed

16 files changed

+690
-465
lines changed

ReactFSharp.Android/Views/View.fs

Lines changed: 149 additions & 60 deletions
Large diffs are not rendered by default.

ReactFSharp.Android/Views/ViewGroup.fs

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@ type ViewGroupProps =
2323
Activated: bool
2424
Alpha: float32
2525
Background: Func<Drawable>
26+
CameraDistance: Single
2627
Clickable: bool
28+
ClipBounds: Func<Option<Rect>>
29+
ClipToOutline: bool
2730
ContextClickable: bool
2831
ContentDescription: string
32+
DrawingCacheBackgroundColor: Color
2933
DrawingCacheEnabled: bool
3034
DrawingCacheQuality: DrawingCacheQuality
3135
Elevation: Single
@@ -67,31 +71,30 @@ type ViewGroupProps =
6771
OnSystemUiVisibilityChange: Action<StatusBarVisibility>
6872
OnTouch: Func<MotionEvent, bool>
6973
//OutlineProvider: ViewOutlineProvider
70-
OverScrollBy: IObservable<int * int * int * int * int * int * int * int * bool>
7174
OverScrollMode: int
7275
Padding: ViewPadding
7376
Pivot: Single * Single
7477
RequestFocus: IObservable<FocusSearchDirection>
7578
Rotation: Single * Single * Single
7679
Scale: Single * Single
77-
//ScrollBarDefaultDelayBeforeFade: int32
78-
//ScrollBarFadeDuration: int32
79-
//ScrollBarFadingEnabled: bool
80-
//ScrollBarSize: int
80+
ScrollBarDefaultDelayBeforeFade: int32
81+
ScrollBarFadeDuration: int32
82+
ScrollBarFadingEnabled: bool
83+
ScrollBarSize: int
8184
ScrollBarStyle: ScrollbarStyles
8285
ScrollBy: IObservable<int * int>
8386
ScrollTo: IObservable<int * int>
8487
Selected: bool
8588
SoundEffectsEnabled: bool
8689
//StateListAnimator: StateListAnimator
87-
//SystemUiVisibility: StatusBarVisibility
88-
//TextAlignment: TextAlignment
89-
//TextDirection: TextDirection
90+
SystemUiVisibility: StatusBarVisibility
91+
TextAlignment: TextAlignment
92+
TextDirection: TextDirection
9093
TransitionName: string
9194
Translation: Single * Single * Single
9295
VerticalFadingEdgeEnabled: bool
9396
VerticalScrollBarEnabled: bool
94-
//VerticalScrollbarPosition: ScrollbarPosition
97+
VerticalScrollbarPosition: ScrollbarPosition
9598
Visibility: ViewStates
9699
}
97100

@@ -103,9 +106,13 @@ type ViewGroupProps =
103106
member this.Activated = this.Activated
104107
member this.Alpha = this.Alpha
105108
member this.Background = this.Background
109+
member this.CameraDistance = this.CameraDistance
106110
member this.Clickable = this.Clickable
111+
member this.ClipBounds = this.ClipBounds
112+
member this.ClipToOutline = this.ClipToOutline
107113
member this.ContentDescription = this.ContentDescription
108114
member this.ContextClickable = this.ContextClickable
115+
member this.DrawingCacheBackgroundColor = this.DrawingCacheBackgroundColor
109116
member this.DrawingCacheEnabled = this.DrawingCacheEnabled
110117
member this.DrawingCacheQuality = this.DrawingCacheQuality
111118
member this.Elevation = this.Elevation
@@ -147,31 +154,30 @@ type ViewGroupProps =
147154
member this.OnSystemUiVisibilityChange = this.OnSystemUiVisibilityChange
148155
member this.OnTouch = this.OnTouch
149156
//member this.OutlineProvider = this.OutlineProvider
150-
member this.OverScrollBy = this.OverScrollBy
151157
member this.OverScrollMode = this.OverScrollMode
152158
member this.Padding = this.Padding
153159
member this.Pivot = this.Pivot
154160
member this.RequestFocus = this.RequestFocus
155161
member this.Rotation = this.Rotation
156162
member this.Scale = this.Scale
157-
//member this.ScrollBarDefaultDelayBeforeFade = this.ScrollBarDefaultDelayBeforeFade
158-
//member this.ScrollBarFadeDuration = this.ScrollBarFadeDuration
159-
//member this.ScrollBarFadingEnabled = this.ScrollBarFadingEnabled
160-
//member this.ScrollBarSize = this.ScrollBarSize
163+
member this.ScrollBarDefaultDelayBeforeFade = this.ScrollBarDefaultDelayBeforeFade
164+
member this.ScrollBarFadeDuration = this.ScrollBarFadeDuration
165+
member this.ScrollBarFadingEnabled = this.ScrollBarFadingEnabled
166+
member this.ScrollBarSize = this.ScrollBarSize
161167
member this.ScrollBarStyle = this.ScrollBarStyle
162168
member this.ScrollBy = this.ScrollBy
163169
member this.ScrollTo = this.ScrollTo
164170
member this.Selected = this.Selected
165171
member this.SoundEffectsEnabled = this.SoundEffectsEnabled
166172
//member this.StateListAnimator = this.StateListAnimator
167-
//member this.SystemUiVisibility = this.SystemUiVisibility
168-
//member this.TextAlignment = this.TextAlignment
169-
//member this.TextDirection = this.TextDirection
173+
member this.SystemUiVisibility = this.SystemUiVisibility
174+
member this.TextAlignment = this.TextAlignment
175+
member this.TextDirection = this.TextDirection
170176
member this.TransitionName = this.TransitionName
171177
member this.Translation = this.Translation
172178
member this.VerticalFadingEdgeEnabled = this.VerticalFadingEdgeEnabled
173179
member this.VerticalScrollBarEnabled = this.VerticalScrollBarEnabled
174-
//member this.VerticalScrollbarPosition = this.VerticalScrollbarPosition
180+
member this.VerticalScrollbarPosition = this.VerticalScrollbarPosition
175181
member this.Visibility = this.Visibility
176182

177183
[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
@@ -184,9 +190,13 @@ module private ViewGroupProps =
184190
Activated = ViewProps.Default.Activated
185191
Alpha = ViewProps.Default.Alpha
186192
Background = ViewProps.Default.Background
193+
CameraDistance = ViewProps.Default.CameraDistance
187194
Clickable = ViewProps.Default.Clickable
195+
ClipBounds = ViewProps.Default.ClipBounds
196+
ClipToOutline = ViewProps.Default.ClipToOutline
188197
ContentDescription = ViewProps.Default.ContentDescription
189198
ContextClickable = ViewProps.Default.ContextClickable
199+
DrawingCacheBackgroundColor = ViewProps.Default.DrawingCacheBackgroundColor
190200
DrawingCacheEnabled = ViewProps.Default.DrawingCacheEnabled
191201
DrawingCacheQuality = ViewProps.Default.DrawingCacheQuality
192202
Elevation = ViewProps.Default.Elevation
@@ -228,31 +238,30 @@ module private ViewGroupProps =
228238
OnSystemUiVisibilityChange = ViewProps.Default.OnSystemUiVisibilityChange
229239
OnTouch = ViewProps.Default.OnTouch
230240
//OutlineProvider = ViewProps.Default.OutlineProvider
231-
OverScrollBy = ViewProps.Default.OverScrollBy
232241
OverScrollMode = ViewProps.Default.OverScrollMode
233242
Padding = ViewProps.Default.Padding
234243
Pivot = ViewProps.Default.Pivot
235244
RequestFocus = ViewProps.Default.RequestFocus
236245
Rotation = ViewProps.Default.Rotation
237246
Scale = ViewProps.Default.Scale
238-
//ScrollBarDefaultDelayBeforeFade = ViewProps.Default.ScrollBarDefaultDelayBeforeFade
239-
//ScrollBarFadeDuration = ViewProps.Default.ScrollBarDefaultDelayBeforeFade
240-
//ScrollBarFadingEnabled = ViewProps.Default.ScrollBarFadingEnabled
241-
//ScrollBarSize = ViewProps.Default.ScrollBarSize
247+
ScrollBarDefaultDelayBeforeFade = ViewProps.Default.ScrollBarDefaultDelayBeforeFade
248+
ScrollBarFadeDuration = ViewProps.Default.ScrollBarDefaultDelayBeforeFade
249+
ScrollBarFadingEnabled = ViewProps.Default.ScrollBarFadingEnabled
250+
ScrollBarSize = ViewProps.Default.ScrollBarSize
242251
ScrollBarStyle = ViewProps.Default.ScrollBarStyle
243252
ScrollBy = ViewProps.Default.ScrollBy
244253
ScrollTo = ViewProps.Default.ScrollTo
245254
Selected = ViewProps.Default.Selected
246255
SoundEffectsEnabled = ViewProps.Default.SoundEffectsEnabled
247256
//StateListAnimator = ViewProps.Default.StateListAnimator
248-
//SystemUiVisibility = ViewProps.Default.SystemUiVisibility
249-
//TextAlignment = ViewProps.Default.TextAlignment
250-
//TextDirection = ViewProps.Default.TextDirection
257+
SystemUiVisibility = ViewProps.Default.SystemUiVisibility
258+
TextAlignment = ViewProps.Default.TextAlignment
259+
TextDirection = ViewProps.Default.TextDirection
251260
TransitionName = ViewProps.Default.TransitionName
252261
Translation = ViewProps.Default.Translation
253262
VerticalFadingEdgeEnabled = ViewProps.Default.VerticalFadingEdgeEnabled
254263
VerticalScrollBarEnabled = ViewProps.Default.VerticalScrollBarEnabled
255-
//VerticalScrollbarPosition = ViewProps.Default.VerticalScrollbarPosition
264+
VerticalScrollbarPosition = ViewProps.Default.VerticalScrollbarPosition
256265
Visibility = ViewProps.Default.Visibility
257266
}
258267

ReactFSharp.Android/Widget/Button.fs

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@ type ButtonProps =
2727
Activated: bool
2828
Alpha: float32
2929
Background: Func<Drawable>
30+
CameraDistance: Single
3031
Clickable: bool
32+
ClipBounds: Func<Option<Rect>>
33+
ClipToOutline: bool
3134
ContextClickable: bool
3235
ContentDescription: string
36+
DrawingCacheBackgroundColor: Color
3337
DrawingCacheEnabled: bool
3438
DrawingCacheQuality: DrawingCacheQuality
3539
Elevation: Single
@@ -71,31 +75,30 @@ type ButtonProps =
7175
OnSystemUiVisibilityChange: Action<StatusBarVisibility>
7276
OnTouch: Func<MotionEvent, bool>
7377
//OutlineProvider: ViewOutlineProvider
74-
OverScrollBy: IObservable<int * int * int * int * int * int * int * int * bool>
7578
OverScrollMode: int
7679
Padding: ViewPadding
7780
Pivot: Single * Single
7881
RequestFocus: IObservable<FocusSearchDirection>
7982
Rotation: Single * Single * Single
8083
Scale: Single * Single
81-
//ScrollBarDefaultDelayBeforeFade: int32
82-
//ScrollBarFadeDuration: int32
83-
//ScrollBarFadingEnabled: bool
84-
//ScrollBarSize: int
84+
ScrollBarDefaultDelayBeforeFade: int32
85+
ScrollBarFadeDuration: int32
86+
ScrollBarFadingEnabled: bool
87+
ScrollBarSize: int
8588
ScrollBarStyle: ScrollbarStyles
8689
ScrollBy: IObservable<int * int>
8790
ScrollTo: IObservable<int * int>
8891
Selected: bool
8992
SoundEffectsEnabled: bool
9093
//StateListAnimator: StateListAnimator
91-
//SystemUiVisibility: StatusBarVisibility
92-
//TextAlignment: TextAlignment
93-
//TextDirection: TextDirection
94+
SystemUiVisibility: StatusBarVisibility
95+
TextAlignment: TextAlignment
96+
TextDirection: TextDirection
9497
TransitionName: string
9598
Translation: Single * Single * Single
9699
VerticalFadingEdgeEnabled: bool
97100
VerticalScrollBarEnabled: bool
98-
//VerticalScrollbarPosition: ScrollbarPosition
101+
VerticalScrollbarPosition: ScrollbarPosition
99102
Visibility: ViewStates
100103

101104
// TextView Props
@@ -110,9 +113,13 @@ type ButtonProps =
110113
member this.Activated = this.Activated
111114
member this.Alpha = this.Alpha
112115
member this.Background = this.Background
116+
member this.CameraDistance = this.CameraDistance
113117
member this.Clickable = this.Clickable
118+
member this.ClipBounds = this.ClipBounds
119+
member this.ClipToOutline = this.ClipToOutline
114120
member this.ContentDescription = this.ContentDescription
115121
member this.ContextClickable = this.ContextClickable
122+
member this.DrawingCacheBackgroundColor = this.DrawingCacheBackgroundColor
116123
member this.DrawingCacheEnabled = this.DrawingCacheEnabled
117124
member this.DrawingCacheQuality = this.DrawingCacheQuality
118125
member this.Elevation = this.Elevation
@@ -154,31 +161,30 @@ type ButtonProps =
154161
member this.OnSystemUiVisibilityChange = this.OnSystemUiVisibilityChange
155162
member this.OnTouch = this.OnTouch
156163
//member this.OutlineProvider = this.OutlineProvider
157-
member this.OverScrollBy = this.OverScrollBy
158164
member this.OverScrollMode = this.OverScrollMode
159165
member this.Padding = this.Padding
160166
member this.Pivot = this.Pivot
161167
member this.RequestFocus = this.RequestFocus
162168
member this.Rotation = this.Rotation
163169
member this.Scale = this.Scale
164-
//member this.ScrollBarDefaultDelayBeforeFade = this.ScrollBarDefaultDelayBeforeFade
165-
//member this.ScrollBarFadeDuration = this.ScrollBarFadeDuration
166-
//member this.ScrollBarFadingEnabled = this.ScrollBarFadingEnabled
167-
//member this.ScrollBarSize = this.ScrollBarSize
170+
member this.ScrollBarDefaultDelayBeforeFade = this.ScrollBarDefaultDelayBeforeFade
171+
member this.ScrollBarFadeDuration = this.ScrollBarFadeDuration
172+
member this.ScrollBarFadingEnabled = this.ScrollBarFadingEnabled
173+
member this.ScrollBarSize = this.ScrollBarSize
168174
member this.ScrollBarStyle = this.ScrollBarStyle
169175
member this.ScrollBy = this.ScrollBy
170176
member this.ScrollTo = this.ScrollTo
171177
member this.Selected = this.Selected
172178
member this.SoundEffectsEnabled = this.SoundEffectsEnabled
173179
//member this.StateListAnimator = this.StateListAnimator
174-
//member this.SystemUiVisibility = this.SystemUiVisibility
175-
//member this.TextAlignment = this.TextAlignment
176-
//member this.TextDirection = this.TextDirection
180+
member this.SystemUiVisibility = this.SystemUiVisibility
181+
member this.TextAlignment = this.TextAlignment
182+
member this.TextDirection = this.TextDirection
177183
member this.TransitionName = this.TransitionName
178184
member this.Translation = this.Translation
179185
member this.VerticalFadingEdgeEnabled = this.VerticalFadingEdgeEnabled
180186
member this.VerticalScrollBarEnabled = this.VerticalScrollBarEnabled
181-
//member this.VerticalScrollbarPosition = this.VerticalScrollbarPosition
187+
member this.VerticalScrollbarPosition = this.VerticalScrollbarPosition
182188
member this.Visibility = this.Visibility
183189

184190
// TextView Props
@@ -194,9 +200,13 @@ module private ButtonProps =
194200
Activated = TextViewProps.Default.Activated
195201
Alpha = TextViewProps.Default.Alpha
196202
Background = TextViewProps.Default.Background
203+
CameraDistance = TextViewProps.Default.CameraDistance
197204
Clickable = TextViewProps.Default.Clickable
205+
ClipBounds = ViewProps.Default.ClipBounds
206+
ClipToOutline = TextViewProps.Default.ClipToOutline
198207
ContentDescription = TextViewProps.Default.ContentDescription
199208
ContextClickable = TextViewProps.Default.ContextClickable
209+
DrawingCacheBackgroundColor = TextViewProps.Default.DrawingCacheBackgroundColor
200210
DrawingCacheEnabled = TextViewProps.Default.DrawingCacheEnabled
201211
DrawingCacheQuality = TextViewProps.Default.DrawingCacheQuality
202212
Elevation = TextViewProps.Default.Elevation
@@ -238,32 +248,32 @@ module private ButtonProps =
238248
OnSystemUiVisibilityChange = TextViewProps.Default.OnSystemUiVisibilityChange
239249
OnTouch = TextViewProps.Default.OnTouch
240250
//OutlineProvider = TextViewProps.Default.OutlineProvider
241-
OverScrollBy = TextViewProps.Default.OverScrollBy
242251
OverScrollMode = TextViewProps.Default.OverScrollMode
243252
Padding = TextViewProps.Default.Padding
244253
Pivot = ViewProps.Default.Pivot
245254
RequestFocus = TextViewProps.Default.RequestFocus
246255
Rotation = TextViewProps.Default.Rotation
247256
Scale = TextViewProps.Default.Scale
248-
//ScrollBarDefaultDelayBeforeFade = TextViewProps.Default.ScrollBarDefaultDelayBeforeFade
249-
//ScrollBarFadeDuration = TextViewProps.Default.ScrollBarDefaultDelayBeforeFade
250-
//ScrollBarFadingEnabled = TextViewProps.Default.ScrollBarFadingEnabled
251-
//ScrollBarSize = TextViewProps.Default.ScrollBarSize
257+
ScrollBarDefaultDelayBeforeFade = TextViewProps.Default.ScrollBarDefaultDelayBeforeFade
258+
ScrollBarFadeDuration = TextViewProps.Default.ScrollBarDefaultDelayBeforeFade
259+
ScrollBarFadingEnabled = TextViewProps.Default.ScrollBarFadingEnabled
260+
ScrollBarSize = TextViewProps.Default.ScrollBarSize
252261
ScrollBarStyle = TextViewProps.Default.ScrollBarStyle
253262
ScrollBy = TextViewProps.Default.ScrollBy
254263
ScrollTo = TextViewProps.Default.ScrollTo
255264
Selected = TextViewProps.Default.Selected
256265
SoundEffectsEnabled = TextViewProps.Default.SoundEffectsEnabled
257266
//StateListAnimator = TextViewProps.Default.StateListAnimator
258-
//SystemUiVisibility = TextViewProps.Default.SystemUiVisibility
259-
//TextAlignment = TextViewProps.Default.TextAlignment
260-
//TextDirection = TextViewProps.Default.TextDirection
267+
SystemUiVisibility = TextViewProps.Default.SystemUiVisibility
268+
TextAlignment = TextViewProps.Default.TextAlignment
269+
TextDirection = TextViewProps.Default.TextDirection
261270
TransitionName = TextViewProps.Default.TransitionName
262271
Translation = TextViewProps.Default.Translation
263272
VerticalFadingEdgeEnabled = TextViewProps.Default.VerticalFadingEdgeEnabled
264273
VerticalScrollBarEnabled = TextViewProps.Default.VerticalScrollBarEnabled
265-
//VerticalScrollbarPosition = TextViewProps.Default.VerticalScrollbarPosition
274+
VerticalScrollbarPosition = TextViewProps.Default.VerticalScrollbarPosition
266275
Visibility = TextViewProps.Default.Visibility
276+
267277
// TextView
268278
text = ""
269279
}

0 commit comments

Comments
 (0)