Mar 18, 2014 Replies: 52 This class wraps the native Switch view using JavaObject. This view was added in Android 4+. You can either add the view with the designer as a CustomView (don't forget to set Custom Type field) or add it by code. See the attached example. Edit: Switch is available in the ViewsEx library. Last edited: Jun 23, 2016 Click to expand...
This class wraps the native Switch view using JavaObject. This view was added in Android 4+. You can either add the view with the designer as a CustomView (don't forget to set Custom Type field) or add it by code. See the attached example. Edit: Switch is available in the ViewsEx library.
Erel B4X founder Staff member Licensed User Longtime User Aug 17, 2014 #21 Can you post a screenshot?
rleiman Well-Known Member Licensed User Longtime User Aug 17, 2014 #22 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. Last edited: Aug 17, 2014
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.
Erel B4X founder Staff member Licensed User Longtime User Aug 18, 2014 #23 Which device are you using? The switch appearance is non-standard.
rleiman Well-Known Member Licensed User Longtime User Aug 18, 2014 #24 Erel said: Which device are you using? The switch appearance is non-standard. Click to expand... 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.
Erel said: Which device are you using? The switch appearance is non-standard. Click to expand... 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.
D daemon Active Member Licensed User Longtime User Aug 29, 2014 #25 Request to add .Enabled = True / False property.
D daemon Active Member Licensed User Longtime User Aug 29, 2014 #27 woniol said: Please, read #5 Click to expand... Oh, cool!
Croïd Active Member Licensed User Longtime User Oct 4, 2014 #28 Add visible function ? Code: Dim sw As SwitchView ------------------------------ sw.visible = false #5: Code: sw.Switch.Visible = false Last edited: Oct 26, 2014
Add visible function ? Code: Dim sw As SwitchView ------------------------------ sw.visible = false #5: Code: sw.Switch.Visible = false
Croïd Active Member Licensed User Longtime User Oct 27, 2014 #29 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 = " "
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 = " "
Erel B4X founder Staff member Licensed User Longtime User Oct 28, 2014 #30 Try: Code: Dim jo As JavaObject = sw.Switch jo.RunMethod("setSwitchTypeface", Array (Typeface.MONOSPACE))
Try: Code: Dim jo As JavaObject = sw.Switch jo.RunMethod("setSwitchTypeface", Array (Typeface.MONOSPACE))
Croïd Active Member Licensed User Longtime User Oct 29, 2014 #31 Thanks Erel But how possible enlarge text ? I'm not sure txt take typeface
Erel B4X founder Staff member Licensed User Longtime User Oct 29, 2014 #32 Please use File - Export as zip when uploading projects. What exactly is the question? Have you tried the code I posted?
Please use File - Export as zip when uploading projects. What exactly is the question? Have you tried the code I posted?
Croïd Active Member Licensed User Longtime User Oct 29, 2014 #33 Yes, but I need enlarge character, I have a doubt if I use my own typeface Export as zip when uploading projects = sorry Attachments switchsymbol2.zip switchsymbol2.zip 7.7 KB · Views: 537
Yes, but I need enlarge character, I have a doubt if I use my own typeface Export as zip when uploading projects = sorry
Erel B4X founder Staff member Licensed User Longtime User Oct 29, 2014 #34 Try this: Code: Dim lbl As Label = sw.Switch lbl.TextSize = 20 [/cod]e
Croïd Active Member Licensed User Longtime User Oct 29, 2014 #35 Sorry ! does not work ! Attachments Capture.PNG 1.5 KB · Views: 597
Erel B4X founder Staff member Licensed User Longtime User Oct 30, 2014 #36 The custom font file is missing from the zip.
Croïd Active Member Licensed User Longtime User Oct 30, 2014 #37 Erel said: The custom font file is missing from the zip. Click to expand... Attachments symbols.zip symbols.zip 14.1 KB · Views: 488
Erel B4X founder Staff member Licensed User Longtime User Oct 31, 2014 #38 Seems like it is not possible to change the text size.
Croïd Active Member Licensed User Longtime User Oct 31, 2014 #39 Erel said: Seems like it is not possible to change the text size. Click to expand... desolated to have you lose time
Erel said: Seems like it is not possible to change the text size. Click to expand... desolated to have you lose time
ivanomonti Expert Licensed User Longtime User Dec 12, 2014 #40 Hi, how can I set a fixed size and the same for all!