I’ve just started using the G4P library to develop an app in Android mode. It seems that you have to touch a slider first to give it focus, before it actually reacts. The problem is that if you have more than one slider, touching one slider affects the slider which previously had focus. Here’s my sketch (just two sliders so far):
Am I doing something wrong? Is this expected behaviour or a bug? This doesn’t happen if I run it in Java mode on the computer. Clicking on the second slider with the mouse immediately gives it focus. (I’ve given up trying to use the Android mode emulator, it takes longer than running the sketch on the actual device and always times out waiting for the “emulator to become available”.)
In android you have to tap on it first to give it focus, then make the adjustment. Note that in your demo the blue slider bar changes color when it has focus.
Yes, I realize you have to tap on it to give it focus. But the problem is, tapping on the second slider also moves the first slider that previously had focus. Does the library work in Android mode?
I managed to find the Github repository (Issues · sojamo/controlp5 · GitHub), after a bit of hunting. The link to “Source Code” on the library web takes you to the old Google Code archive.
Anyway, on the Github repository, there are 87 open issues, none of which have been assigned to anyone. Does this mean the library is no longer being supported?
@jafal According to the description on the Processing web site, ControlP5 is “A GUI library to build custom user interfaces for desktop and android mode.” If that’s not true, somebody should update the description so people won’t waste their time.
I’m curious why you have two controllers for each slider? You might try taking one of the slider examples (File/Examples/ControlP5) and upsizing it for Android and see if that code runs ok on Android. One of the examples has multiple sliders.
Does the library work in Android mode?
It seems to me that there has been a problem in the past but unfortunately I can’t remember the details. I do know that I have made my own custom slider for Android so there must have been something wrong or I wouldn’t have felt the need to do that. Another option is to use an Android SeekBar as an alternative.
@jafal I looked at the Skatalo repository. Under the heading “What is the difference?”, it says:
" This library is for an advanced use of ControlP5, it is not as convenient to use. It is a part of a research and development project involving multi-touch, augmented reality and Ruby.
Please use the original library in your projects if you are not sure which one to use."
Two conrollers for each slider? If you mean these lines, they’re only modifying the text attributes for the caption and value labels. Unless I’m totally out to lunch on this, I think I only have one controller for each slider.
It’s not just about getting the sliders to work. I have two more basic questions:
According to the Processing web site, ControlP5 supports Android mode (“A GUI library to build custom user interfaces for desktop and android mode”). Is that true?
Is anybody still supporting it, or is it orphanware? The open issues on the Github page haven’t been assigned to anybody.
There may be a larger problem than we think. @jafal is correct when he reports that touching the screen anywhere but one of the sliders will change the value(s). Try running your original demo and set one of the sliders then touch somewhere else on the screen (besides the other slider). On my system the slider value that was just set is changed. I think you may need to look for an alternative.
Seems you’re right about that. Not only do you have to tap on the slider once to give it focus, then tap again to move it (a minor usability issue in my opinion), but tapping anywhere outside of the slider which currently has focus causes the slider to move (a major usability issue, in my opinion).
There doesn’t seem to be much point in opening an issue on the Github page if nobody is supporting it, though.