Specify different color for the current day only in day list items!

To make the topic more beneficial
Q: How to add this list (column) to an existed list which was fed from csv files already ?


Maybe just read this sample?

1 Like

How do you mean, it is already in a list...or do you want the html content added to items in a list as well? The issue would be that when the current day changes, the list will no longer be correct?

Guys Please forgive my above silly Q
Doesn't seem clear enough

What I meant
Say I want to create a table of diet organising, contains what to eat every day from the day 1 to the day 31 of the month as follows
day 1: Apple, avocado, oats, almond milk, etc
day 2: Salad, nuts, tuna, egg........ etc

I want the app to highlight the day as well as the whole row so that I can reach what I should eat easily

I hope it's clearer now

Thank you for patient

The Clock component (from the Sensors drawer) has blocks to extract the day of month from Click1.Now() block.

You can use that as an index into a list of daily prescriptions, loaded from a text file in the Media folder (//filename.txt) at startup.

When the file arrives (File1.GotText) split it at \n and load it into a global Prescriptions list.
To get a prescription for a day(1-31):
select item Day from list Prescriptions.

1 Like

Thank you so much for the prompt reply and comprehensive information
However for a beginner like me I will find it not easy to figure out this appreciated explanation
If you got free time I will be grateful if you create a very simple example in aia format

But with no doubt your response was great thanks

Start with the free book ...

1 Like

Hi again
Unfortunately despite the solution was perfect but I am seeking advice on two issues :slight_smile:

  1. The above doesn't seem working in all devices, I've tried the app on samsung galaxy note 3 (old device) android version 6, and didn't display the highlighted day

  2. I would like to highlight the whole row not only the inline span but the text background of the block behind the text (hope it's clear)
    I trust your powerful experience and
    Looking forward to hearing from you guys :pray:

In answer to 2

Set the label width to Automatic
add three " " to each side of the item

to keep the width constant, you may want to add a 0 to numbers 1-9 (after the test), and use a monospace font

In answer to 1

Not had a chance to test on a < android 7 device, yet....but also check your companion is up to date, try compiled app ?

1 Like

Man you are amazing
I will try it and get back to you
Thank you so much

Tested on a 5.1 device (API 22) and neither span or background-color work as html modifiers in a label

However, if you do it like this:

then your date numbers from 1-9 will have a 0 added

I have now reworked this to use three labels
( gives an empty label at the top or bottom for day 1 and day 31 respectively )

changeItemColour3Labels.aia (5.2 KB)

1 Like

What a professional expert
That's so perfect man :clap: :clap: :clap:

That encourages me then to seek your advice and help in the whole project then
Please have a look to the pictures attached as well as the aia file to finalise the challenge

I aim to add 3 more columns (lables) along with the day lable (br stands for breakfast, lun stands for lunch, din stands for dinner)
I uploaded a csv file that feeds that information(I will fill the meals later)
and then highlight (change the colours) for the whole row according to two factors
the current date
and (optional) the upcoming meal based in the time from/to
for instance if the time is between 7am to 10 the up should highlight breakfast record
and so on

changeColour3Labels_3Columns.aia (5.8 KB) diet.csv (695 Bytes)

I want it to look like that

I will really be too much grateful and thankful for your help
Greatly appreciated in advance

:pray: :pray: :pray:

As you continue to expand your requirements.....I believe there is a better way to do this. Have a look at @Ken 's TableView extension

1 Like

Get's you most of the way there:

not able to set the colour of a specific cell, unless @Ken is in the mood to create a module to do that....

1 Like

I can't find enough word to thank you :pray: :pray: :pray: :pray: :clap: :clap: :clap: :clap:
But I really appreciate your help and effort
That's really fantastic

you have even widen my mind to think about other things that I have never heard about
extensions !!!

Would you please complete your generosity by sending me the aia file of the above beautiful blocks ?


tableViewDateColour.aia (25.2 KB)

1 Like

Great job and appreciated help thank you so much

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.