At the moment I am building an app for a smartphone on Android which will be used to control a telescope. One of the requirements is the ability to switch to “Night View” mode by pressing one button.
During “Night View” mode the application is dimly lid and ALL the UI elements are in one color (red).
During all lifecycle changes the color and illumination level should be the same. So no white flashes when changing to another part of the application, using a spinner, entering text with the build in keyboard or performing some other task.
Although I am new to Android programming, I am aware how to change a color of an UI element in a XML file or programmatically by pushing a button. I am unable to do this for all elements in the app and for the build in keyboard.
You will want to create two different themes for your app day/night with contains your styling information for button textColor, background color and all that shenanigans. Then in your xml you will want to reference styles rather than specific colors for color/text etc.
On pressing the button switch the themes, which will have different (but similarly named) styles associated that you xml layouts will now reference.
on pressing the button you will want to do something like this.
For more look here.
http://developer.android.com/guide/topics/ui/themes.html