B4J Library B4j ToggleSwitch

stevel05

Expert
Licensed User
Longtime User
Hi Roger,

This thread just contains a very basic implementation that anybody can use as a template and change as they wish. If you want to share your modified version, feel free to do so in a new thread and explain what you have changed.

BTW, there is a small error (check the log window) that should be addressed before you share it.
 

ThRuST

Well-Known Member
Licensed User
Longtime User
ok I should update my previous post, sorry for taking advantage of your code.
I do like my addions, it made it a bit better in fact
 

ThRuST

Well-Known Member
Licensed User
Longtime User
What bug are you talking about? Both of our code is perfect. Or are you trying to tell me something else?
What if I'm Tuco's brother in Breakin' bad Steve (Netflix success TV series) hahaha
 

ThRuST

Well-Known Member
Licensed User
Longtime User
Whooaaa Steve... that's a great plan is it?

hahahah

 

ThRuST

Well-Known Member
Licensed User
Longtime User
Oops sorry I totally missed that. Thanks for notifying me. I will update my post with v1.1
 

ThRuST

Well-Known Member
Licensed User
Longtime User
Hi Steve. I updated my changes to v1.2 which should be the best yet.
 

ThRuST

Well-Known Member
Licensed User
Longtime User
Hi again Steve, I couldn't let go of it. I updated your library to v1.3

See my post #19 to find it.
 

ThRuST

Well-Known Member
Licensed User
Longtime User
Steve, it would be nice with a fading effect on the text everytime the button is clicked. How to do that
 

ThRuST

Well-Known Member
Licensed User
Longtime User
Steve, do you mind adding calls to these subs in your class. It will save me alot of time if you do it. Thanks

B4X:
Public Sub FadeIn
    TSLbl.SetAlphaAnimated(mDuration /2, 1)
End Sub

Public Sub FadeOut
    TSLbl.SetAlphaAnimated(mDuration /2, 0)
End Sub
 

VittorioBarile

Member
Licensed User
Hi, I'm trying to use your lib on B4X Pages project.
In my first page it works, but when i close it and open another B4XPage, it doens't show button switch:

in my AppStart it works, but when i close this layout and open a new one it doesn't show button switch, but only text!

AppStart:
MainForm = Form1
MainForm.Stylesheets.Add(File.GetUri(File.DirAssets,"ToggleSwitch.css"))
MainForm.Show

OnClick new page:
B4XPages.ShowPageAndRemovePreviousPages("NewPage")

could you help me?
 
Last edited:

stevel05

Expert
Licensed User
Longtime User
Sorry I somehow missed this post, did you get it fixed? If not post a project showing the problem.
 

stevel05

Expert
Licensed User
Longtime User
Just a thought, did you add the stylesheet to the form in the new page?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…