Android Question Looking for a level setting graph view

nwhitfield

Active Member
Licensed User
Longtime User
I'm thinking of ways to make an app of mine easier to use. At the moment, it allows you to control the level of two channels on a device, using + and - buttons for each channel.

I'd quite like people to be able to set these to adjust over time, and one way that strikes me as fairly intuitive would be a graph like display, where people could draw with their finger, to represent the levels.

So, for example, they might just draw a straight line across for channel A at 50%, but for channel B have it slowly work up to a level, drop back down, and so on.

Obviously, there are things to take into account, like if you scroll off to the right, does that make the sequence longer, or what if you want to edit a line, and so on.

I've tried searching on various terms, but not found anything just yet. I wondered if anyone else had come across a library (B4a or Java) that might do the trick, or if I'm going to have to try and be bold enough to code it from scratch.

Nigel
 

klaus

Expert
Licensed User
Longtime User
Did you have a look at SeekBar?
Or search for SeekBar in the forum.
So, for example, they might just draw a straight line across for channel A at 50%, but for channel B have it slowly work up to a level, drop back down, and so on.
Sorry, but I dont understand what exactly you mean.
 
Upvote 0

nwhitfield

Active Member
Licensed User
Longtime User
A seekbar is really only letting you do stuff in one dimension - this is two.

Well, let's say that the two levels are controlling different lights. The period across the screen is 24 hours, and the Y axis is the brightness of the light

Instead of setting up on/off times, you might decide you want one light on at 50% all the time. So you might tap to say "Set channel A" then just draw with your finger a line across the middle of the screen.

Then, for the other light, you might tap "Set channel B" and drag your finger across at the bottom, until around 7am, then slowly upwards until it's at 100% by 9am. It might stay there, then fade back down, and up, at different times of the day.

Instead of filling in a schedule, you're drawing the settings you want, across the X (time) axis. You could use the same for temperatures, audio volumes, and so on.

I think for a lot of people, if you have something like this that changes over time, it's easier to visualise when it's represented in a graphical way, and if you're displaying the representation graphically, it would be a shame not to be able to create the settings that way too.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
If I understand well you want to have a kind of diagram where you can draw line segments or modify line segments which represent a desired amplitude variation over time and this for different channels?
At my knowledge there is no B4A library for that.
But it could be done.
 
Upvote 0

fixit30

Active Member
Licensed User
Longtime User
It may be easier to use a bar chart in conjunction with a spinner? Click on a time segment in the chart and then use the spinner to adjust the value.
 
Upvote 0

nwhitfield

Active Member
Licensed User
Longtime User
Yes, that's pretty much exactly it, Klaus. I guess I'll have to sit down and tackle it myself, then. Oh well, I need a new project to get stuck into.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I think that this is what you are looking for.
Work in progress.
You can add a new point, move an existing point.

upload_2017-5-2_13-3-14.png

The image shows adding a new point.
 

Attachments

  • SetLevelDemo.zip
    9 KB · Views: 306
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
Attached a new version.
You can add points by moving on the screen.
You can delete points, the first and last points cannot be deleted.
You can edit a points coordinates.

upload_2017-5-4_11-19-29.png


The top SetLevels CustomView is added in the Designer and the lower one in the code.
The upper image shows a selected point.
The bottom image shows the insertion of a new point.

upload_2017-5-4_11-21-22.png


The bottom image shows the editing of the coordinates.

Can you please test it and report about any bug.

Removed the zip file, new version in post #14.
 
Last edited:
Upvote 0

nwhitfield

Active Member
Licensed User
Longtime User
Yes, I'll give that a go as soon as I have a spare moment. I've had no broadband for 24 hours. It was like being back in the 1990s again, but without the sense of optimism.
 
Upvote 0

nwhitfield

Active Member
Licensed User
Longtime User
Thanks; that gives me something to work with - though there's a bug in editing - tap select to enter edit mode, then tap a point, tap adjust. The ok button isn't visible unless you tap Select again, and then it gives an array index out of bounds exception..
 
Upvote 0
Top