Class RefreshIndicator

  • All Implemented Interfaces:
    Styleable, EventTarget, Skinnable

    public class RefreshIndicator
    extends Control
    RefreshIndicator is mostly used along with "Swipe to refresh" functionality. The refresh indicator appears only in conjunction with a refresh gesture or action. Syncing displays a ProgressIndicator instead of a refresh indicator.

    The refresh indicator has two modes :

    • PULLING - Shows the pull progress. This is the default mode.
    • REFRESHING - Shows the sync progress and uses a ProgressIndicator to show the progress. Can use either a determinate or an indeterminate ProgressIndicator.

    The radius of the arc of the refresh indicator can be handled by the radius property.

    This first example creates a refresh indicator in pull mode and with pull progress as 0.5:

     import com.gluonhq.impl.charm.glisten.control.RefreshIndicator;
    
     RefreshIndicator refreshIndicator = new RefreshIndicator();
     refreshIndicator.setPullProgress(0.5);
     

    For setting a color to the refresh indicator, the style "-fx-color" can be used as shown in the example below:

     import com.gluonhq.impl.charm.glisten.control.RefreshIndicator;
    
     RefreshIndicator refreshIndicator = new RefreshIndicator();
     refreshIndicator.setStyle("-fx-color: red;");
     
    Since:
    2.3.0
    • Constructor Detail

      • RefreshIndicator

        public RefreshIndicator()
        Creates a RefreshIndicator with default radius as 12
    • Method Detail

      • setProgress

        public final void setProgress​(double value)
        Sets the value of the property progress.
        Property description:
        The actual progress of the ProgressIndicator. A negative value for progress indicates that the progress is indeterminate. A positive value between 0 and 1 indicates the percentage of progress where 0 is 0% and 1 is 100%. Any value greater than 1 is interpreted as 100%.
      • getProgress

        public final double getProgress()
        Gets the value of the property progress.
        Property description:
        The actual progress of the ProgressIndicator. A negative value for progress indicates that the progress is indeterminate. A positive value between 0 and 1 indicates the percentage of progress where 0 is 0% and 1 is 100%. Any value greater than 1 is interpreted as 100%.
      • progressProperty

        public final DoubleProperty progressProperty()
        The actual progress of the ProgressIndicator. A negative value for progress indicates that the progress is indeterminate. A positive value between 0 and 1 indicates the percentage of progress where 0 is 0% and 1 is 100%. Any value greater than 1 is interpreted as 100%.
        See Also:
        getProgress(), setProgress(double)
      • getPullProgress

        public double getPullProgress()
        Gets the value of the property pullProgress.
        Property description:
        The actual pull progress of the RefreshIndicator. The value increases from 0 to 1 when the pull is undergoing. A value 1 means that the mode will be changed from PULLING to REFRESHING. i.e. the sync process will start and the refresh arc will be replaced by a progress indicator.
      • pullProgressProperty

        public DoubleProperty pullProgressProperty()
        The actual pull progress of the RefreshIndicator. The value increases from 0 to 1 when the pull is undergoing. A value 1 means that the mode will be changed from PULLING to REFRESHING. i.e. the sync process will start and the refresh arc will be replaced by a progress indicator.
        See Also:
        getPullProgress(), setPullProgress(double)
      • setPullProgress

        public void setPullProgress​(double pullProgress)
        Sets the value of the property pullProgress.
        Property description:
        The actual pull progress of the RefreshIndicator. The value increases from 0 to 1 when the pull is undergoing. A value 1 means that the mode will be changed from PULLING to REFRESHING. i.e. the sync process will start and the refresh arc will be replaced by a progress indicator.
      • setRadius

        public final void setRadius​(double value)
        Sets the value of the property radius.
        Property description:
        The radius of the RefreshIndicator's arc.

        Default value is 12.

      • getRadius

        public final double getRadius()
        Gets the value of the property radius.
        Property description:
        The radius of the RefreshIndicator's arc.

        Default value is 12.

      • getClassCssMetaData

        public static List<CssMetaData<? extends Styleable,​?>> getClassCssMetaData()
        Returns:
        The CssMetaData associated with this class, which may include the CssMetaData of its super classes.
        Since:
        JavaFX 8.0