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
Can you show us images of layouts you have now? Or perhaps of an existing app that does what you are wanting to do?
 
Upvote 0

Sanxion

Active Member
Licensed User
Longtime User
Can you show us images of layouts you have now? Or perhaps of an existing app that does what you are wanting to do?

I quickly drew these images whilst preparing my breakfast this morning.
Each image comprises of a "main layout" with a header/footer that remains constant. The middle section is the part that holds the actual lesson and changes with each one.
 

Attachments

  • IMG_20151128_060925-1024x768.jpg
    IMG_20151128_060925-1024x768.jpg
    87.1 KB · Views: 201
Upvote 0

Sanxion

Active Member
Licensed User
Longtime User
Is this a translator application ?
Are there user interactions in the middle part of the screen ?
Where does the information in the header and in the middle come from ?
What kind of data is it ?
etc.
No its not a translator application, it is a grammar teaching app.
Yes, in the middle of the screen, the user can touch the vowel markings which will then change. That is the main part of the user interaction.
The header will be static, probably a label or two. The middle is text on labels. B4A is quite good at handling right-to-left languages like Arabic. (Thanks Erel).
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Do you really want us to help you?
Why don't you answer the questions we ask !?
Where does the information in the header and in the middle come from ?
What kind of data is it ?

There are already 24 posts and we still don't have an explaination on what you want to do !
Again what is the user supposed to do, in what conditions and according to what data?
Without these answers it is impossible to give concrete advices !
 
Upvote 0

Sanxion

Active Member
Licensed User
Longtime User
Do you really want us to help you?
Why don't you answer the questions we ask !?
Where does the information in the header and in the middle come from ?
What kind of data is it ?

There are already 24 posts and we still don't have an explaination on what you want to do !
Again what is the user supposed to do, in what conditions and according to what data?
Without these answers it is impossible to give concrete advices !
I have attempted to explain my request in several posts, I have provided several diagrams to illustrate, if that is still insufficient to clarify what the app is intended for and the manner in which it will operate, I think I will leave it at this point - which is very unfortunate as the idea of moving from one activity to another upon its successful completion is a very simple concept. Thank-you for your assistance and patience in the matter.
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
I have provided several diagrams to illustrate, if that is still insufficient to clarify what the app is intended for and the manner in which it will operate,
You explained the general behaviour of the program which I understand, but that's not the problem for me.
Yes, in the middle of the screen, the user can touch the vowel markings which will then change.
That's for me the core point of the problem and this one you haven't explained in detail.
What kind of objects exposed to the user from what kind of data and what criteria.
For me, like the other helpers, having one Activity per lesson is not a solution.
I would suggest one activity with one Panel for the middle part, remove all views and load the next layout onto this panel.
Then the question if you need one layout file per lesson depends on what you need on each lesson.
I think it would be interesting to construct the layout for each lesson dynamically in the code.
But without knowing how you intend to construct these layouts I can't help.
That's why I was insisting with my repetitive questions !!!
 
Upvote 0

Sanxion

Active Member
Licensed User
Longtime User
You explained the general behaviour of the program which I understand, but that's not the problem for me.

That's for me the core point of the problem and this one you haven't explained in detail.
What kind of objects exposed to the user from what kind of data and what criteria.


I say: the only "objects" that will be exposed will be labels that have words on them and labels which have vowel markings on them that the user will click on to access the other vowels. These words will either come from labels that I have introduced manually or they could be read from a database but that presents another problem:
Reading the information from a database and programatically generating the activity would be the ideal solution, but that would make positioning the "vowel markings control" onto the label very difficult as it would be very difficult to know where to position it if done in code. At the moment I can drag a label, set the text and then position the vowels in the designer very easily.


For me, like the other helpers, having one Activity per lesson is not a solution.
I would suggest one activity with one Panel for the middle part, remove all views and load the next layout onto this panel.
Then the question if you need one layout file per lesson depends on what you need on each lesson.
I think it would be interesting to construct the layout for each lesson dynamically in the code.
But without knowing how you intend to construct these layouts I can't help.
That's why I was insisting with my repetitive questions !!![/QUOTE]
You explained the general behaviour of the program which I understand, but that's not the problem for me.

I say: another issue I am having difficulty with is the precise definition of the terms "layout" and "activity".
When I first read the developers guide 4 years ago, it was my understanding that a "layout" was in essence a complete screen "canvas" that was analogous to a "form" in Visual Studio (.NET). This would then be used to drag and drop controls onto it, such as labels and panels. However, in this thread it appears "layout" is being used as a generic term to group together related controls. Is that correct or have I misunderstood?
 
Last edited:
Upvote 0

Sanxion

Active Member
Licensed User
Longtime User
I'd use a database.
"Coding" adequately the db data, I would be able to build a routine that is able to build the central part of the activity (I think a ScrollView, not to a Panel).
Please see my response below regarding why using a database would be difficult for my specific needs.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I say: the only "objects" that will be exposed will be labels that have words on them and labels which have vowel markings on them that the user will click on to access the other vowels.
This is the core problem!
Unfortunatley I still dont understand in detail what you want to do.
Don't you have an example of a layout ? Or already a project with an example.
A label with a word, and the labels for the vowels. And the flow of a lesson, what the user is supposed to do.
Instead of having predefined layout files you could save the number of objects with their dimensions and positions and construct the layout dynamically in the code. This would be compatible with a database.
I'm afraid that you'll need specific management routines for each lesson, but I can't give any advice not knowing what management the lessons need.

A layout is a group of objects, defined in the Designer and saved in a file, you can load onto an Activity or onto a Panel.
You can also add objects to the Activity or panels in the code.
An Activity is a 'screen' which can have objects on it. There is only one Activity active at the same time.

Did you have a look at Different examples with 2 layouts ?
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
This is no longer a technical question (because the answer would be to fill a Panel or a ScrollView at runtime) but a request for analysis of the project to be implemented.

It is as if I asked:

"I have to make my card game:
How must I manage players at the table?
How must I give the cards?
..."

I think I understand (but I'm not sure) that this is similar to the "hangman game" but with texts to be translated.
 
Upvote 0
Top