B4A Library [Class] Floating Windows

Discussion in 'Additional libraries, classes and official updates' started by Informatix, Aug 19, 2012.

  1. Informatix

    Informatix Expert Licensed User

    Hello,

    With this class, you can create floating windows, move them with the finger, dock them, stick them to an edge, maximize them, customize their action bar... You fill them as you fill a panel.

    This class needs the Reflection library.

    img1.jpg puzzle.png

    v1.1:
    The class has been splitted in two: ClsFloatingWindow and ClsActionBar.
    This version includes a lot of changes.

    v1.2:
    Fixed bugs
    Added a resize button
    Added new functions and parameters
    Added animations for docking areas and sticky edges
    Changed the parameters returned by the custom buttons so as to be consistent with the ready-made buttons
    Improved management of overlapping special areas
    Improved the formula used to detect a move

    v1.21:
    Fixed a conflict between StillVisible and the special areas

    v1.22:
    Fixed two bugs in CheckSpecialAreas (thanks to Awama)

    v1.23:
    Fixed five bugs (yes, five... :()

    v1.24:
    Updated the ActionBar class required by this class.

    v1.25:
    Fixed a bug in the computation of covered areas while docking a window;
    Updated the ActionBar class required by this class;
    No more warnings with B4A v2.7.

    v1.26:
    Updated the ActionBar class required by this class.

    Fred
     

    Attached Files:

    Last edited: Jun 30, 2014
  2. Erel

    Erel Administrator Staff Member Licensed User

    Looks great!

    :sign0098:
     
  3. Djembefola

    Djembefola Active Member Licensed User

  4. dealsmonkey

    dealsmonkey Active Member Licensed User

    Very nice thank you for sharing.
     
  5. Jost aus Soest

    Jost aus Soest Active Member Licensed User

    Respect! :icon_clap:
     
  6. awama

    awama Active Member Licensed User

    Very well done, and I can really use just. Thanks for sharing
     
  7. moster67

    moster67 Expert Licensed User

    Incredible and Amazing :icon_clap:

    Work of a genius. Respect!

    Thanks for sharing.
     
  8. Informatix

    Informatix Expert Licensed User

    Ok, let's talk about price.

    ... I'm joking. :)

    I try to use my own creation in a real app and it appears some features are missing (events for docking/sticking, pinning button). I think the action bar could be nicer and events declaration should be different. So there will be a new version before the end of the coming week. If you have ideas, let me know.

    As you can see in demo #1, I use a ListView in one of the windows. In fact, I don't recommend to use any scrollable container in a floating window. You should avoid ListViews, ScrollViews, ViewPagers... It's difficult to handle them properly and their behavior could be unexpected under certain circumstances (I could show you a few issues with the ListView in demo #1). If you want to display a short list, you can use labels and radio buttons instead of a Listview. If you absolutely need a ListView and want to scroll its content, add the view with DelegateTouchEvent = false. The window won't intercept the Touch events, so the ListView will be perfectly handled. Drawback: you won't be able to move the window while your finger is on the ListView.
     
  9. Mahares

    Mahares Well Known Member Licensed User

    C'est magnifique Fred! Let me add that you need B4a vesion 2.02 to run the demos. Otherwise, you will get an error.
     
  10. Informatix

    Informatix Expert Licensed User

    You're right. That needs the latest Reflection library too.
     
  11. bparent

    bparent Member Licensed User

    V2.02

    Erel or others , where do we get V2.02? Was there an updrade download email sent? Under Help->About my verion shows 2.00.

    Thanks.
     
  12. margret

    margret Well-Known Member Licensed User

    Very, very Nice !!!:icon_clap:

    G R E A T
     
  13. barx

    barx Well-Known Member Licensed User

    I believe you use the same link and password details as v2.00
     
  14. bparent

    bparent Member Licensed User

    V2.02

    Thanks, found this message from Erel: No emails were sent for v2.02. You should use the same link as you used for v2.00.
     
  15. Mahares

    Mahares Well Known Member Licensed User

    Code:
    W(3).EnableMinMaxButton(True"ResizeWin")
    The MinMaxButton is actually a MaxRestore button from what I gathered. Is it prudent to have an actual MINIMIZE button or is it a matter of resizing the window?
     
  16. Informatix

    Informatix Expert Licensed User

    Effectivement. I should rename MinMaxButton to MaximizeButton.
    Instead of creating a lot of buttons (I have personally no need for a MinimizeButton and I hardly see what it should do), I'm going to add a function allowing to add your own buttons. And to avoid an action bar looking like a Christmas tree, I'm going to standardize it.
     
  17. Djembefola

    Djembefola Active Member Licensed User

    Informatix, it's a pleasure to read (and learn from) your code!

    What i would like to have in the next version:

    A Show and a Hide Method (as a workaround for a .visible Property)
     
  18. Informatix

    Informatix Expert Licensed User

    Ok.
     
  19. Mahares

    Mahares Well Known Member Licensed User

    @Fred: In the current version, once you close a WINDOW you cannot get it back unless you restart the app. I did not see a method that allows you to get it back?
    Thank you for your creativity.
     
  20. Informatix

    Informatix Expert Licensed User

    Closing a window means destroying it. If you want to re-open it, you have to recreate it. I suppose you want something like a show/hide method. That will be added.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice