Android Question Night & Day User Interface

stu14t

Active Member
Licensed User
Longtime User
I have developed a series of applications for use in the construction industry. Now these applications will be used both indoors, outdoors, in the day and at night too.

I've noticed that my current layouts are best seen in dull or dark conditions, so my question is, are there any good pointers or sites that offer guidance on how to develop different user layouts that can be seen better in the day,night, in sunlight etc. Short of changing the colors of all layouts and views, is there a better way to alter colour schemes across all layouts.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can use PhoneSensors to measure the light level. It is not possible to change the theme at runtime. You can however create two activities for each "task" one with the light theme and one with the dark theme.

Move all the code you can to a class and then you will be able to switch between light and dark layouts.
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
Another approach to solve the problem.. if the views on the layout are few, then you can duplicate them, hide one set and show the other as the case may require.. your users can use a menu or a button to manually select one set for night and the other for day, instead of using sensors..
Again this solution is only good if the views are very few.
If you put every two views in array (btnExit(0), btnExit(1) then you don't need to change a single line of code.
 
Upvote 0

stu14t

Active Member
Licensed User
Longtime User
There are quite a lot of views as I have 4 tabs, grids and various other controls. However, I wonder if I could place them on transparent panels and switch between the two, with the two colour schemes and switch between panels and use an array of views?
 
Last edited:
Upvote 0
Top