Skip to main content

ohos_arkui_binding/animate/animator/
event.rs

1//! Module animate::animator::event wrappers and related types.
2
3/// Marker payload for animator lifecycle callbacks.
4#[derive(Clone, Copy, Debug, Default)]
5pub struct AnimatorEvent;
6
7impl AnimatorEvent {
8    pub(crate) fn new() -> Self {
9        Self
10    }
11}
12
13/// Frame callback payload carrying interpolated value.
14#[derive(Clone, Copy, Debug)]
15pub struct AnimatorFrameEvent {
16    value: f32,
17}
18
19impl AnimatorFrameEvent {
20    pub(crate) fn new(value: f32) -> Self {
21        Self { value }
22    }
23
24    pub fn value(&self) -> f32 {
25        self.value
26    }
27}