Inherits SensorEventListener.
Class to help determine if we want to render day or night map - it uses the DayNightMode enumeration for its behavior
- it uses the LightSensor and needs calls from MapActivity on onPause and onResume to register/unregister the sensor listener
- it uses the SunriseSunset and LocationManager to find out about sunset/sunrise and use it
Note: the usage of SunriseSunset is not optimized in any way, it is recalculated on each demand. If this way it would be resource consuming, some recalculation threshold could be specified to recalculate the sun-rise/set only sometimes.
Note2: the light sensor threshold is hard coded to SensorManager#LIGHT_CLOUDY and could be made customizable
- Author:
- pavol.zibrita