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

clsFloatingWindow

List of types:

ClsActionBar
ClsFloatingWindow
typAction
typAfterAnim

ClsActionBar


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

Events:

None

Members:


  AbortDragAndDrop As String

  AddButton (Icon As Object, Text As String, TextPosition As Byte, ButtonPosition As Short, OnClickSub As String, OnLongClickSub As String) As ConcreteViewWrapper

  AsPanel As PanelWrapper

  Class_Globals As String

  FillParent As String

  GetLeftCount As String

  getLeftPosition (Btn As ConcreteViewWrapper) As Int

  GetRightCount As String

  getRightPosition (Btn As ConcreteViewWrapper) As Int

  GetTotalCount As String

  Initialize (Parent As PanelWrapper, TopMost As Boolean, DarkTheme As Boolean, Height As Int, Module As Object) As String

  Invalidate As String

  IsInitialized As Boolean

  LoadDrawable (Name As String) As Object

  MoveButtonTo (Btn As ConcreteViewWrapper, NewPosition As Int) As String

  RemoveAllButtons As String

  RemoveButton (Btn As ConcreteViewWrapper) As String

  ReplaceDividerDrawable (Drawable As Object) As String

  ReplaceIcon (Btn As ConcreteViewWrapper, Icon As Object) As String

  ReplacePressedDrawable (Drawable As Object) As String

  SameWidthForAll (Enabled As Boolean) As String

  SetBackground (NewBackground As Object) As String

  SetDividerWidth (NewWidth As Byte) As String

  SetFixedWidth (Btn As ConcreteViewWrapper, NewWidth As Int) As String

  SetIconAsWideAsText (Enabled As Boolean) As String

  SetText (Btn As ConcreteViewWrapper, Text As String, TextColor As Int, TextSize As Int) As String

  StartDragAndDrop (Btn As ConcreteViewWrapper, ViewToBlock As Object, OnAfterDropSub As String) As String

  Title As LabelWrapper

Members description:

AbortDragAndDrop As String
Aborts the drag&drop operation
AddButton (Icon As Object, Text As String, TextPosition As Byte, ButtonPosition As Short, OnClickSub As String, OnLongClickSub As String) As ConcreteViewWrapper
Adds a button to the action bar (its width is automatically computed)
Icon = optional bitmap or drawable (if Null, Text must be set)
Text = optional text (if "", Icon must be set)
TextPosition:
1 = at the very top (icon is reduced)
2 = at the very bottom (icon is reduced)
3 = over the icon top
4 = over the icon bottom
5 = centered
6 = on the left
7 = on the right
ButtonPosition = position in the action bar, starting from the left if positive (1 = leftmost position) or from the right if negative (-1 = rightmost position)
OnClickSub = name of the sub to call in your module when the button is pressed
OnLongClickSub = name of the sub to call in your module after a long click
Returns the new button
AsPanel As PanelWrapper
Gets the action bar panel
Class_Globals As String
Version 1.4
FillParent As String
Changes the dimensions of the action bar to fill completely its parent.
GetLeftCount As String
Gets the number of buttons stacked to the left
getLeftPosition (Btn As ConcreteViewWrapper) As Int
Returns the button position in the left stack
0 = not found
GetRightCount As String
Gets the number of buttons stacked to the right
getRightPosition (Btn As ConcreteViewWrapper) As Int
Returns the button position in the right stack
0 = not found
GetTotalCount As String
Gets the total number of buttons
Initialize (Parent As PanelWrapper, TopMost As Boolean, DarkTheme As Boolean, Height As Int, Module As Object) As String
Initializes the action bar
Parent = activity or panel holding the action bar
TopMost = if True, the action bar is placed at the very top of its parent; if False, it is placed at the very bottom
DarkTheme = if True, the action bar has a dark background and bright texts; if False, it has a bright background and dark texts
Module = Me
Invalidate As String
Redraws the action bar
You must call this function if you change the action bar width (all buttons will be resized accordingly).
IsInitialized As Boolean
Tests whether the object has been initialized.
LoadDrawable (Name As String) As Object
Gets a drawable from the Android system resources
MoveButtonTo (Btn As ConcreteViewWrapper, NewPosition As Int) As String
Moves a button to another position
NewPosition = position in the action bar, starting from the left if positive (1 = leftmost position) or from the right if negative (-1 = rightmost position)
RemoveAllButtons As String
Removes all buttons
RemoveButton (Btn As ConcreteViewWrapper) As String
Removes a button from the action bar
ReplaceDividerDrawable (Drawable As Object) As String
Replaces the drawable for dividers
Drawable = a valid bitmap or drawable
ReplaceIcon (Btn As ConcreteViewWrapper, Icon As Object) As String
Replaces icon of the given button
Icon = bitmap or drawable
You can set Icon to Null to remove the icon.
ReplacePressedDrawable (Drawable As Object) As String
Replaces the drawable for the pressed state
Drawable = a valid bitmap or drawable
SameWidthForAll (Enabled As Boolean) As String
Sets the same width for all buttons
New width = width of action bar / number of buttons (minimum = 10dip)
SetBackground (NewBackground As Object) As String
Sets the background of the action bar
NewBackground = a valid drawable
SetDividerWidth (NewWidth As Byte) As String
Sets the divider width
SetFixedWidth (Btn As ConcreteViewWrapper, NewWidth As Int) As String
Sets the button width and centers its content
This new width is temporary. It will be reset if you call Invalidate or a function modifying the button content.
This function is ignored if SameWidthForAll has been enabled.
SetIconAsWideAsText (Enabled As Boolean) As String
Enlarges the icon to fit the text width
This function is ignored by buttons with no text and buttons with a text on the left/right side.
SetText (Btn As ConcreteViewWrapper, Text As String, TextColor As Int, TextSize As Int) As String
Sets text of the given button
You can set TextColor and TextSize to -1 to left them unchanged
StartDragAndDrop (Btn As ConcreteViewWrapper, ViewToBlock As Object, OnAfterDropSub As String) As String
Starts a drag&drop operation
Btn = the button to move
ViewToBlock = if your button is in a scrollable container (ScrollView, AHViewPager, etc.), set ViewToBlock to this container to prevents it from intercepting the Touch events
OnAfterDropSub = name of the sub handling the AfterDrop event
This function should be called after a long click event.
Title As LabelWrapper

ClsFloatingWindow


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

Events:

None

Members:


  AddCustomButton (Icon As Object, Position As Int, OnClickSub As String, OnLongClickSub As String) As ConcreteViewWrapper

  AddDockingArea (DockRect As RectWrapper) As String

  AddStickyEdge (Edge As Int, Size As Int) As String

  AddView (MyView As ConcreteViewWrapper, Left As Int, Top As Int, Width As Int, Height As Int, DelegateTouchEvent As Boolean) As String

  AsPanel As PanelWrapper

  BringOnTop As String

  ChangeCloseIcon (NewIcon As Object) As String

  ChangeMaximizeIcon (NewIcon As Object) As String

  ChangePinIcon (NewIcon As Object) As String

  ChangeResizeIcon (NewIcon As Object) As String

  Class_Globals As String

  Close As String

  DockingAreaColor As Int

  EnableCloseButton (Enabled As Boolean, HideOnly As Boolean, OnCloseSub As String) As String

  EnableMaximizeButton (Enabled As Boolean, OnMaximizeSub As String) As String

  EnablePinButton (Enabled As Boolean, OnPinSub As String) As String

  EnableResizeButton (Enabled As Boolean) As String

  EnableTitleBar (Enabled As Boolean) As String

  GetContent As PanelWrapper

  getContentHeight As String

  getHeight As String

  getLeft As String

  getTag As Object

  GetTitleText As String

  getTop As String

  getWidth As String

  Hide As String

  Initialize (Parent As PanelWrapper, Left As Int, Top As Int, Width As Int, Height As Int, Module As Object) As String

  IsDocked As Boolean

  IsInitialized As Boolean

  IsMaximized As Boolean

  IsPinned As Boolean

  Maximize (MaxSize As Boolean) As String

  MaximumHeightAfterResize As Int

  MaximumWidthAfterResize As Int

  MinimumCoveredSurfaceForDocking As Int

  MinimumHeightAfterResize As Int

  MinimumWidthAfterResize As Int

  Move (NewLeft As Int, NewTop As Int, IgnoreSpecialAreas As Boolean) As String

  PinnedWindowMsg As String

  RemoveDockingAreas As String

  RemoveStickyEdges As String

  Resize (NewWidth As Int, NewHeight As Int) As String

  SelectedArea As Int

  SetBackground (Background As Object) As String

  SetBorder (Color As Int, Width As Int) As String

  SetOnDockListener (SubName As String) As String

  SetOnEnterDockAreaListener (SubName As String) As String

  SetOnMoveListener (SubName As String) As String

  SetOnResizeListener (SubName As String) As String

  SetOnStickListener (SubName As String) As String

  SetOnUndockListener (SubName As String) As String

  SetSelectedArea (Area As Int) As String

  SetTag (NewValue As Object) As String

  SetTitleBackground (Background As Object) As String

  SetTitleText (Text As String) As String

  SetTitleTextColor (Color As Int) As String

  SetTitleTextSize (Size As Int) As String

  Show As String

  StickyAreaColor As Int

  StillVisible As Int

  TouchSlop As Int

Members description:

AddCustomButton (Icon As Object, Position As Int, OnClickSub As String, OnLongClickSub As String) As ConcreteViewWrapper
Adds a custom button in the title bar
Icon = a valid bitmap or drawable
Position = position in the title bar, starting from the right (1 = rightmost position)
OnClickSub = name of the sub to call in your module when the button is pressed
OnLongClickSub = name of the sub to call in your module after a long click
Returns a pointer on the new button
AddDockingArea (DockRect As RectWrapper) As String
Adds a docking area
If a window enters a docking area, the area becomes visible.
If the window is still in the area when the move ends, it is moved and resized to fit the area.
AddStickyEdge (Edge As Int, Size As Int) As String
Creates a sticky area near an edge.
If the window enters the sticky area, the area becomes visible.
If the window is still in the area when the move ends, it is sticked against the edge.
Edge:
0 = Left
1 = Top
2 = Right
3 = Bottom
AddView (MyView As ConcreteViewWrapper, Left As Int, Top As Int, Width As Int, Height As Int, DelegateTouchEvent As Boolean) As String
Adds a view to the window
DelegateTouchEvent: if True, the Touch event is handled by the class and allows to move the window.
Some views like ListView or ScrollView need DelegateTouchEvent=False if their content is not fully displayed (that allows to scroll their content but prevents from moving the window by moving the view).
AsPanel As PanelWrapper
Gets the window panel
BringOnTop As String
Brings the window to the front
ChangeCloseIcon (NewIcon As Object) As String
Changes the close button icon
Icon = a valid bitmap or drawable
ChangeMaximizeIcon (NewIcon As Object) As String
Changes the maximize button icon
Icon = a valid bitmap or drawable
ChangePinIcon (NewIcon As Object) As String
Changes the pin button icon
Icon = a valid bitmap or drawable
ChangeResizeIcon (NewIcon As Object) As String
Changes the resize button icon
Icon = a valid bitmap or drawable
Class_Globals As String
Class module
Version: 1.23
Close As String
Clears the content and closes the window
DockingAreaColor As Int
EnableCloseButton (Enabled As Boolean, HideOnly As Boolean, OnCloseSub As String) As String
Shows/Hides the close button in the title bar
HideOnly = if True, closing the window just hides it
OnCloseSub = name of the sub to call in your module before the window is closed
EnableMaximizeButton (Enabled As Boolean, OnMaximizeSub As String) As String
Shows/Hides the maximize/restore button in the title bar
OnMaximizeSub = name of the sub to call in your module after the window is maximized/restored
EnablePinButton (Enabled As Boolean, OnPinSub As String) As String
Shows/Hides the pin button in the title bar
OnPinSub = name of the sub to call in your module after the window is pinned
EnableResizeButton (Enabled As Boolean) As String
Shows/Hides the resize button in the bottom right corner
EnableTitleBar (Enabled As Boolean) As String
Shows/Hides the title bar
GetContent As PanelWrapper
Gets the content panel @@@@ Eduardo
getContentHeight As String
Gets the content panel height
ContentHeight = WindowHeight - ActionBarHeight
getHeight As String
Gets the window height
If you want only the height of the content panel, call getContentHeight
getLeft As String
Gets the window left value
getTag As Object
Gets the tag value
GetTitleText As String
gets the window title text
getTop As String
Gets the window top value
getWidth As String
Gets the window width
Hide As String
Hides a window
Initialize (Parent As PanelWrapper, Left As Int, Top As Int, Width As Int, Height As Int, Module As Object) As String
Initializes the floating window
Parent = activity or panel holding the window
Module = Me
IsDocked As Boolean
Is the window docked ?
IsInitialized As Boolean
Tests whether the object has been initialized.
IsMaximized As Boolean
Is the window maximized ?
IsPinned As Boolean
Is the window pinned ?
Maximize (MaxSize As Boolean) As String
Enlarges the window to fill its parent (MaxSize=True) or returns to its previous position and size (MaxSize=False)
MaximumHeightAfterResize As Int
MaximumWidthAfterResize As Int
MinimumCoveredSurfaceForDocking As Int
MinimumHeightAfterResize As Int
MinimumWidthAfterResize As Int
Move (NewLeft As Int, NewTop As Int, IgnoreSpecialAreas As Boolean) As String
Moves the window
If a position is set to -1, it is left unchanged.
IgnoreSpecialAreas = if True, docking areas and sticky edges are ignored.
PinnedWindowMsg As String
RemoveDockingAreas As String
Removes all docking areas
RemoveStickyEdges As String
Removes all sticky areas
Resize (NewWidth As Int, NewHeight As Int) As String
Resizes the window
If a dimension is set to -1, it is left unchanged.
SelectedArea As Int
SetBackground (Background As Object) As String
Changes the main content background
Background = a valid drawable
SetBorder (Color As Int, Width As Int) As String
Draws a colored frame around the window
SetOnDockListener (SubName As String) As String
Adds a listener for the events OnDock (fired after docking)
Your listener must be declared like this: myListener(Window As ClsFloatingWindow, DockRect As Rect)
SetOnEnterDockAreaListener (SubName As String) As String
Adds a listener for the events OnEnterDockArea (fired when entering a docking area)
Your listener must be declared like this: myListener(Window As ClsFloatingWindow, DockRect As Rect)
SetOnMoveListener (SubName As String) As String
Adds a listener for events onMove (fired after a move)
Your listener must be declared like this: myListener(Window As ClsFloatingWindow)
SetOnResizeListener (SubName As String) As String
Adds a listener for events onResize (fired after a resize)
Your listener must be declared like this: myListener(Window As ClsFloatingWindow)
SetOnStickListener (SubName As String) As String
Adds a listener for events OnStick (fired after sticking to an edge)
Your listener must be declared like this: myListener(Window As ClsFloatingWindow, Edge As Int)
Edge:
0 = Left
1 = Top
2 = Right
3 = Bottom
SetOnUndockListener (SubName As String) As String
Adds a listener for the events OnUndock (fired after leaving a docking area)
Your listener must be declared like this: myListener(Window As ClsFloatingWindow)
SetSelectedArea (Area As Int) As String
SetTag (NewValue As Object) As String
Sets the tag value
SetTitleBackground (Background As Object) As String
Changes the title background
Background = a valid drawable
SetTitleText (Text As String) As String
Changes the window title text
SetTitleTextColor (Color As Int) As String
Changes the title text color
SetTitleTextSize (Size As Int) As String
Changes the title text size
Show As String
Shows a hidden window
StickyAreaColor As Int
StillVisible As Int
TouchSlop As Int

typAction


Events:

None

Members:


  Initialize

  IsInitialized As Boolean

  Module As Object

  OnClickSub As String

  OnLongClickSub As String

  Tag As Object

Members description:

Initialize
Initializes the fields to their default value.
IsInitialized As Boolean
Tests whether the object has been initialized.
Module As Object
OnClickSub As String
OnLongClickSub As String
Tag As Object

typAfterAnim


Events:

None

Members:


  DARect As RectWrapper

  Initialize

  IsDocking As Boolean

  IsInitialized As Boolean

  SEdge As Int

  SubName As String

  WinLeft As Int

  WinTop As Int

Members description:

DARect As RectWrapper
Initialize
Initializes the fields to their default value.
IsDocking As Boolean
IsInitialized As Boolean
Tests whether the object has been initialized.
SEdge As Int
SubName As String
WinLeft As Int
WinTop As Int

Top