:right-sidebar: True TimedAnimation =================================================================== .. currentmodule:: gi.repository.Adw .. class:: TimedAnimation(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Adw.Animation`, :class:`~gi.repository.GObject.Object` A time-based :obj:`~gi.repository.Adw.Animation`\. ``AdwTimedAnimation`` implements a simple animation interpolating the given value from :obj:`~gi.repository.Adw.TimedAnimation.props.value_from` to :obj:`~gi.repository.Adw.TimedAnimation.props.value_to` over :obj:`~gi.repository.Adw.TimedAnimation.props.duration` milliseconds using the curve described by :obj:`~gi.repository.Adw.TimedAnimation.props.easing`\. If :obj:`~gi.repository.Adw.TimedAnimation.props.reverse` is set to ``TRUE``\, ``AdwTimedAnimation`` will instead animate from :obj:`~gi.repository.Adw.TimedAnimation.props.value_to` to :obj:`~gi.repository.Adw.TimedAnimation.props.value_from`\, and the easing curve will be inverted. The animation can repeat a certain amount of times, or endlessly, depending on the :obj:`~gi.repository.Adw.TimedAnimation.props.repeat_count` value. If :obj:`~gi.repository.Adw.TimedAnimation.props.alternate` is set to ``TRUE``\, it will also change the direction every other iteration. Constructors ------------ .. rst-class:: interim-class .. class:: TimedAnimation :no-index: .. classmethod:: new(widget: ~gi.repository.Gtk.Widget, from_: float, to: float, duration: int, target: ~gi.repository.Adw.AnimationTarget) -> ~gi.repository.Adw.Animation Creates a new ``AdwTimedAnimation`` on ``widget`` to animate ``target`` from ``from`` to ``to``\. :param widget: a widget to create animation on :param from_: :param to: a value to animate to :param duration: a duration for the animation :param target: a target value to animate Methods ------- .. rst-class:: interim-class .. class:: TimedAnimation :no-index: .. method:: get_alternate() -> bool Gets whether ``self`` changes direction on every iteration. .. method:: get_duration() -> int Gets the duration of ``self``\. .. method:: get_easing() -> ~gi.repository.Adw.Easing Gets the easing function ``self`` uses. .. method:: get_repeat_count() -> int Gets the number of times ``self`` will play. .. method:: get_reverse() -> bool Gets whether ``self`` plays backwards. .. method:: get_value_from() -> float Gets the value ``self`` will animate from. .. method:: get_value_to() -> float Gets the value ``self`` will animate to. .. method:: set_alternate(alternate: bool) -> None Sets whether ``self`` changes direction on every iteration. :param alternate: whether ``self`` alternates .. method:: set_duration(duration: int) -> None Sets the duration of ``self``\. If the animation repeats more than once, sets the duration of one iteration. :param duration: the duration to use, in milliseconds .. method:: set_easing(easing: ~gi.repository.Adw.Easing) -> None Sets the easing function ``self`` will use. See :obj:`~gi.repository.Adw.Easing` for the description of specific easing functions. :param easing: the easing function to use .. method:: set_repeat_count(repeat_count: int) -> None Sets the number of times ``self`` will play. If set to 0, ``self`` will repeat endlessly. :param repeat_count: the number of times ``self`` will play .. method:: set_reverse(reverse: bool) -> None Sets whether ``self`` plays backwards. :param reverse: whether ``self`` plays backwards .. method:: set_value_from(value: float) -> None Sets the value ``self`` will animate from. The animation will start at this value and end at :obj:`~gi.repository.Adw.TimedAnimation.props.value_to`\. If :obj:`~gi.repository.Adw.TimedAnimation.props.reverse` is ``TRUE``\, the animation will end at this value instead. :param value: the value to animate from .. method:: set_value_to(value: float) -> None Sets the value ``self`` will animate to. The animation will start at :obj:`~gi.repository.Adw.TimedAnimation.props.value_from` and end at this value. If :obj:`~gi.repository.Adw.TimedAnimation.props.reverse` is ``TRUE``\, the animation will start at this value instead. :param value: the value to animate to Properties ---------- .. rst-class:: interim-class .. class:: TimedAnimation :no-index: .. attribute:: props.alternate :type: bool The type of the None singleton. .. attribute:: props.duration :type: int The type of the None singleton. .. attribute:: props.easing :type: ~gi.repository.Adw.Easing The type of the None singleton. .. attribute:: props.repeat_count :type: int The type of the None singleton. .. attribute:: props.reverse :type: bool The type of the None singleton. .. attribute:: props.value_from :type: float The type of the None singleton. .. attribute:: props.value_to :type: float The type of the None singleton.