FUIProcessingIndicatorView

open class FUIProcessingIndicatorView : NibDesignable

FUIProcessingIndicatorView is an IBDesignable UI component. A processing indicator shows that a task is in progress. It shows a circular activity indicator to visualize indeterminate processing and has an optional UILabel below the activity indicator indicating to the user what is being processed.

By default, this view is not visible and the animation is stopped. The activity indicator has a predefined size and line width that depends on the horizontal size class.

Initialization

Programmatically:

let processingIndicatorView = FUIProcessingIndicatorView(frame: CGRect())

Inside a Storyboard or xib:

  1. Drag and drop a UIView component to Interface Builder’s canvas.
  2. Switch class name from UIView to FUIProcessingIndicatorView, and set module to SAPFiori.
  3. Create an outlet of the processing indicator view to be able to access its properties.

Usage

processingIndicatorView.show()
// do something
processingIndicatorView.dismiss()

Animation

The animation of the processing indicator can be started or stopped without affecting the visibility of the view.

processingIndicatorView.startAnimating()
// do something
processingIndicatorView.stopAnimating()

Theming

The styleClass of the view is fdlFUIProcessingIndicatorView.

In the .nss file you can use the following parameters:

  • fdlFUIProcessingIndicatorView_textLabel: changes the appearance of the textLabel

Example:

fdlFUIProcessingIndicatorView_textLabel {
   background-color: red;
   border-color: green;
   border-width: 2;
   corner-radius: 2;
   font-color: blue;
   font-color-highlighted: yellow;
   font-name: Avenir;
   font-size: 15;
   height: 50;
   shadow-color: black;
   shadow-offset: 1, 2;
   shadow-opacity: 0.5;
   shadow-radius: 2;
   text-align: center;
   text-alpha: 0.9;
   text-auto-fit: true;
   text-shadow-color: black;
   text-shadow-offset: 1, 2;
   text-transform: uppercase;
   text-line-clamp:6;
   width: 100;
}
  • Text label below the circular activity indicator.

    Declaration

    Swift

    @IBOutlet
    weak public var textLabel: UILabel!
  • Text of textLabel. The default is nil.

    Declaration

    Swift

    @IBInspectable
    public var text: String? { get set }
  • A boolean value indicating whether textLabel is hidden. The default is false.

    Declaration

    Swift

    @IBInspectable
    public var isTextLabelHidden: Bool { get set }
  • A boolean value indicating whether the processing indicator is currently rotating.

    Declaration

    Swift

    public var isAnimating: Bool { get }
  • Shows the processing indicator and starts rotating.

    Declaration

    Swift

    open func show(animated: Bool = true)

    Parameters

    animated

    whether the processing indicator is shown with a fade animation. The default is true.

  • Dismisses the processing indicator and stops rotating.

    Declaration

    Swift

    open func dismiss(animated: Bool = true)

    Parameters

    animated

    whether the processing indicator is dismissed with a fade animation. The default is true.

  • Starts the rotation animation until it is stopped.

    Declaration

    Swift

    open func startAnimating(easeIn: Bool = true)

    Parameters

    easeIn

    whether the circle starts rotating slowly and accelerates. The default is true.

  • Stops the rotation animation.

    Declaration

    Swift

    open func stopAnimating(easeOut: Bool = true)

    Parameters

    easeOut

    whether the circle rotation slows down before stopping. The default is true.