Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4android > Basic4android Getting started & Tutorials
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Basic4android Getting started & Tutorials Android development starts here. Please do not post questions in this sub-forum.

ScrollView examples summary

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-27-2011, 07:15 AM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 4,461
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default ScrollView examples summary

There are many ScrollView examples on the forum, I made a summary of them for my own use and I think it would be interesting for others.

Creating a table view based on ScrollView





Gridline in TableView using Scrollview

based on Creating a table view based on ScrollView with separation lines.





Rearrange ListView lines post #3
Despite the title, it is a ScrollView





List with two columns and a checkbox





ScrollView example Image ScrollView





add imageview half manually Another image ScrollView





The same as above but with a Label below each image.





Another ScrollView example





Multiple table example post #4

Example with two tables, based on Gridline in TableView using Scrollview but with two ScrollViews.





Display Long text simple.

This is the simplest example to display long texts in a ScrollView.





Display Long texts.

The program displays different texts with different fonts and different font sizes.





Real newb question about how to display a block of scrollable text
Help display,

The texts are those from the FastFourierTransform Library Demo program.





Sql and ListView
Example with:
- a SQL data base
- multi selection
- different colors for header and columns
- different font sizes and alignments
- in the example the first column 'Code' is hidden





ScrollView, layouts and getting current selected
Each item is a Panel
With a label, an EditText and a Button on each itempanel






ScrollView example with multiselection and SQL

- adding a row
- moving a selected row up and down
- mono-selection, clicking on one row selects it, clicking on another row unselects the previous one and selects the new one.
- multi-selection, after one row is selected, a longclick on another row activates multi-selection, clicking on a third row selects it, clicking on a selected row unselects it. Unselecting down to one selected row reactivates mono-selection.
- deleting rows, mono and multi





ScrollView example with a Panel higher than the screen.

The layouts are designed in the Designer, not in the code.

There are 2 layout files:
- Main with the ScrollView.
- ScrollViewLayout has one Panel higher than the screen, 7 Label views and 7 EditText views, the Panel height is set so the last EditText view is on top of the screen when the panel's lower edge is on the lower edge of the screen.

Clicking on an EditText moves the Scrollview up to show this EditText view on top of the screen to avoid interference with the virtual keyboard.






TabHost & ScrollViews

Attached a demo program with a TabHost View with two tabs with ScrollViews.





SQLiteDB

SQLite database program using several ScrollViews.

What the program can do:
- Read a database, 'Load' button.
- Edit, modify or delete date sets (single- or multi-selection), 'Edit' button.
- Edit and modify a single cell, 'Long_Click' on a cell in a selected row.
- Filter the database, 'Filter' button, Click filter or unfilter, LongClick definition of filter criterias.
- Sort a column ascending or descending, clickink onto the column header.
- Create a new database, 'New' button.
- Scroll the table verticaly with the standard Scrollview, and horizontaly on the blue line between the ScrollView and the toolbox (or with a SeekBar, hidden by default.
- Change the table setup, alignment, column width, text size, colors, etc.

What the program connot do:
- Share multiple tables.






GPS Example program

Setup screen: ScrollView with a panel higher than the screen
GPS path data: ScrollView table with first column always visibel.




ExpandableListView

This code is an example of creating an expandable listview using a scrollview.
The layout of each item in the list is created in code and is customizable on a per item basis.
The example is pretty barebones but exhibits purpose.


__________________
Klaus
Switzerland

Beginner's Guide / User's Guide

Last edited by klaus : 05-03-2012 at 09:19 AM. Reason: Added a new example
Reply With Quote
  #2 (permalink)  
Old 03-27-2011, 08:42 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,689
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Thank you Klaus. Very useful!
The ScrollView in many cases is better suited for lists than ListView. The main advantage of ListView is that it can display very very long lists.
Reply With Quote
  #3 (permalink)  
Old 03-31-2011, 11:51 AM
philgoodgood's Avatar
Junior Member
 
Join Date: Mar 2011
Location: "land of cheese that stinks"
Posts: 14
Default

hello,

as to newb that I am, thank you klaus.
it is a pleasure to read to you.
__________________
GalaxyS Ginger 2.3.4 JVQ (stock odex) - CF-Root-XX_UNK_JVQ-v3.7-CWM3RFS - Vista 32b
Reply With Quote
  #4 (permalink)  
Old 04-01-2011, 12:12 AM
ZJP's Avatar
ZJP ZJP is offline
Senior Member
 
Join Date: Dec 2010
Posts: 136
Default

__________________
Bad English? French user.
Reply With Quote
  #5 (permalink)  
Old 04-01-2011, 09:09 AM
philgoodgood's Avatar
Junior Member
 
Join Date: Mar 2011
Location: "land of cheese that stinks"
Posts: 14
Default


hello,
I was unmasked

whose is to blame .... it's Google's fault lol
__________________
GalaxyS Ginger 2.3.4 JVQ (stock odex) - CF-Root-XX_UNK_JVQ-v3.7-CWM3RFS - Vista 32b
Reply With Quote
  #6 (permalink)  
Old 05-17-2011, 05:56 AM
Junior Member
 
Join Date: Apr 2011
Posts: 16
Default

Hi,

I am newbie. How to implement a click event on "Another ScrollView example" ( like listview )? Would you help me ? Thank you very much !

Palmzac

Last edited by palmzac : 05-17-2011 at 07:39 AM.
Reply With Quote
  #7 (permalink)  
Old 05-18-2011, 12:30 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 4,461
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

Have a look here.

Best regards.
__________________
Klaus
Switzerland

Beginner's Guide / User's Guide
Reply With Quote
  #8 (permalink)  
Old 05-19-2011, 02:03 AM
Junior Member
 
Join Date: Apr 2011
Posts: 16
Default

Hi Klaus,

Thanks for you help !


plamzac
Reply With Quote
  #9 (permalink)  
Old 05-22-2011, 05:58 AM
Basic4ppc Veteran
 
Join Date: May 2011
Posts: 412
Default

How do you clear a scrollview?
Reply With Quote
  #10 (permalink)  
Old 05-22-2011, 06:20 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,689
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

The following sub will remove all views from a ScrollView:
Code:
Sub ClearScrollView(sv As ScrollView)
    
For i = sv.Panel.NumberOfViews - 1 To 0 Step -1
        sv.Panel.GetView(i).RemoveView
    
Next
End Sub
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Different examples with 2 layouts klaus Basic4android Getting started & Tutorials 26 04-25-2012 07:31 PM
examples for code module anuj0sharma Basic4android Updates and Questions 1 03-21-2011 07:12 AM
Why can't I Download all the examples? Jonathon Questions (Windows Mobile) 4 06-24-2008 04:18 PM
Most old examples restored! GeoTrail Chit Chat 10 05-24-2007 12:00 PM
I need examples for imagelist imagebutton sloopa Questions (Windows Mobile) 2 05-19-2007 04:00 PM


All times are GMT. The time now is 10:36 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0