LogoLogo
v7.0.0
v7.0.0
  • TotalCross Overview
  • TotalCross Javadoc
  • TotalCross Changelog
  • Roadmap
  • Documentation
    • Getting Started
      • First embedded project with TotalCross
    • Components
      • Accordion
      • Aligned Labels
      • Button
      • Check
      • ComboBox
      • Dynamic Scroll
      • Edit
      • Floating Button
      • Gpiod
      • Grid
      • GridContainer
      • Image
      • ImageControl
      • ImageList
      • Label
      • Material Icons
      • Material Window
      • MessageBox
      • Multi Edit
      • Progress Bar
      • Progress Box
      • Radio
      • Radio Group
      • Scroll Container
      • Side Menu
      • Slider
      • Sliding Window
      • Spin List
      • Spinner
      • Switch
      • Tabbed Container
      • Velocimeter
    • APIs
      • API Overview
      • API Rest
      • Asynchronous Task
      • Camera
      • Control
        • Main Window
        • Window
        • Container
      • GPS
      • HTTPS and SSL
      • JSON
      • Maps
        • Maps - Deprecated
        • Static Map
      • Material Design Standards
      • Ninepath
      • Notifications
      • PrinterManager
      • Push Notification Firebase
      • Scanner
      • SOAP
      • Socket
      • SocketServer
      • SQLite Encryption
      • QR Code Generator
      • totalcross.sys
      • Youtube API
    • Creating an Issue
    • Contributing
      • Branch workflow
      • Writing documentation
    • Guides
      • App Architecture
        • Suggested Architecture
        • Why do Design Patterns help with the application's organization?
          • MVC Architecture Pattern
          • Template Pattern
          • Data Persistence: DAO Pattern.
        • Separation of concepts: What is the best way to create UI interfaces?
        • Positioning
          • Manual Positioning
        • Relative Positioning
        • Best practices to improve project maintenance
      • Device Simulator
      • Package your app from scratch
        • TotalCross SDK
        • Environment Variables in IDE
          • Eclipse
          • IntelliJ
        • Deploy your app with a dependecy TC
        • Deploy iOS
          • Using Development certificate to test your apps
      • Understanding TotalCross for Linux ARM
      • Running C++ applications with TotalCross
      • Web Services
    • Miscelaneous
      • Java JDK 8
      • Maven
      • Installing Visual Studio Code
    • FAQ
      • IMEI in Android 10
Powered by GitBook
On this page
  • Overview
  • Source Code
  • Methods
  • References

Was this helpful?

  1. Documentation
  2. Components

Spinner

PreviousSpin ListNextSwitch

Last updated 6 years ago

Was this helpful?

Overview

Spinner is a control that shows an image indicating that something is running in the background. It has two styles: iPhone and Android.

Source Code

SpinnerSample.java
  //Spinner inside the Bar
Bar bar = new Bar (“text text”);
add(bar, LEFT, TOP, FILL, PREFERRED);
bar.createSpinner(Color.WHITE);
bar.startSpinner;

  //Spinner inside the Loop
Spinner spinner = new Spinner(Spinner.IPHONE);
spinner.setForeColor(Color.WHITE);
add(spinner, CENTER, AFTER,, FONTSIZE + 200, FONTSIZE + 200);

while (Vm.getTimeStamp()  < (Vm.getTimeStamp() + 5000))
{
    spinner.update();
}

  //Spinner inside the ProgressBox
Spinner.spinnerType = Spinner.ANDROID;
ProgressBox pb = new ProgressBox("Alert!", “msg”, null);
pb.setBackColor(Color.getRGB(12, 98, 200));
pb.popupNonBlocking();

Methods

Type

Name

Description

Constructor

Spinner( )

Creates a simple Spinner

Constructor

Spinner(Image anim)

Creates a spinner from an animated GIF

Constructor

Spinner(int type)

Creates a spinner of the given type

boolean

isRunning( )

Returns if the spin is running

void

setImage(Image anim)

Changes the gif image of this Spinner

void

setType(int t)

Changes the Spinner to one of the predefined types

void

start( )

Starts the spinning thread

void

stop( )

Stops the spinning thread

void

update( )

Updates the spinner; call this when using the spinner inside a loop

References

See also our showing how to use Spinner.

See the for more information.

quick tutorial video
JavaDocs