B4A Library SlideSwitch V1.0.2

DonManfred

Expert
Licensed User
Longtime User
this is a small project to show the problem
i see the problem.
Sadly i cant find a solution. The slide-functionality cannot be deactivated, setting a onclickevent will not work too.
Using the touch to slide on/off does not work inside a viewpager. But a single click on in will change the state
It is not ideal but it works.

I would suggest to not use this component inside a viewpager. Consider using a normal switch instead
 

ArminKH

Well-Known Member
@DonManfred
Thank u
I know click on slide switch works but the slide is not good inside ahviewpager
Is possible to solve this problem inside AhViewPager side ?
Thats not possible to release a modified version for deactive slide event?
Its good for me if state can be changed by using click and not work by using slide
Thank u again for your response this is very important for me to use your lib in my app
If this problem cant be solved then we must use 2 image for state on and off i think
 

walterf25

Expert
Licensed User
Longtime User
I'm simply not willing to do so much donkey work. Be my guest, take all my libraries and write the code for every method in ViewWrapper or other.
Uh Oh, somebody got grumpy!
And this is the reason i don't post all the libraries i write, as I only wrap the functions that are of importance to me when i need a library in any of the apps I make for my clients. I'm the type of person who thinks that if you're going to do something you gotta do it right or don't do it at all. But that's just me .
Any how my comment is not meant for you to get upset bud, I know you're going through hormonal changes so i'll let it slide this time.

 

thedesolatesoul

Expert
Licensed User
Longtime User
I'm not grumpy
I am also the type of person who thinks that if you're going to do something you gotta do it right or don't do it at all, unfortunately what is 'right' isnt the same for both of us. In my opinion, there should be a system of automatically inheriting the docs from the source lib. This will ensure there are less errors and the docs are always up-to-date. Your solution is error-prone and requires an update everytime the underlying java-docs is updated for whatever reason. I think everything that can be, should be automatically generated and built from source, wherever possible.
 

corwin42

Expert
Licensed User
Longtime User

Maybe the library needs to change the onTouchEvent() method to implement this solution.
 

ArminKH

Well-Known Member
thank u @corwin42
I am not familar with java syntax maybe mr @DonManfred can solve this problem or suggest a good solution like your above link solution on b4a
If this can be solved or not thank u both for your hard work
 

DonManfred

Expert
Licensed User
Longtime User
aybe the library needs to change the onTouchEvent() method to implement this solution.
Seems to do the job! Thanx you very much for this hint, @corwin42!

Will update the library soon

Edit: Library updated to V1.0.2 (See Post #1)
 
Last edited:

walterf25

Expert
Licensed User
Longtime User
Great library Don, one question though, is it possible to change the color of the switch when in the off position, i know you can change the color but it only shows the chosen color when the switch is on (or clicked to the right), i would like to find out if possible to change the color of the background when the switch is moved to the Off(or left position).

Thanks,
Walter
 

devmobile

Active Member
Licensed User
Hey how can i prevent client on switch?(i need that user slide switch not click on it)
THanks
 

GMan

Well-Known Member
Licensed User
Longtime User
Hoi DonManfred,

is this the rigth syntax to catch an event on i.e. ssw1 ?

B4X:
Sub ssw1_open(swview As Object,token As Object)
    txtInput.Text = "R1H"' & CRLF
    btnSend_Click
End Sub
Sub ssw1_close(swview As Object,token As Object)
    txtInput.Text = "R1L"' & CRLF
    btnSend_Click
End Sub
 

GMan

Well-Known Member
Licensed User
Longtime User
Thats the kind of answer i like to her from a wrapper
You are pumping out libraries right now, trying to break some record? Erels perhaps?
Yeah, but .....
 

DonManfred

Expert
Licensed User
Longtime User
That´s the kind of answer i like to hear from a customer of FREE libraries.
Yeah, but .....
Feel free NOT TO USE my libraries. I´ve lost the source. Shit happens.
If the lib does not do what you expect then use another library.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…