B4A Library [B4X] [XUI] SD AwesoneWheel

Discussion in 'Additional libraries, classes and official updates' started by Star-Dust, Jul 28, 2018.

  1. Star-Dust

    Star-Dust Expert Licensed User

    SD_XUI_AwesoneWheel

    Author: Star-Dust
    Version: 0.05
    • AwesoneWheel
      • Events:
        • StopWheel (Index As Int, Value As String)
      • Fields:
        • Degree As Int
        • TextSize As Int
        • TimeLapseTick As Int
          Time frame that the wheel takes to cross each box - Defaults is 60 (milliseconds)
        • RadiusCentralBall As Int
          Default is 40dip (for B4J 40)
      • Functions:
        • AddItem (Voice As String, Color As Int) As String
          Add a single voice on Wheel
        • Class_Globals As String
        • Clear As String
          Clear all item
        • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
          Base type must be Object
        • Initialize (Callback As Object, EventName As String) As String
        • IsInitialized As Boolean
          Verifica se l'oggetto sia stato inizializzato.
        • PlayWheel (NewPosition As Int)
          Start the wheel and position in a NewPosition - with animation
        • setIndex (Position As Int) As String
        • setText (Text As String) As String
          Set a Text on Play of Wheel - Default = "PLAY"
      • Properties:
        • Index As Int
          Get or Set a positionì of Wheel - wit-out animation
        • Text As String
          Get or Set a Text on Play of Wheel - Default = "PLAY"

    Video1.gif
     

    Attached Files:

    Last edited: Aug 1, 2018
  2. Star-Dust

    Star-Dust Expert Licensed User

    Update to rel. 0.02 - fix bug
     
    Last edited: Jul 29, 2018
  3. Da He

    Da He Member Licensed User

    Thank
     
  4. asales

    asales Well-Known Member Licensed User

    Awesome, indeed.
    Can I change the "Play" text?
     
  5. Star-Dust

    Star-Dust Expert Licensed User

    Update Library (and Sample) to version 0.03

    1. Text Field - Added the possibility to change the text Play to the wheel
    2. PlayWheel - This method that changes the position to the wheel with Animation
     
    asales likes this.
  6. Mahares

    Mahares Well Known Member Licensed User

    @Star-Dust: You are really becoming a powerhouse in this forum. You are following in the footsteps of the genius @Informatix who delivers pure B4X libraries without any wrapping or java:
    1. When you use a smaller text size, the center piece covers part of it unless you prefix it with blank spaces. See snapshot.
    2. When you use say 'EXECUTE' instead of 'Play' the center circle is not large enough, hence the word is wrapped around.
    3. AwesoneWheel1.PlayWheel(4) stops it at the 4th item instead of the 5th. Aren't you using base 0.
    4. Can you change the time the wheel spins.
    Can you please check the above issues.

    upload_2018-7-31_15-59-9.png
     
  7. Star-Dust

    Star-Dust Expert Licensed User

    Thank you, but I'm not so good I have the same knowledge of @Informatix. He also knows java well, unfortunately I do not.

    1) I am aware of the problem I have not found a simple solution yet
    2) Yes, the central circle can not be enlarged at the moment, perhaps at the next update
    3) the position starts from zero. So 4 corresponds to 5.
    4) the time can be modified in the next update
     
  8. Mahares

    Mahares Well Known Member Licensed User

    As it is, AwesoneWheel1.PlayWheel(4) stops at the 4th item when it should stop at the 5th.
    I know English is not your native, but should it not be named: AwesomeWheel
     
  9. Star-Dust

    Star-Dust Expert Licensed User

    Update Library (and Sample) to version 0.04

    1. TimeLapse Field - Time frame that the wheel takes to cross each box - Defaults is 60 (milliseconds)
    2. FIX BUGS of PlayWheel
     
    Last edited: Aug 1, 2018
    asales likes this.
  10. asales

    asales Well-Known Member Licensed User

    Another little issue:
    with 8 parts (like the example), the sections and texts is centered, but If I use more or less parts, they are not.
    See the image in attached, with the wheel 2 (4 parts) and 3 (12 parts).
    wheel1.png
     
  11. Star-Dust

    Star-Dust Expert Licensed User

    Update Library (and Sample) to version 0.05

    1. Fixed bugs when decreasing text size. The central sphere no longer covers the text
    2. Possibility to change the size of the central sphere (add RadiusCentralBall field)
    3. Improved text centralization when the segments are odd
    4. Correct centralization of the segments
     
  12. LucaMs

    LucaMs Expert Licensed User

    I would like to suggest giving the possibility of adding an image for each sector and a central one.

    • AddItem (Voice As String, Color As Int, Bmp As Bitmap) As String
      Add a single voice on Wheel


    upload_2018-8-1_17-30-22.png



    [Also, I would change the list name from "Functions" to "Methods"]
     
  13. Star-Dust

    Star-Dust Expert Licensed User

    New: Add ios version
     
    Last edited: Aug 13, 2018
    asales, inakigarm and Erel like this.
  14. asales

    asales Well-Known Member Licensed User

    Two questions:

    1 - I see the StopWheel event, but how I can get a PlayWheel event (not the function) when I click in the Play button, like this:
    Code:
    Sub AwesoneWheel1_PlayWheel
       
    Log("started")
    End Sub
    2 - How I can change the time to keep the wheel in rotate state, without increase the TimeLapseTick, that turn slow to cross each cell?
    I have 10 items in the wheel and I want to keep the wheel rotate fast for 10 seconds minimun. If I increase the TimeLapseTick the wheel run too slow.

    Thanks in advance.
     
    Last edited: Aug 20, 2018
  15. Star-Dust

    Star-Dust Expert Licensed User

    1. At the moment there is no event that is raised when you click Play. It could be possible in the future
    2. This is more complex, you would like a rotation with a different step but with the same duration.Changing this is complex and needs to be changed inside. I do not know if it will be possible in the future
    3. Being a free library even if I will provide assistance, you will receive few updates. And I will hardly add more features
     
    Last edited: Aug 20, 2018
    asales likes this.
  16. asales

    asales Well-Known Member Licensed User

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