Light/Dark Theme

odk-survey

(George Hare) #1

I really need to be able to switch between Day / Night themes in ODK2. This feature already existed in the ODK1 (Collect).

I have an idea how to do it, so I thought I would canvas the wider community for opinions. If I modify the ODK Survey app in android studio, to read a light sensor (I know it's not available in all handsets), could I then add a parameter to the survey form call (HTML) with a theme argument. Then I could use javascript to read the argument and select the CSS applied based upon it.

Thoughts?


(Waylon Brunette) #2

You could do something like that.

However, often people want to control when it goes into different themes. It might be annoying if you are in a space that is on the border of the auto switch and your theme automatically switches back and forth. In my humble opinion I think letting the user decide which theme to use is preferable since people have different reasons for wanting different themes and it is hard to cover all the reasons in code.


(George Hare) #3

Thanks Waylon. I agree in principle, the part I'm trying to avoid is this:

If the last time a user opened the app was in daylight, but it has now been dark for some time, I don't want the screen to come on with a bright daylight theme, potentially reducing the users night vision before the user can switch over to the night view.


(Waylon Brunette) #4

Well you could then use the light sensor for first open and then allow for manual control after that.


(George Hare) #5

That was my thinking.