B4A Library [B4X] [XUI] SwiftButton

Discussion in 'Additional libraries, classes and official updates' started by Erel, Jul 17, 2018.

  1. Erel

    Erel Administrator Staff Member Licensed User

    This is a port of the B4i SwiftButton library: https://www.b4x.com/android/forum/threads/iswiftybutton.75551/
    It is based on XUI and it is supported by B4A, B4J and B4i.

    test.gif

    Depends on a recent version of XUI library (B4A - XUI, B4J - jXUI, B4i - iXUI).

    The class is available inside the attached B4J example.
     

    Attached Files:

    jmon, Multiverse app, eps and 20 others like this.
  2. Gabriel Loria Salmeron

    Gabriel Loria Salmeron Member Licensed User

    Thank you Erel. It looks great!
     
  3. MarcoRome

    MarcoRome Expert Licensed User

  4. jahswani

    jahswani Active Member Licensed User

    It look 10k times more simpler than the platform specific library. XUI hummmmmm nice.
     
  5. incendio

    incendio Well-Known Member Licensed User

    What's the minimum B4J version to run this sample?

    Tried it in B4J 6.01, got an error :

    Unknown member drawpath.
     
  6. DonManfred

    DonManfred Expert Licensed User

    incendio and JakeBullet70 like this.
  7. rraswisak

    rraswisak Member Licensed User

    Thank you for this, apparently the Enabled property seem doesn't work.
    When Enabled property set to false the button should have grayed color and can not be clicked
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    This is a custom drawn button. Nothing will happen unless it is implemented. The code is quite simple. It shouldn't be difficult to add a "disabled" state.
     
  9. rraswisak

    rraswisak Member Licensed User

    Yes you are right, this is what i have done:

    1. Add this at p_Touch sub right before Select Action code
    Code:
    If mBase.Enabled=False Then Return
    2. Add this at Draw sub right before If pressed = False Then code
    Code:
    If mBase.Enabled=False Then
       clr1 = 
    Colors.Gray
       clr2 = 
    Colors.DarkGray
       pressed=
    False
    End If
     
    Erel likes this.
  10. JdV

    JdV Active Member Licensed User

    Hi

    Is it possible to include states for focused and unfocused buttons with this library? (B4XView doesn't seem to have a FocusChanged event or something like a 'HasFocus' member.)

    This would be perfect for creating obvious navigation on things like Android TV.

    Regards

    Joe
     
  11. Erel

    Erel Administrator Staff Member Licensed User

    B4XView doesn't have any events of its own. You need to handle the native view events. In this case the view is a Panel or Pane. You will need to do some work to make it focusable.
     
  12. JdV

    JdV Active Member Licensed User

    Thanks for the quick reply.
     
  13. Alberto Michelis

    Alberto Michelis Active Member Licensed User

    How can I use it in B4A? can it be used in TabStrip?
    Any way of use better lookin buttons or images to click on and go to an activity with B4A and designer?
    Thanks
     
  14. Erel

    Erel Administrator Staff Member Licensed User

    Add the module to your project and add the button as a custom view with the designer.

    Yes.

    Not sure that I understand this question. The code is available. You can modify it as you like.
     
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