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

Was this helpful?

  1. Documentation
  2. Components

Dynamic Scroll

PreviousComboBoxNextEdit

Last updated 5 years ago

Was this helpful?

Overview

Scroll is a specialized type of Scroll Container intended for high performance where hundreds or thousands of views need to be displayed in a scrollable list.​

In Totalcross this component is called DynamicScrollContainer

Because it is a more complex example, which does not only involve the creation of the interface, we have a simpler and more direct example. To access the complete example, just go to our .

Source Code

DynScrollContainerSample.java
// Creating and positioning the DynamicScrollContainer
vsc = new DynamicScrollContainer();
vsc.setBackColor(Color.WHITE);
vsc.setBorderStyle(BORDER_SIMPLE);
add(vsc, LEFT + gap, AFTER + gap*2, FILL - gap, FILL - gap*2);
// Adding views to the DynamicScrollContainer
DynSCTestView view = new DynSCTestView(array[i], font);
view.height = Settings.screenHeight / 20;
datasource.addView(view);

Methods

Type

Name

Description

Constructor

DynamicScrollContainer( )

Creates a empty DynamicScrollContainer.

Constructor

DynamicScrollContainer(DynamicScrollContainer.DataSource datasource)

Creates a DynamicScrollContainer that sets the referred datasource

DynamicScrollContainer.AbstractView

getTopMostVisibleView( )

Return the top most visible view

Boolean

isViewVisible(DynamicScrollContainer.AbstractView view)

Return true if the view is visible

Boolean

scrollContent(int dx, int dy, boolean fromFlick)

Scroll the DynamicScrollContainer to the referred position. If the boolean is true, it does a flick animation

void

scrollToView(DynamicScrollContainer.AbstractView view)

Scroll the DynamicScrollContainer to the view

void

setDataSource(DynamicScrollContainer.DataSource datasource)

Set the DataSource

void

stopFlick()

Stops any flick animation

github