B4A Class Switch view (Android 4+)

Discussion in 'Additional libraries, classes and official updates' started by Erel, Mar 18, 2014.

  1. Erel

    Erel Administrator Staff Member Licensed User

    Can you post a screenshot?
     
  2. rleiman

    rleiman Well-Known Member Licensed User

    Hi Erel,

    I also added the switch view to my current app I'm working on as a CustomView in the designer and the result of using:

    Code:
    SwMute.TextOff = "Normal"
        SwMute.TextOn = 
    "Muted"
    Is the same. The text does not show up.

    For now I think I will need to use a Label view and alter the text on that based on the true and false checked value of the switch view.

    Here's the screen shot.
    No text on switch views.png
     
    Last edited: Aug 17, 2014
  3. Erel

    Erel Administrator Staff Member Licensed User

    Which device are you using? The switch appearance is non-standard.
     
  4. rleiman

    rleiman Well-Known Member Licensed User

    Hi,

    It's a Chinese replica phone model SM-G900.

    The phone is a clone of the Samsung S5 and is running Jellybean modified to look like KitKat.
     
  5. daemon

    daemon Active Member Licensed User

    Request to add .Enabled = True / False property.
     
  6. woniol

    woniol Active Member Licensed User

    Please, read #5
     
    daemon likes this.
  7. daemon

    daemon Active Member Licensed User

    Oh, cool!
     
  8. Croïd

    Croïd Active Member Licensed User

    Add visible function ?

    Code:
    Dim sw As SwitchView
    ------------------------------
    sw.visible = 
    false
    #5:

    Code:
    sw.Switch.Visible = false
     
    Last edited: Oct 26, 2014
  9. Croïd

    Croïd Active Member Licensed User

    Please, Do you have a solution for typeface ?

    sw.typeface and sw.switch.typeface = not possible, and I need to change character for sw.TextOff = " "
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    Try:
    Code:
    Dim jo As JavaObject = sw.Switch
    jo.RunMethod(
    "setSwitchTypeface"Array (Typeface.MONOSPACE))
     
  11. Croïd

    Croïd Active Member Licensed User

    Thanks Erel

    But how possible enlarge text ? I'm not sure txt take typeface
     
  12. Erel

    Erel Administrator Staff Member Licensed User

    Please use File - Export as zip when uploading projects.

    What exactly is the question? Have you tried the code I posted?
     
  13. Croïd

    Croïd Active Member Licensed User

    Yes, but I need enlarge character, I have a doubt if I use my own typeface

    Export as zip when uploading projects = sorry
     

    Attached Files:

  14. Erel

    Erel Administrator Staff Member Licensed User

    Try this:
    Code:
    Dim lbl As Label = sw.Switch
    lbl.TextSize = 
    20
    [/cod]e
     
  15. Croïd

    Croïd Active Member Licensed User

    Sorry ! does not work !
     

    Attached Files:

  16. Erel

    Erel Administrator Staff Member Licensed User

    The custom font file is missing from the zip.
     
  17. Croïd

    Croïd Active Member Licensed User

     

    Attached Files:

  18. Erel

    Erel Administrator Staff Member Licensed User

    Seems like it is not possible to change the text size.
     
  19. Croïd

    Croïd Active Member Licensed User

    desolated to have you lose time
     
  20. ivanomonti

    ivanomonti Well-Known Member Licensed User

    Hi,

    how can I set a fixed size and the same for all!


    10846270_816648275065947_6670412872018164903_n.jpg
     
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