B4A Library [B4X] AS FloatingPanel

This is a simple panel that can be attached anywhere and opens with an animation.
More usecases and updates to come ;)

I spend a lot of time in creating views, like this and to create a high quality view cost a lot of time. If you want to support me and further views, then you can do it here by Paypal or with a coffee. :)

ezgif.com-gif-maker (7).gif
ezgif.com-gif-maker (6).gif

Examples:
B4X:
Dim fp As AS_FloatingPanel
fp.Initialize(Me,"fp",Root)
fp.PreSize(200dip,200dip)
fp.Panel.LoadLayout("frm_Content")

'Open the panel
fp.Show(0,0,200dip,200dip)
'or attached on a view
Dim Top As Float = xlbl_ClickMe.Top + xlbl_ClickMe.Height + 10dip
fp.Show(xlbl_ClickMe.Left,Top,200dip,200dip)
ASFloatingPanel
Author: Alexander Stolte
Version: 1.01

  • ASFloatingPanel_ArrowProperties
    • Fields:
      • ArrowOrientation As String
      • Color As Int
      • Height As Float
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • Left As Float
      • Top As Float
      • Width As Float
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • AS_FloatingPanel
    • Events:
      • Close
    • Fields:
      • BackgroundColor As Int
    • Functions:
      • Class_Globals As String
      • Close
      • CreateASFloatingPanel_ArrowProperties (ArrowOrientation As String, Color As Int, Width As Float, Height As Float, Left As Float, Top As Float) As ASFloatingPanel_ArrowProperties
      • getArrowOrientation_Bottom As String
        The Arrow is on the bottom of the panel
      • getArrowOrientation_Left As String
        The Arrow is on the lft of the panel
      • getArrowOrientation_Right As String
        The Arrow is on the right of the panel
      • getArrowOrientation_Top As String
        The Arrow is on the top of the panel
      • getArrowProperties As ASFloatingPanel_ArrowProperties
      • getArrowVisible As Boolean
      • getOpenOrientation_BottomTop As String
        Opens the panel from bottom to top
      • getOpenOrientation_LeftBottom As String
        Opens the panel from left to bottom
      • getOpenOrientation_LeftRight As String
        Opens the panel from left to right
      • getOpenOrientation_LeftTop As String
        Opens the panel from left to top
      • getOpenOrientation_None As String
        Opens the panel without slide, but with fade
      • getOpenOrientation_RightBottom As String
        Opens the panel from right to bottom
      • getOpenOrientation_RightLeft As String
        Opens the panel from right to left
      • getOpenOrientation_RightTop As String
        Opens the panel from right to top
      • getOpenOrientation_TopBottom As String
        Opens the panel from top to bottom
      • getPanel As B4XView
      • Initialize (Callback As Object, EventName As String, Parent As B4XView) As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • PreSize (Width As Float, Height As Float) As String
      • setArrowProperties (Properties As ASFloatingPanel_ArrowProperties) As String
      • setArrowVisible (Visible As Boolean) As String
      • setDuration (Duration As Long) As String
        Default: 150
      • setOpenOrientation (Orientation As String) As String
      • Show (Left As Float, Top As Float, Width As Float, Height As Float)
    • Properties:
      • ArrowOrientation_Bottom As String [read only]
        The Arrow is on the bottom of the panel
      • ArrowOrientation_Left As String [read only]
        The Arrow is on the lft of the panel
      • ArrowOrientation_Right As String [read only]
        The Arrow is on the right of the panel
      • ArrowOrientation_Top As String [read only]
        The Arrow is on the top of the panel
      • ArrowProperties As ASFloatingPanel_ArrowProperties
      • ArrowVisible As Boolean
      • Duration
        Default: 150
      • OpenOrientation
      • OpenOrientation_BottomTop As String [read only]
        Opens the panel from bottom to top
      • OpenOrientation_LeftBottom As String [read only]
        Opens the panel from left to bottom
      • OpenOrientation_LeftRight As String [read only]
        Opens the panel from left to right
      • OpenOrientation_LeftTop As String [read only]
        Opens the panel from left to top
      • OpenOrientation_None As String [read only]
        Opens the panel without slide, but with fade
      • OpenOrientation_RightBottom As String [read only]
        Opens the panel from right to bottom
      • OpenOrientation_RightLeft As String [read only]
        Opens the panel from right to left
      • OpenOrientation_RightTop As String [read only]
        Opens the panel from right to top
      • OpenOrientation_TopBottom As String [read only]
        Opens the panel from top to bottom
      • Panel As B4XView [read only]
Changelog
  • 1.00
    • Release
  • 1.01 (read more)
    • Add New OpenOrientations
      • OpenOrientation_None
        • Opens the panel without slide, but with fade
      • OpenOrientation_LeftTop
        • Opens the panel from left to top
      • OpenOrientation_RightTop
        • Opens the panel from right to top
      • OpenOrientation_LeftRight
        • Opens the panel from left to right
      • OpenOrientation_RightLeft
        • Opens the panel from right to left
      • OpenOrientation_TopBottom
        • Opens the panel from top to bottom
      • OpenOrientation_BottomTop
        • Opens the panel from bottom to top
    • Add Arrow
    • Add Type ASFloatingPanel_ArrowProperties
  • 1.02
    • BugFixes
  • 1.03
    • BugFixes
    • Add get and set CloseOnTap
      • Default: True
  • 1.04
    • BugFix
Have Fun :)
 

Attachments

  • AS FloatingPanel Example.zip
    13.4 KB · Views: 416
  • AS_FloatingPanel.b4xlib
    2.4 KB · Views: 75
Last edited:

Sandman

Expert
Licensed User
Longtime User
Oh right. Yeah, I'm not sure what the best solution is then. (I'll live, I use it without the arrow, just reported something i noticed.)
 
Top