OsmAnd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Package Attributes
net.osmand.plus.activities.DayNightHelper Class Reference

Inherits SensorEventListener.

List of all members.

Public Member Functions

 DayNightHelper (OsmandApplication osmandApplication)
void setDayNightMode (DayNightMode mode)
Boolean getDayNightRenderer ()
void onMapPause ()
void onMapResume ()
void onAccuracyChanged (Sensor sensor, int accuracy)
void onSensorChanged (SensorEvent event)

Package Attributes

DayNightMode dayNightMode = DayNightMode.AUTO

Detailed Description

Class to help determine if we want to render day or night map - it uses the DayNightMode enumeration for its behavior

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

Constructor & Destructor Documentation


Member Function Documentation

Returns:
null if could not be determined (in case of error)
true if day is supposed to be
void net.osmand.plus.activities.DayNightHelper.onAccuracyChanged ( Sensor  sensor,
int  accuracy 
)

Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines