Android Question Arranging a group of controls

Sanxion

Active Member
Licensed User
Longtime User
Hi

I have a group of controls (labels, imageviews etc) that collectively form a "test". Once this test has been completed, the user will move to the next one that will also comprise of a set of controls...and so forth.

My question concerns how best to "group" these controls for each test? Should I use a new layout for each group, a panel or a different object? Also, how would I would be able to view the groups in the designer and reference them from the code?

Thank-you in advance!
 

JonPM

Well-Known Member
Licensed User
Longtime User
Is each group going to be in its own activity? Or will you have just 1 activity to show them all? If the latter is the case I would myself use new layouts for each
 
Upvote 0

Sanxion

Active Member
Licensed User
Longtime User
Hi

Each group will be an individual lesson or activity. Once that lesson is complete the user will move to the next.
I should add, there will be hundreds of individual lessons.
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
you can group them (views) in panels.

I prefer a few sets of panels instead of activities for "normal" situations.

This is more like a "what the hell?" kind of situation.

What kind of lessons is this? or do you mean a test? like a question + picture that needs to be answered?

in the second case you can work with one that you just update with the right content.
 
Upvote 0

JonPM

Well-Known Member
Licensed User
Longtime User
Hi

Each group will be an individual lesson or activity. Once that lesson is complete the user will move to the next.
I should add, there will be hundreds of individual lessons.

If there are hundreds of lessons then you wouldn't want to use an activity for each. As sorex recommended I would also use just one layout file, and update the controls (labels, etc) with the correct content after the user completes the lesson.
 
Upvote 0

Sanxion

Active Member
Licensed User
Longtime User
you can group them (views) in panels.

I prefer a few sets of panels instead of activities for "normal" situations.

This is more like a "what the hell?" kind of situation.

What kind of lessons is this? or do you mean a test? like a question + picture that needs to be answered?

in the second case you can work with one that you just update with the right content.

If I use a panel for each lesson, how should I add these in the visual designer?

They are grammar lesson, eg. Identify the noun, verb, adjective in this sentence...

Once correctly answered, move to the next one.
 
Upvote 0

JonPM

Well-Known Member
Licensed User
Longtime User
The important question is does the layout change for each individual lesson? If not then create only one layout
 
Upvote 0

Sanxion

Active Member
Licensed User
Longtime User
The important question is does the layout change for each individual lesson? If not then create only one layout
The overall layout with the header and buttons for "back" and "next" stay the same throught the app. The part that changes is the middle portion that displays different labels and images depending upon what the lesson is.
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
if the amount of labels and images is about static I'll just go for

1 static header panel
1 content panel that gets updated based on the back/next button events

even if one "page" has less labels and buttons you can easily hide them in these events.

just start with the maximum and hide what you don't need for that question.
 
Upvote 0

Sanxion

Active Member
Licensed User
Longtime User
if the amount of labels and images is about static I'll just go for

1 static header panel
1 content panel that gets updated based on the back/next button events

even if one "page" has less labels and buttons you can easily hide them in these events.

just start with the maximum and hide what you don't need for that question.

I don't think that will work as the number of controls will vary for each lesson. I suspect I will have to use panels...lots of them.
Therefore, how do you reference e.g. a particular panel's button click?

Also, I am assuming each new panel will have to be placed over the previous one in the designer? Is there a way to access the previous panels directly?
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
you can have a bunch of panels that you put outside the screen.

put them in an array and when using the buttons you can just use

mypanels(panelnr).hide 'hide current
' set the new one to the right position (only needed once otherwise editing will be a pain in the designer)
mypanels(panelnr-1).show (-1=previous +1=next)

altho hundreds of panels is still insane.
 
Upvote 0

Sanxion

Active Member
Licensed User
Longtime User
you can have a bunch of panels that you put outside the screen.

put them in an array and when using the buttons you can just use

mypanels(panelnr).hide 'hide current
' set the new one to the right position (only needed once otherwise editing will be a pain in the designer)
mypanels(panelnr-1).show (-1=previous +1=next)

altho hundreds of panels is still insane.

Thanks, that is useful...how would I reference a particular buttons click event from one of the many panels?
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
You need to be much more precice on what you have on the different panels.
You could have one Panel and load the different layouts you need.
It's possible to load more than one layout onto a same panel.
But you need to know what you have on a panel at a given time to manage the objects on this panel.
These layouts could be a genaral layout with the Back and Next button and then load additional layout(s) for the other objects.
Depending on how many different layouts you have the management of these could become combersome.
So, without knowing more in detail your needs it's difficult to give a concrete advice.
Do you have some examples of the different layouts you need.
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
Thanks, that is useful...how would I reference a particular buttons click event from one of the many panels?

you keep a counter that you increment or decrement depending on which button is pressed. you have the buttons once, not on every panel.
 
Upvote 0

Sanxion

Active Member
Licensed User
Longtime User
You need to be much more precice on what you have on the different panels.
You could have one Panel and load the different layouts you need.
It's possible to load more than one layout onto a same panel.
But you need to know what you have on a panel at a given time to manage the objects on this panel.
These layouts could be a genaral layout with the Back and Next button and then load additional layout(s) for the other objects.
Depending on how many different layouts you have the management of these could become combersome.
So, without knowing more in detail your needs it's difficult to give a concrete advice.
Do you have some examples of the different layouts you need.

I assumed I would have one general layout that would contain a header and a footer. The middle portion of the layout would have a panel (panel 1), that will comprise of several labels and image views. The controls collectively is what would be used to display the lesson. Once the user has completed the lesson, they would click on the "Next" button contained in the footer. "Panel 1" would then be made invisible and "Panel 2" would be made visible and display the next lesson. The number of controls would vary from panel to panel.

I hope that is clear.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
OK, I understand the general flow.
But to be able to give a concrete advice, we need to know the details on the different lesson Panels.
The number of controls would vary from panel to panel.
That's exactly the core of the problem !
How many different specific layouts do you have ?
Depending on the answer to this question, the solution could or would be different !
 
Last edited:
Upvote 0

Sanxion

Active Member
Licensed User
Longtime User
OK, I understand the general flow.
But to be able to give a concrete advice, we need to know the details on the different lesson Panels.

That'a exactly the core of the problem !
How many different specific layouts do you have ?
Depending on the answer to this question, the solution could or would be different !

There would be as many different combinations of labels and image views as there are words in a sentence - which is the essence of the lessons.

I don't think it would be possible to group together similar combinations are there are just too many. Also, these words have vowel markings on them which I am using additional labels for. I'm afraid it's just not possible to say how many combinations there would be.
 
Upvote 0

JonPM

Well-Known Member
Licensed User
Longtime User
We are trying to help you create the simplest solution to your task, but if you say however that it's not possible then go ahead and make layouts for each and every panel.
 
Upvote 0

Sanxion

Active Member
Licensed User
Longtime User
We are trying to help you create the simplest solution to your task, but if you say however that it's not possible then go ahead and make layouts for each and every panel.
Please don't misunderstand me, I appreciate your input which is the reason I am asking for your help. The easiest solution is usually the best one.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
There would be as many different combinations of labels and image views as there are words in a sentence - which is the essence of the lessons.
That's quite different from your first post !?
Unfortunately I don't understand your problem !?
You need to give more information.
From what you are telling us till now, I am afraid that you need to define each layout dynamically in the code.
But as already said without knowing the EXACT details I can't help more!
 
Upvote 0
Top