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 138138 _ => AnimationTimingFunction :: EasingFunction ( timing_function. get ( 0 ) . unwrap ( ) . clone ( ) ) ,
139139 } ) ;
140140 }
141+ Property :: AnimationFillMode ( fill_mode, _) => {
142+ animation_fill_mode = Some ( fill_mode. get ( 0 ) . unwrap ( ) . clone ( ) ) ;
143+ }
141144 _ => { }
142145 }
143146
@@ -176,11 +179,13 @@ impl ToExpr for Animation {
176179 ) )
177180 }
178181 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) ) ) ;
184189 }
185190 if let Some ( timeing_function) = & self . animation_timeing_function {
186191 match timeing_function {
Original file line number Diff line number Diff line change @@ -208,6 +208,11 @@ impl From<(String, &Property<'_>)> for AnimationMulti {
208208 animation_play_states. push ( animation_play_state. unwrap_or ( style_property_enum:: ArkUI_AnimationPlayState :: ARKUI_ANIMATION_PLAY_STATE_RUNNING ) ) ;
209209 }
210210 }
211+ Property :: AnimationFillMode ( fill_mode, _) => {
212+ for fill_mode_elem in fill_mode {
213+ animation_fill_modes. push ( fill_mode_elem. clone ( ) ) ;
214+ }
215+ }
211216 _ => { }
212217 }
213218
@@ -310,9 +315,13 @@ impl ToExpr for AnimationMulti {
310315 let array_elements: Vec < _ > = fill_modes
311316 . into_iter ( )
312317 . 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) ;
316325 Some ( ExprOrSpread {
317326 spread : None ,
318327 expr : Box :: new ( expr) ,
You can’t perform that action at this time.
0 commit comments