Android Programming Press on the image to return to the main documentation page.

AHViewPager

Written by Markus Stipp

This library provides objects to implement a ViewPager.

List of types:

AHPageContainer
AHViewPager
AHViewPagerTabs

AHPageContainer

AHPagerLayout holds the layout of the pages
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

None

Members:


  AddPage (View As android.view.View, Title As String)

  AddPageAt (View As android.view.View, Title As String, Position As Int)

  Count As Int  [read only]

  DeletePage (Position As Int)

  GetPageObject (Position As IntAs Object

  GetTitle (Position As IntAs String

  Initialize

  Initialize2 (Pages As List, Titles As List)

  IsInitialized As Boolean  [read only]

  Pages As List  [read only]

  SetContent (Pages As List, Titles As List)

  SetTitle (Title As String, Position As Int)

  Titles As List  [read only]

Members description:

AddPage (View As android.view.View, Title As String)
Add a new page to the pager layout. Normally you will provide a Panel here.
View - The view to be added as a new page
Title - The title of the new page
AddPageAt (View As android.view.View, Title As String, Position As Int)
Add a new page to the pager layout at the specified position. Normally you will provide a Panel here.
View - The view to be added as a new page
Title - The title of the new page
Position - Position where the new page will be added
Count As Int  [read only]
Gets the number of pages in the layout.
DeletePage (Position As Int)
Deletes the specified page.
Position - Page to be deleted
GetPageObject (Position As IntAs Object
Returns the View added as a page. Normally this is a Panel object.
Position - Index of the object
GetTitle (Position As IntAs String
Gets the title of the page.

Position - Position of the title to get.
Initialize
Initializes the object
Initialize2 (Pages As List, Titles As List)
IsInitialized As Boolean  [read only]
Pages As List  [read only]
The List or Array of the pages.
SetContent (Pages As List, Titles As List)
Sets the pages and titles for the container

Pages - A List or Array of Panel objects
Titles - A List or Array of page titles
SetTitle (Title As String, Position As Int)
Sets the title of the page.

Title - The new title text.
Position - Position of the title to change.
Titles As List  [read only]
The List or Array of the titles.

AHViewPager


This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

PageChanged (Position As Int)
PageCreated (Position As Int, Page as Object)
PageDestroyed (Position As Int, Page as Object)

Members:


  Background As android.graphics.drawable.Drawable

  BringToFront

  Color As Int  [write only]

  CurrentPage As Int

  Enabled As Boolean

  GotoPage (Page As Int, Smooth As Boolean)

  Height As Int

  Initialize (Layout As AHPageContainer, EventName As String)

  Invalidate

  Invalidate2 (arg0 As android.graphics.Rect)

  Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)

  IsInitialized As Boolean

  Left As Int

  RemoveView

  RequestFocus As Boolean

  SendToBack

  SetBackgroundImage (arg0 As android.graphics.Bitmap)

  SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)

  Tag As Object

  Top As Int

  Visible As Boolean

  Width As Int

Members description:

Background As android.graphics.drawable.Drawable
BringToFront
Color As Int  [write only]
CurrentPage As Int
Get or Set the current page
Enabled As Boolean
GotoPage (Page As Int, Smooth As Boolean)
Jump or Scroll to the new page
Page - The new page to display
Smooth - True to smoothly scroll to the new item, false to transition immediately
Height As Int
Initialize (Layout As AHPageContainer, EventName As String)
Initializes the object.

Layout - A fully initialized AHPagerLayout object with the content of the pages
EventName - Sets the sub that will handle the event.
Invalidate
Invalidate2 (arg0 As android.graphics.Rect)
Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
IsInitialized As Boolean
Left As Int
RemoveView
RequestFocus As Boolean
SendToBack
SetBackgroundImage (arg0 As android.graphics.Bitmap)
SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
Tag As Object
Top As Int
Visible As Boolean
Width As Int

AHViewPagerTabs


This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

None

Members:


  Background As android.graphics.drawable.Drawable

  BackgroundColorPressed As Int

  BringToFront

  Color As Int  [write only]

  Enabled As Boolean

  Height As Int

  Initialize (Pager As AHViewPager)

  Invalidate

  Invalidate2 (arg0 As android.graphics.Rect)

  Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)

  IsInitialized As Boolean

  Left As Int

  LineColorCenter As Int

  LineHeight As Int

  NotifyDataChange

  OutsideOffset As Int

  Position As Int  [read only]

  RefreshTitles

  RemoveView

  RequestFocus As Boolean

  SendToBack

  SetBackgroundImage (arg0 As android.graphics.Bitmap)

  SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)

  SetTabPadding (Left As Int, Top As Int, Right As Int, Bottom As Int)

  TabPaddingBottom As Int

  TabPaddingLeft As Int

  TabPaddingRight As Int

  TabPaddingTop As Int

  Tag As Object

  TextColor As Int

  TextColorCenter As Int

  TextSize As Float

  Top As Int

  UpperCaseTitle As Boolean  [write only]

  Visible As Boolean

  Width As Int

Members description:

Background As android.graphics.drawable.Drawable
BackgroundColorPressed As Int
BringToFront
Color As Int  [write only]
Enabled As Boolean
Height As Int
Initialize (Pager As AHViewPager)
Initializes the object.

Pager - A fully initialized AHViewPager object.
Invalidate
Invalidate2 (arg0 As android.graphics.Rect)
Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
IsInitialized As Boolean
Left As Int
LineColorCenter As Int
LineHeight As Int
NotifyDataChange
Rebuilds the complete tabs data structure. You MUST call this after you add or remove a page from the AHViewPager.
OutsideOffset As Int
Position As Int  [read only]
Gets the current position in the tabs.
RefreshTitles
Refresh the titles of the tabs. Use this after changing a title in AHPageContainer.
RemoveView
RequestFocus As Boolean
SendToBack
SetBackgroundImage (arg0 As android.graphics.Bitmap)
SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
SetTabPadding (Left As Int, Top As Int, Right As Int, Bottom As Int)
TabPaddingBottom As Int
TabPaddingLeft As Int
TabPaddingRight As Int
TabPaddingTop As Int
Tag As Object
TextColor As Int
TextColorCenter As Int
TextSize As Float
Top As Int
UpperCaseTitle As Boolean  [write only]
Visible As Boolean
Width As Int

Top