File tree Expand file tree Collapse file tree 2 files changed +22
-8
lines changed Expand file tree Collapse file tree 2 files changed +22
-8
lines changed Original file line number Diff line number Diff line change 138
138
_ => AnimationTimingFunction :: EasingFunction ( timing_function. get ( 0 ) . unwrap ( ) . clone ( ) ) ,
139
139
} ) ;
140
140
}
141
+ Property :: AnimationFillMode ( fill_mode, _) => {
142
+ animation_fill_mode = Some ( fill_mode. get ( 0 ) . unwrap ( ) . clone ( ) ) ;
143
+ }
141
144
_ => { }
142
145
}
143
146
@@ -176,11 +179,13 @@ impl ToExpr for Animation {
176
179
) )
177
180
}
178
181
if let Some ( fill_mode) = & self . animation_fill_mode {
179
- // exprs.push((CSSPropertyType::AnimationFillMode, generate_expr_enum!(*fill_mode)));
180
- exprs. push ( (
181
- CSSPropertyType :: AnimationFillMode ,
182
- generate_expr_lit_str ! ( fill_mode. to_css_string( PrinterOptions :: default ( ) ) . unwrap( ) ) ,
183
- ) ) ;
182
+ let enum_value = match fill_mode {
183
+ AnimationFillMode :: None => style_property_enum:: ArkUI_AnimationFillMode :: ARKUI_ANIMATION_FILL_MODE_NONE ,
184
+ AnimationFillMode :: Forwards => style_property_enum:: ArkUI_AnimationFillMode :: ARKUI_ANIMATION_FILL_MODE_FORWARDS ,
185
+ AnimationFillMode :: Backwards => style_property_enum:: ArkUI_AnimationFillMode :: ARKUI_ANIMATION_FILL_MODE_BACKWARDS ,
186
+ AnimationFillMode :: Both => style_property_enum:: ArkUI_AnimationFillMode :: ARKUI_ANIMATION_FILL_MODE_BOTH ,
187
+ } ;
188
+ exprs. push ( ( CSSPropertyType :: AnimationFillMode , generate_expr_enum ! ( enum_value) ) ) ;
184
189
}
185
190
if let Some ( timeing_function) = & self . animation_timeing_function {
186
191
match timeing_function {
Original file line number Diff line number Diff line change @@ -208,6 +208,11 @@ impl From<(String, &Property<'_>)> for AnimationMulti {
208
208
animation_play_states. push ( animation_play_state. unwrap_or ( style_property_enum:: ArkUI_AnimationPlayState :: ARKUI_ANIMATION_PLAY_STATE_RUNNING ) ) ;
209
209
}
210
210
}
211
+ Property :: AnimationFillMode ( fill_mode, _) => {
212
+ for fill_mode_elem in fill_mode {
213
+ animation_fill_modes. push ( fill_mode_elem. clone ( ) ) ;
214
+ }
215
+ }
211
216
_ => { }
212
217
}
213
218
@@ -310,9 +315,13 @@ impl ToExpr for AnimationMulti {
310
315
let array_elements: Vec < _ > = fill_modes
311
316
. into_iter ( )
312
317
. map ( |fill_mode| {
313
- // Assuming `generate_expr_lit_num!` generates a numeric expression
314
- let expr =
315
- generate_expr_lit_str ! ( fill_mode. to_css_string( PrinterOptions :: default ( ) ) . unwrap( ) ) ;
318
+ let enum_value = match fill_mode {
319
+ AnimationFillMode :: None => style_property_enum:: ArkUI_AnimationFillMode :: ARKUI_ANIMATION_FILL_MODE_NONE ,
320
+ AnimationFillMode :: Forwards => style_property_enum:: ArkUI_AnimationFillMode :: ARKUI_ANIMATION_FILL_MODE_FORWARDS ,
321
+ AnimationFillMode :: Backwards => style_property_enum:: ArkUI_AnimationFillMode :: ARKUI_ANIMATION_FILL_MODE_BACKWARDS ,
322
+ AnimationFillMode :: Both => style_property_enum:: ArkUI_AnimationFillMode :: ARKUI_ANIMATION_FILL_MODE_BOTH ,
323
+ } ;
324
+ let expr = generate_expr_enum ! ( enum_value) ;
316
325
Some ( ExprOrSpread {
317
326
spread : None ,
318
327
expr : Box :: new ( expr) ,
You can’t perform that action at this time.
0 commit comments