:github_url: https://github.com/kivymd/KivyMD/blob/master/kivymd/uix/progressindicator/progressindicator.py

ProgressIndicator
=================

.. py:module:: kivymd.uix.progressindicator.progressindicator

.. autoapi-nested-parse::

   Components/ProgressIndicator
   ============================

   .. seealso::

       `Material Design spec, ProgressIndicator <https://m3.material.io/components/progress-indicators/overview>`_

   .. rubric:: Progress indicators show the status of a process in real time.

   - Use the same progress indicator for all instances of a process (like loading)
   - Two types: linear and circular
   - Never use them as decoration
   - They capture attention through motion

   .. image:: https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/progress-indicator-types.png
       :align: center

   1. Linear progress indicator
   2. Circular progress indicator

   Usage
   -----

   .. tabs::

       .. tab:: Declarative Python style with KV

           .. code-block:: python

               from kivy.lang import Builder

               from kivymd.app import MDApp

               KV = '''
               MDScreen:
                   md_bg_color: self.theme_cls.backgroundColor

                   MDLinearProgressIndicator:
                       size_hint_x: .5
                       value: 50
                       pos_hint: {'center_x': .5, 'center_y': .5}
               '''


               class Example(MDApp):
                   def build(self):
                       self.theme_cls.theme_style = "Dark"
                       return Builder.load_string(KV)

               Example().run()

       .. tab:: Declarative Python style

           .. code-block:: python

               from kivymd.app import MDApp
               from kivymd.uix.progressindicator import MDLinearProgressIndicator
               from kivymd.uix.screen import MDScreen


               class Example(MDApp):
                   def build(self):
                       self.theme_cls.theme_style = "Dark"
                       return (
                           MDScreen(
                               MDLinearProgressIndicator(
                                   size_hint_x=.5,
                                   value=50,
                                   pos_hint={'center_x': .5, 'center_y': .5},
                               ),
                               md_bg_color=self.theme_cls.backgroundColor
                           )
                       )


               Example().run()

   .. image:: https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/linear-progress-indicator-usage.png
       :align: center

   .. tabs::

       .. tab:: Declarative Python style with KV

           .. code-block:: python

               from kivy.lang import Builder

               from kivymd.app import MDApp

               KV = '''
               MDScreen:
                   md_bg_color: self.theme_cls.backgroundColor

                   MDCircularProgressIndicator:
                       size_hint: None, None
                       size: "48dp", "48dp"
                       pos_hint: {'center_x': .5, 'center_y': .5}
               '''


               class Example(MDApp):
                   def build(self):
                       self.theme_cls.theme_style = "Dark"
                       return Builder.load_string(KV)


               Example().run()

       .. tab:: Declarative Python style

           .. code-block:: python

               from kivymd.app import MDApp
               from kivymd.uix.progressindicator import MDCircularProgressIndicator
               from kivymd.uix.screen import MDScreen


               class Example(MDApp):
                   def build(self):
                       self.theme_cls.theme_style = "Dark"
                       return (
                           MDScreen(
                               MDCircularProgressIndicator(
                                   size_hint=(None, None),
                                   size=("48dp", "48dp"),
                                   pos_hint={'center_x': .5, 'center_y': .5},
                               ),
                               md_bg_color=self.theme_cls.backgroundColor
                           )
                       )


               Example().run()

   .. image:: https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/circular-progress-indicator-usage.gif
       :align: center

   Linear progress indicators can be determinate or indeterminate.

   Determinate linear progress indicator
   -------------------------------------

   Determinate operations display the indicator increasing from 0 to 100% of the
   track, in sync with the process’s progress.

   .. tabs::

       .. tab:: Declarative Python style with KV

           .. code-block:: python

               from kivy.lang import Builder

               from kivymd.app import MDApp

               KV = '''
               MDScreen:
                   md_bg_color: self.theme_cls.backgroundColor

                   MDLinearProgressIndicator:
                       id: progress
                       size_hint_x: .5
                       type: "determinate"
                       pos_hint: {'center_x': .5, 'center_y': .4}
               '''


               class Example(MDApp):
                   def on_start(self):
                       self.root.ids.progress.start()

                   def build(self):
                       self.theme_cls.theme_style = "Dark"
                       return Builder.load_string(KV)


               Example().run()

       .. tab:: Declarative Python style

           .. code-block:: python

               from kivymd.app import MDApp
               from kivymd.uix.progressindicator import MDLinearProgressIndicator
               from kivymd.uix.screen import MDScreen


               class Example(MDApp):
                   def on_start(self):
                       self.root.get_ids().progress.start()

                   def build(self):
                       self.theme_cls.theme_style = "Dark"
                       return (
                           MDScreen(
                               MDLinearProgressIndicator(
                                   id="progress",
                                   type="determinate",
                                   size_hint_x=.5,
                                   value=50,
                                   pos_hint={'center_x': .5, 'center_y': .5},
                               ),
                               md_bg_color=self.theme_cls.backgroundColor
                           )
                       )


               Example().run()

   .. image:: https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/determinate-linear-progress-indicator.gif
       :align: center

   Circular progress indicators can be determinate or indeterminate.

   Indeterminate circular progress indicator
   -----------------------------------------

   Indeterminate operations display the indicator continually growing and
   shrinking along the track until the process is complete..

   .. tabs::

       .. tab:: Declarative KV style

           .. code-block:: kv

               MDCircularProgressIndicator:
                   size_hint: None, None
                   size: "48dp", "48dp"

       .. tab:: Declarative Python style

           .. code-block:: python

               MDCircularProgressIndicator(
                   size_hint=(None, None),
                   size=("48dp", "48dp"),
               )

   .. image:: https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/circular-progress-indicator-usage.gif
       :align: center

   Determinate circular progress indicator
   ---------------------------------------

   .. tabs::

       .. tab:: Declarative KV style

           .. code-block:: kv

               MDCircularProgressIndicator:
                   size_hint: None, None
                   size: "48dp", "48dp"
                   determinate: True
                   on_determinate_complete: print(args)

       .. tab:: Declarative Python style

           .. code-block:: python

                   MDCircularProgressIndicator(
                       determinate=True,
                       size_hint=(None, None),
                       size=("48dp", "48dp"),
                       on_determinate_complete=lambda *args: print(args),
                   )

   .. image:: https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/determinate-circular-progress-indicator.gif
       :align: center

   API break
   =========

   1.1.1 version
   -------------

   .. code-block:: kv

       MDProgressBar:
           value: 50
           color: app.theme_cls.accent_color

   .. code-block:: kv

       MDSpinner:
           size_hint: None, None
           size: dp(48), dp(48)

   2.0.0 version
   -------------

   .. tabs::

       .. tab:: Declarative KV style

           .. code-block:: kv

               MDLinearProgressIndicator:
                   value: 50
                   indicator_color: app.theme_cls.errorColor

       .. tab:: Declarative Python style

           .. code-block:: python

               MDLinearProgressIndicator(
                   value=50,
                   indicator_color=self.theme_cls.errorColor,
               )

   .. tabs::

       .. tab:: Declarative KV style

           .. code-block:: kv

               MDCircularProgressIndicator:
                   size_hint: None, None
                   size: dp(48), dp(48)

       .. tab:: Declarative Python style

           .. code-block:: python

                   MDCircularProgressIndicator(
                       size_hint=(None, None),
                       size=("48dp", "48dp"),
                   )


API - :mod:`kivymd.uix.progressindicator.progressindicator`
-----------------------------------------------------------

.. py:class:: MDLinearProgressIndicator(**kwargs)




   Implementation of the linear progress indicator.

   For more information, see in the
   :class:`~kivymd.uix.behaviors.declarative_behavior.DeclarativeBehavior` and
   :class:`~kivymd.theming.ThemableBehavior` and
   :class:`~kivy.uix.progressbar.ProgressBar`
   classes documentation.

   .. py:attribute:: radius

      Progress line radius.

      .. versionadded:: 1.2.0

      :attr:`radius` is an :class:`~kivy.properties.VariableListProperty`
      and defaults to `[0, 0, 0, 0]`.


   .. py:attribute:: reversed

      Reverse the direction the progressbar moves.

      :attr:`reversed` is an :class:`~kivy.properties.BooleanProperty`
      and defaults to `False`.


   .. py:attribute:: orientation

      Orientation of progressbar. Available options are: `'horizontal '`,
      `'vertical'`.

      :attr:`orientation` is an :class:`~kivy.properties.OptionProperty`
      and defaults to `'horizontal'`.


   .. py:attribute:: indicator_color

      Color of the active track.

      .. versionchanged:: 2.0.0

          Rename from `color` to `indicator_color` attribute.

      :attr:`indicator_color` is an :class:`~kivy.properties.ColorProperty`
      and defaults to `None`.


   .. py:attribute:: track_color

      Progress bar back color in (r, g, b, a) or string format.

      .. versionadded:: 1.0.0

      .. versionchanged:: 2.0.0

          Rename from `back_color` to `track_color` attribute.

      :attr:`track_color` is an :class:`~kivy.properties.ColorProperty`
      and defaults to `None`.


   .. py:attribute:: running_determinate_transition

      Running transition.

      .. versionchanged:: 2.0.0

          Rename from `running_transition` to `running_determinate_transition`
          attribute.

      :attr:`running_determinate_transition` is an :class:`~kivy.properties.StringProperty`
      and defaults to `'out_quart'`.


   .. py:attribute:: catching_determinate_transition

      Catching transition.

      .. versionchanged:: 2.0.0

          Rename from `catching_transition` to `catching_determinate_transition`
          attribute.

      :attr:`catching_determinate_transition` is an :class:`~kivy.properties.StringProperty`
      and defaults to `'out_quart'`.


   .. py:attribute:: running_determinate_duration

      Running duration.

      .. versionchanged:: 2.0.0

          Rename from `running_duration` to `running_determinate_duration`
          attribute.

      :attr:`running_determinate_duration` is an :class:`~kivy.properties.NumericProperty`
      and defaults to `2.5`.


   .. py:attribute:: catching_determinate_duration

      Catching duration.

      :attr:`running_duration` is an :class:`~kivy.properties.NumericProperty`
      and defaults to `0.8`.


   .. py:attribute:: type

      Type of progressbar. Available options are: `'indeterminate '`,
      `'determinate'`.

      :attr:`type` is an :class:`~kivy.properties.OptionProperty`
      and defaults to `None`.


   .. py:attribute:: running_indeterminate_transition

      Running transition.

      :attr:`running_indeterminate_transition` is an :class:`~kivy.properties.StringProperty`
      and defaults to `'in_cubic'`.


   .. py:attribute:: catching_indeterminate_transition

      Catching transition.

      :attr:`catching_indeterminate_transition` is an :class:`~kivy.properties.StringProperty`
      and defaults to `'out_quart'`.


   .. py:attribute:: running_indeterminate_duration

      Running duration.

      :attr:`running_indeterminate_duration` is an :class:`~kivy.properties.NumericProperty`
      and defaults to `0.5`.


   .. py:attribute:: catching_indeterminate_duration

      Catching duration.

      :attr:`catching_indeterminate_duration` is an :class:`~kivy.properties.NumericProperty`
      and defaults to `0.8`.


   .. py:method:: check_size(*args) -> None


   .. py:method:: start() -> None

      Start animation.


   .. py:method:: stop() -> None

      Stop animation.


   .. py:method:: running_away(*args) -> None


   .. py:method:: catching_up(*args) -> None


   .. py:method:: on_value(instance, value)



.. py:class:: MDCircularProgressIndicator(**kwargs)




   Implementation of the circular progress indicator.

   .. versionchanged:: 2.0.0

       Rename `MDSpinner` to `MDCircularProgressIndicator` class.

   For more information, see in the
   :class:`~kivymd.theming.ThemableBehavior` and
   :class:`~kivy.uix.widget.Widget`
   classes documentation.

   It can be used either as an indeterminate indicator that loops while
   the user waits for something to happen, or as a determinate indicator.

   Set :attr:`determinate` to **True** to activate determinate mode, and
   :attr:`determinate_time` to set the duration of the animation.

   :Events:
       `on_determinate_complete`
           The event is called at the end of the indicator loop in the
           `determinate = True` mode.

   .. py:attribute:: determinate

      Determinate value.

      :attr:`determinate` is a :class:`~kivy.properties.BooleanProperty`
      and defaults to `False`.


   .. py:attribute:: determinate_time

      Determinate time value.

      :attr:`determinate_time` is a :class:`~kivy.properties.NumericProperty`
      and defaults to `2`.


   .. py:attribute:: line_width

      Progress line width of indicator.

      :attr:`line_width` is a :class:`~kivy.properties.NumericProperty`
      and defaults to `dp(2.25)`.


   .. py:attribute:: active

      Use :attr:`active` to start or stop the indicator.

      :attr:`active` is a :class:`~kivy.properties.BooleanProperty`
      and defaults to `True`.


   .. py:attribute:: color

      Indicator color in (r, g, b, a) or string format.

      :attr:`color` is a :class:`~kivy.properties.ColorProperty`
      and defaults to `None`.


   .. py:attribute:: palette

      A set of colors. Changes with each completed indicator cycle.

      :attr:`palette` is a :class:`~kivy.properties.ListProperty`
      and defaults to `[]`.


   .. py:method:: on__rotation_angle(*args)


   .. py:method:: on_palette(instance, palette_list: list) -> None

      Fired when the `palette` value changes.


   .. py:method:: on_active(instance, value) -> None

      Fired when the `active` value changes.


   .. py:method:: on_determinate_complete(*args) -> None

      The event is fired at the end of the indicator loop in the
      `determinate = True` mode.


   .. py:method:: check_determinate(*args) -> None

      Fired when the class is initialized.




