Skip to main content

Animation

Struct Animation 

Source
pub struct Animation { /* private fields */ }
Expand description

High-level wrapper for ArkUI_AnimateOption.

Implementations§

Source§

impl Animation

Source

pub fn new() -> Self

Creates default animation options.

Source

pub fn duration(&self, duration: i32)

Sets animation duration in milliseconds.

Source

pub fn get_duration(&self) -> u32

Source

pub fn tempo(&self, tempo: f32)

Sets playback speed multiplier.

Source

pub fn get_tempo(&self) -> f32

Source

pub fn delay(&self, delay: i32)

Sets start delay in milliseconds.

Source

pub fn get_delay(&self) -> i32

Source

pub fn iterations(&self, iterations: i32)

Sets iteration count (-1 for infinite).

Source

pub fn get_iterations(&self) -> i32

Source

pub fn curve(&self, curve: Curve)

Selects built-in easing curve.

Source

pub fn get_curve(&self) -> Option<Curve>

Source

pub fn i_curve(&self, curve: &CurveHandle)

Selects custom curve handle.

Source

pub fn get_i_curve(&self) -> Option<CurveHandle>

Source

pub fn mode(&self, mode: AnimationMode)

Sets animation play mode.

Source

pub fn get_mode(&self) -> Option<AnimationMode>

Source

pub fn rate_range(&self, range: AnimationFrameRateRange)

Sets expected frame-rate range.

Source

pub fn get_rate_range(&self) -> AnimationFrameRateRange

Source

pub fn update<T: Fn() + 'static>(&self, callback: T)

Registers update callback.

Source

pub fn finish<T: Fn() + 'static>( &self, callback_type: AnimationFinishCallbackType, callback: T, )

Registers finish callback with callback-type selector.

Source

pub fn animate_to(&self, ctx: ArkUIContext) -> ArkUIResult<()>

Trait Implementations§

Source§

impl Default for Animation

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for Animation

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.